Looking for symbol in (symbols)

For the Compleat Fan
Locked
cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Looking for symbol in (symbols)

Post 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.

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

Post 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

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Post by cormullion »

Thanks - that's the one!

Locked