Reference a variable
Posted: Thu Feb 02, 2017 9:59 am
Hi,
I am trying to find out if there is a way to access a variable by specifying its name as a string. For example I can do the following in lua:
testVar = 12
local s = "testVar"
print (testVar)
print (s)
print (_G[s])
The answers I get are:
12
testVar
12
Is there a way to do the above in lisp?
Many thanks.
Michael.
I am trying to find out if there is a way to access a variable by specifying its name as a string. For example I can do the following in lua:
testVar = 12
local s = "testVar"
print (testVar)
print (s)
print (_G[s])
The answers I get are:
12
testVar
12
Is there a way to do the above in lisp?
Many thanks.
Michael.