syntax for apply
Posted: Thu Oct 30, 2014 5:26 am
This code (shown below) from the "Namespace context switching" section of "Expression Evaluation in newLISP" does not seem to follow the syntax given in the manual: (apply func list [int-reduce]).
prints:
current context: Foo
var: 123
Is there an unlisted second syntax for apply? If not, can someone help me to understand how the above example fits (apply func list [int-reduce]) (e.g. is the second parameter also optional)?
Thanks!
Code: Select all
(context 'Foo)
(set 'var 123)
(define (func)
(println "current context: " (context))
(println "var: " var))
(context 'MAIN)
...
(apply 'Foo:func)
current context: Foo
var: 123
Is there an unlisted second syntax for apply? If not, can someone help me to understand how the above example fits (apply func list [int-reduce]) (e.g. is the second parameter also optional)?
Thanks!