Page 1 of 1

eval context symbol error

Posted: Fri Jan 09, 2015 12:28 pm
by ssqq
I found if *eval* a symbol, then *eval* the context symbol with this symbol prefix would throw a error.

Code: Select all

> (eval 'c)
nil
> (eval 'c:var)
ERR: context expected in function eval : c
> (context 'c)
c
> (eval 'c:var)
nil

Re: eval context symbol error

Posted: Fri Jan 09, 2015 2:10 pm
by Lutz
The already introduced symbol c did not contain a context. Do it like this:

Code: Select all

> (set 'Foo:var 123)
123
> (set 'c Foo)
Foo
> (eval 'c:var)
123
> 
see here: http://www.newlisp.org/downloads/newlis ... ntext_vars
and here: http://en.wikibooks.org/wiki/Introducti ... P/Contexts