From: Andrew Philpot
Subject: MAKUNBOUND on keywords
Date: 
Message-ID: <slrndn9igc.v85.philpot@ubirr.isi.edu>
Keywords evaluate to themselves.

So what should happen if you try to make one unbound, a la 

  (makunbound ':x) ?

In CLISP [2.27 (released 2001-07-17)], it signals an error: "the value
of the constant :X must not be removed."

In ACL 6.2, it removes the self-binding.  Subsequent attempts to
access the value now signal an UNBOUND-VARIABLE error.

I realize this is probably an area of undefined behavior.  Just
wondered which behavior fits people's intuitions better, i.e., CLISP
treating keywords like constants and ACL like variables.

Andrew

From: Bill Atkins
Subject: Re: MAKUNBOUND on keywords
Date: 
Message-ID: <1131737329.585194.165670@o13g2000cwo.googlegroups.com>
MAKUNBOUND doesn't really make sense for keywords, since keywords
aren't generally bound to anything - except, of course, that their
value slot is the same as their symbol-name

CL-USER> (inspect :foo)

The object is a SYMBOL.
0. Name: "FOO"
1. Package: #<PACKAGE "KEYWORD">
2. Value: :FOO
3. Function: "unbound"
4. Plist: NIL
> 

Maybe UNINTERN is what you're looking for.
From: Kaz Kylheku
Subject: Re: MAKUNBOUND on keywords
Date: 
Message-ID: <1131739901.354877.29200@f14g2000cwb.googlegroups.com>
Andrew Philpot wrote:
> Keywords evaluate to themselves.
>
> So what should happen if you try to make one unbound, a la
>
>   (makunbound ':x) ?
>
> In CLISP [2.27 (released 2001-07-17)], it signals an error: "the value
> of the constant :X must not be removed."

I don't think that NIL, T and the keywords can be regarded as having a
binding. It's just special case evaluation behavior.

I think of a binding as a potential or actual association that could be
different at different times and in different contexts.

> In ACL 6.2, it removes the self-binding.  Subsequent attempts to
> access the value now signal an UNBOUND-VARIABLE error.

That just means that the special evaluation behavior for keywords was
implemented using the usual binding mechanism on ACL.

But it could just as well be done as some special case in the evaluator
of compiler: if an expression satisfies KEYWORDP, it's treated
differently.

> I realize this is probably an area of undefined behavior.  Just
> wondered which behavior fits people's intuitions better, i.e., CLISP
> treating keywords like constants and ACL like variables.

My intution is that when they are presented as expressions, they are
effectively a special lexical  category with its own evaluation rules.
Just like, for instance, the keywords true and false in C++, which are
not constants, but instances of the boolan_literal lexical cateogory.

I think that's a good mental model for keywords: that they are neither
constants, nor variables, but literals.
From: Kalle Olavi Niemitalo
Subject: Re: MAKUNBOUND on keywords
Date: 
Message-ID: <877jbe6pgr.fsf@Astalo.kon.iki.fi>
"Kaz Kylheku" <········@gmail.com> writes:

> I don't think that NIL, T and the keywords can be regarded as having a
> binding. It's just special case evaluation behavior.

According to the specification of the KEYWORD type, keywords are
special variables bound to themselves.  Also, SYMBOL-VALUE must
return the keyword.