I don't understand contexts... :-)
Posted: Sat Jan 14, 2006 2:59 pm
How do I get this function to return the value of a symbol in another context? I'm' trying to construct the reference:
Code: Select all
(context 'MyContext)
(set 's "hi there")
(context MAIN)
(define (func ctx w)
(println "inside function, context is " ctx " and symbol value is " w)
(println "inside function " ctx:w))
(println "MAIN:s is " s)
;- MAIN:s is nil
(println "MyContext:s is " MyContext:s)
;- MyContext:s is hi there
(println (func MyContext s))
; inside function, context is MyContext and symbol value is nil ?
; inside function nil ?