eval context symbol error

Q&A's, tips, howto's
Post Reply
ssqq
Posts: 88
Joined: Sun May 04, 2014 12:49 pm

eval context symbol error

Post 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

Lutz
Posts: 5279
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: eval context symbol error

Post 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

Post Reply