When using a function to generate symbols for the creation of contexts the following behavior can be observed:
Code: Select all
> (define (build-sym x) (sym (string 'C x)))
(lambda (x) (sym (string 'C x)))
> (context (build-sym 2))
C2
C2> (context MAIN)
MAIN
> (context? (build-sym 2))
nil
> (context? (eval (build-sym 2)))
true
> (context (build-sym 2))
C2
C2>
Code: Select all
C2> (context MAIN)
MAIN
> (setq ctx (build-sym 2))
C2
> (symbol? ctx)
true
> (context? ctx)
nil
> (setq cty C2)
C2
> (symbol? cty)
nil
> (context? cty)
true
>ctx
C2
>(symbols)
... ? @ C2 MAIN NaN? ...
Code: Select all
> (set ctx "something else")
symbol is protected in function set : C2
> (context ctx)
C2
C2>
-