newLISP Fan Club

Forum => Anything else we might add? => Topic started by: Dmi on April 15, 2006, 08:20:30 AM

Title: (context?) and (sym)
Post by: Dmi on April 15, 2006, 08:20:30 AM
> (sym "CON" MAIN nil)
CON
> (context? CON)
true
> (context? (sym "CON" MAIN nil))
nil

The conttext CON is already exists before this tests,



Is there a way to check the existence of a context given by a string?
Title:
Post by: Lutz on April 15, 2006, 08:30:38 AM
Yes, just add 'eval' ;)



> (sym "CON" MAIN nil)
nil
> (set 'CON:foo 123)
123
> (sym "CON" MAIN nil)
CON
> (context? (eval (sym "CON" MAIN nil)))
true


Lutz
Title:
Post by: Dmi on April 15, 2006, 08:38:55 AM
The genius is simple :-)

Thanks!