Typically I'm doing something like this:
Code: Select all
(define (myfunc) (println "this is myfunc"))
;; define a list of functions
(set 'funclist '(myfunc myfunc myfunc myfunc myfunc))
;; get and run the nth = 2 item of the list
(println "getting func")
(set 'afunc (funclist 2))
(println "calling func ")
(afunc)
Could anyone explain what I'm, doing wrong?getting func
calling func
ERR: invalid function : (afunc)
Thanks.