(context?) and (sym)

Started by Dmi, April 15, 2006, 08:20:30 AM

Previous topic - Next topic

Dmi

> (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?
WBR, Dmi

Lutz

#1
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

Dmi

#2
The genius is simple :-)

Thanks!
WBR, Dmi