Code: Select all
(setq main-var 1)
(define (make-function-context)
(let (temp (append (lambda) (list (first (args 1))) (rest (args 1))))
(def-new 'temp (sym (args 0) (args 0)))))
(define (function-template (arg1 arg2))
(setq myvar arg1)
(setq MAIN:main-var arg2))
(make-function-context 'foo (0 function-template))
Even if template had "MAIN:main-var".> foo:foo
(lambda ((foo:arg1 foo:arg2)) (setq foo:myvar foo:arg1) (setq foo:main-var
foo:arg2))
It looks like this has to do with translateCreateSymbol() in nl-symbol.c.
I want to be able to create a function in a new context, while allowing it to access symbols from other context.
Is there a way?