chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] how to unintern a symbol


From: cowan
Subject: Re: [Chicken-users] how to unintern a symbol
Date: Mon, 2 Feb 2015 15:07:38 -0500
User-agent: SquirrelMail/1.4.21

Peter Bex scripsit:

> I wasn't aware of that CL behaviour.  IIUC that's actually conflating
> two different things: creating an uninterned symbol and "unbinding"
> an interned symbol.  I don't know of a way to unbind a variable through
> Scheme, but you can set the symbol's value slot (0) to C_SCHEME_UNBOUND
> in C.  This has to go with the warnings "Don't try this at home", and
> "this voids your warranty". :)

Actually, neither of those things is what CL `unintern` does, though
I can see how people might come to believe that.  What it does is to
remove an existing symbol from the symbol table.  The symbol maintains
its properties, including its value, but any future attempt to refer
to a symbol of the same name will create an entirely new object,
since lookup in the symbol table will fail (and of course this new
symbol is undefined).

To put things another way, `unintern` mutates its argument from
interned to uninterned.  It's a dangerous thing to do, because it
corrupts Scheme/Lisp read-write equivalence.

-- 
John Cowan          http://www.ccil.org/~cowan        address@hidden
If I have seen farther than others, it is because I am surrounded by dwarves.
        --Murray Gell-Mann





reply via email to

[Prev in Thread] Current Thread [Next in Thread]