eval context symbol error

Started by ssqq, January 09, 2015, 04:28:53 AM

Previous topic - Next topic

ssqq

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

Lutz

#1
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">http://www.newlisp.org/downloads/newlis ... ntext_vars">http://www.newlisp.org/downloads/newlisp_manual.html#context_vars

and here: http://en.wikibooks.org/wiki/Introduction_to_newLISP/Contexts">http://en.wikibooks.org/wiki/Introducti ... P/Contexts">http://en.wikibooks.org/wiki/Introduction_to_newLISP/Contexts