From: JP Massar
Subject: SYMBOL-MACROLET and special variables
Date: 
Message-ID: <3e55b61f.106953641@netnews.attbi.com>
Corman Lisp 2.0:

(setq x '(a b))
(A B)
(symbol-macrolet ((foo (car x))) (setq foo 'c))
C
x
(C B)

-------------

Allegro 6.2 & Lispworks:

CG-USER(1): (setq x '(a b))
(A B)
CG-USER(2): (symbol-macrolet ((nil (car x))) (setq nil 'c))
Error: SYMBOL-MACROLET symbol NIL is globally declared SPECIAL

-----------------


The Hyperspec says only that the object in the name position
for a symbol-macro must be a SYMBOL.

It further says that it is not legal for there to be a SPECIAL
declaration for said name present in the declarations.

But it most certainly does NOT say that it is illegal or an error
for the symbol itself to have otherwise been declared or proclaimed
special or defined as a constant.

I assume this is an oversight of the Hyperspec, unless perhaps it
is covered in some other section?

From: Hannu Koivisto
Subject: Re: SYMBOL-MACROLET and special variables
Date: 
Message-ID: <87ptpl6bl6.fsf@lynx.ionific.com>
······@alum.mit.edu (JP Massar) writes:

> Corman Lisp 2.0:
...
> (symbol-macrolet ((foo (car x))) (setq foo 'c))

I fail to see what is the point of this Corman Lisp example.

> Allegro 6.2 & Lispworks:
...
> CG-USER(2): (symbol-macrolet ((nil (car x))) (setq nil 'c))
> Error: SYMBOL-MACROLET symbol NIL is globally declared SPECIAL
...
> But it most certainly does NOT say that it is illegal or an error
> for the symbol itself to have otherwise been declared or proclaimed
> special or defined as a constant.

It most certainly says exactly that (see Exceptional Situations in
the documentation of symbol-macrolet): "If an attempt is made to
bind a symbol that is defined as a global variable, an error of
type program-error is signaled."

Further, since you decided to choose NIL as your example symbol,
your use is also prohibited in 11.1.2.1.2 / 11.1.2.1.2.1.

-- 
Hannu
From: JP Massar
Subject: Re: SYMBOL-MACROLET and special variables
Date: 
Message-ID: <3e5662f7.151208014@netnews.attbi.com>
On Fri, 21 Feb 2003 14:51:33 +0200, Hannu Koivisto <·····@iki.fi>
wrote:

>······@alum.mit.edu (JP Massar) writes:
>
>> Corman Lisp 2.0:
>...
>> (symbol-macrolet ((foo (car x))) (setq foo 'c))
>
>I fail to see what is the point of this Corman Lisp example.
>

Well, the intent was to show different implementations do different
things.  

But that was not successful, because as you point out below
Corman should indeed signal an error.


>> Allegro 6.2 & Lispworks:
>...
>> CG-USER(2): (symbol-macrolet ((nil (car x))) (setq nil 'c))
>> Error: SYMBOL-MACROLET symbol NIL is globally declared SPECIAL
>...
>> But it most certainly does NOT say that it is illegal or an error
>> for the symbol itself to have otherwise been declared or proclaimed
>> special or defined as a constant.
>
>It most certainly says exactly that (see Exceptional Situations in
>the documentation of symbol-macrolet): "If an attempt is made to
>bind a symbol that is defined as a global variable, an error of
>type program-error is signaled."
>

You are absolutely correct.  Just completely missed that.  Thanks.

But what puzzles me now is that given that this clause is in the HS,
why is there a cleanup issue

http://www.lispworks.com/reference/HyperSpec/Issues/iss341_w.htm

that discusses this very topic?

Or at least why isn't there a mention in the discussion that it was
resolved in favor of signalling an error?

>Further, since you decided to choose NIL as your example symbol,
>your use is also prohibited in 11.1.2.1.2 / 11.1.2.1.2.1.
>
 
That's certainly correct.
From: Barry Margolin
Subject: Re: SYMBOL-MACROLET and special variables
Date: 
Message-ID: <cou5a.16$rO3.296@paloalto-snr1.gtei.net>
In article <··················@netnews.attbi.com>,
JP Massar <······@alum.mit.edu> wrote:
>But what puzzles me now is that given that this clause is in the HS,
>why is there a cleanup issue
>
>http://www.lispworks.com/reference/HyperSpec/Issues/iss341_w.htm
>
>that discusses this very topic?

That cleanup issue is how the clause got into the standard in the first
place.

>Or at least why isn't there a mention in the discussion that it was
>resolved in favor of signalling an error?

That should be obvious from what's in the standard.

I think you're confused about the relationship between cleanup issues and
the standard.  They aren't fixing problems in the standard, they were
fixing problems in CLTL in order to *produce* the standard.

-- 
Barry Margolin, ··············@level3.com
Genuity Managed Services, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: JP Massar
Subject: Re: SYMBOL-MACROLET and special variables
Date: 
Message-ID: <3e5bb3b2.54626431@netnews.attbi.com>
On Fri, 21 Feb 2003 18:40:08 GMT, Barry Margolin
<··············@level3.com> wrote:

>In article <··················@netnews.attbi.com>,
>JP Massar <······@alum.mit.edu> wrote:
>>But what puzzles me now is that given that this clause is in the HS,
>>why is there a cleanup issue
>>
>>http://www.lispworks.com/reference/HyperSpec/Issues/iss341_w.htm
>>
>>that discusses this very topic?
>
>That cleanup issue is how the clause got into the standard in the first
>place.
>
>>Or at least why isn't there a mention in the discussion that it was
>>resolved in favor of signalling an error?
>
>That should be obvious from what's in the standard.
>
>I think you're confused about the relationship between cleanup issues and
>the standard.  They aren't fixing problems in the standard, they were
>fixing problems in CLTL in order to *produce* the standard.
>
 
You are right.  I was confused.  This is good to know.
Thanks.

Is there any reference document for continuing problems and
ambiguities with the standard?