Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
393 views
in Technique[技术] by (71.8m points)

json - Is there a way to convert a string into a function? (get code from an API)

let's say that i have a simple local variable:

local foo = 1

when i do print(foo) will show 1.

but is possible to something like

local printingOne = 'print('1')'

and then

SomeCommandToConvert(printingOne)

to show 1 too ?

this is a simple example, but in reality i wanna get functions from an API, so i will get those via json, which will be an string in the end.

if something like this is possible in another language let me know too...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to MLink Developer Q&A Community for programmer and developer-Open, Learning and Share

1.2m questions

2.1m answers

5 comments

56.5k users

...