newLISP Fan Club

Forum => newLISP in the real world => Topic started by: ssqq on January 09, 2015, 04:28:53 AM

Title: eval context symbol error
Post by: ssqq on January 09, 2015, 04:28:53 AM
I found if *eval* a symbol, then *eval* the context symbol with this symbol prefix would throw a error.



> (eval 'c)
nil
> (eval 'c:var)
ERR: context expected in function eval : c
> (context 'c)
c
> (eval 'c:var)
nil
Title: Re: eval context symbol error
Post by: Lutz on January 09, 2015, 06:10:14 AM
The already introduced symbol c did not contain a context. Do it like this:



> (set 'Foo:var 123)
123
> (set 'c Foo)
Foo
> (eval 'c:var)
123
>


see here: http://www.newlisp.org/downloads/newlisp_manual.html#context_vars

and here: http://en.wikibooks.org/wiki/Introduction_to_newLISP/Contexts