NEWBIE-ish: data as code
Posted: Sun Mar 17, 2013 8:47 am
It's been a few years since I last did anything with NewLISP. I ought to know the answer to this ...
Can I use data as code? Can I have the name of a function in a string variable and execute the contents of that variable as if it were the name of a function? For example:
As it stands, that'll give "e" because NewLISP will be thinking I want the 3rd character in the 'f variable. How do I get "even?" to execute against 2.5 (or am I hoping for too much)?
Kind regards,
Bugmagnet
Can I use data as code? Can I have the name of a function in a string variable and execute the contents of that variable as if it were the name of a function? For example:
Code: Select all
(set 'f "even?")
(f 2.5)
Kind regards,
Bugmagnet