Page 1 of 1

Looking for symbol in (symbols)

Posted: Thu Mar 30, 2006 7:52 am
by cormullion
How do I find out whether a symbol is an existing (built-in) newLISP symbol:

Code: Select all

(find rubbish (symbols))
;-> 204
It looks like the symbol is created first, then found.

Posted: Thu Mar 30, 2006 1:24 pm
by Lutz
'sym' with optionl 'nil' parameter suppresses creation and only checks existence:

Code: Select all

> (sym "rubbish" MAIN nil)
nil
> (sym "println" MAIN nil)
println
> 
see also http://newlisp.org/downloads/newlisp_manual.html#sym

Lutz

Posted: Thu Mar 30, 2006 1:43 pm
by cormullion
Thanks - that's the one!