Bug? 'delete' doesn't work on constants

Started by itistoday, October 26, 2009, 04:59:29 PM

Previous topic - Next topic

itistoday

> (constant 'foo 3)
3
> (delete 'foo)
nil
> (set 'foo 3)

ERR: symbol is protected in function set : foo


Is this a bug or is there a reason for this?
Get your Objective newLISP groove on.

Lutz

#1
Consider this:


> (constant 'foo 3)
3
> (delete 'foo)
nil
> foo
3
> (set 'bar '123)
123
> (delete 'bar)
true
> (sym "bar" MAIN nil)
nil
>


A symbol protected with 'constant' cannot be deleted, that's why the 'delete' returned 'nil' and 'foo' was still there, unblemished.



see also here: http://www.newlisp.org/downloads/newlisp_manual.html#delete">http://www.newlisp.org/downloads/newlis ... tml#delete">http://www.newlisp.org/downloads/newlisp_manual.html#delete

and: http://www.newlisp.org/downloads/newlisp_manual.html#sym">http://www.newlisp.org/downloads/newlis ... l.html#sym">http://www.newlisp.org/downloads/newlisp_manual.html#sym