eval context symbol error

Q&A's, tips, howto's

eval context symbol error

Postby ssqq » Fri Jan 09, 2015 12:28 pm

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
ssqq
 
Posts: 88
Joined: Sun May 04, 2014 12:49 pm

Re: eval context symbol error

Postby Lutz » Fri Jan 09, 2015 2:10 pm

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
Lutz
 
Posts: 5276
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 1 guest

cron