Again I am struggling with contexts. It seems not to be possible to change variables in other contexts while being in a newly, just created context...?
Sample program:
Code: Select all
(context 'START)
# Create context "HELLO" and initialize list "mylist"
(define (init)
(new MAIN:START (sym "HELLO") true)
(push "HELLO" mylist))
# Add a value to the list in context "START"
(define (test)
(push "yes" START:mylist)
(println "2: " START:mylist))
#-----------------------------
(context 'MAIN)
# Setup problem
(START:init)
(println "1: " START:mylist)
# Add value to "mylist" from created context
(HELLO:test) # <----- (START:test) works
# Nothing happened?
(println "3: " START:mylist)
(exit)
What am I doing wrong here?
If I replace the line (HELLO:test) with (START:test) I receive the correct result.