I was browsing through the TeX source of the standard and came across
this comment in concept-bvl.tex:
%Per X3J13 (05-Oct-93), prohibit destructuring of whole variable. -kmp
So, I checked various Lisps, and none of them actually prohibit
destructuring of the &whole variable except Allegro CL. On the other
hand, after looking for any kind of further statement on the matter, I
didn't see anything in the standard that /actually/ prohibits
destructuring of the &whole variable, and in fact it looks to me like
3.4.4.1.2 explicitly allows it:
The detailed behavior of each lambda list keyword in a
lambda-list-directed destructuring pattern is as follows:
...
&whole
The next element is a destructuring pattern that matches the
entire form in a macro, or the entire subexpression at inner
levels.
What do you think? Is the comment an outdated artifact, and Allegro CL
in error? Am I interpreting the spec wrong?
Zach
Zach Beane wrote:
> I was browsing through the TeX source of the standard and came across
> this comment in concept-bvl.tex:
>
> %Per X3J13 (05-Oct-93), prohibit destructuring of whole variable. -kmp
>
> So, I checked various Lisps, and none of them actually prohibit
> destructuring of the &whole variable except Allegro CL. On the other
> hand, after looking for any kind of further statement on the matter, I
> didn't see anything in the standard that /actually/ prohibits
> destructuring of the &whole variable, and in fact it looks to me like
> 3.4.4.1.2 explicitly allows it:
>
> The detailed behavior of each lambda list keyword in a
> lambda-list-directed destructuring pattern is as follows:
> ...
>
> &whole
>
> The next element is a destructuring pattern that matches the
> entire form in a macro, or the entire subexpression at inner
> levels.
>
> What do you think? Is the comment an outdated artifact, and Allegro CL
> in error? Am I interpreting the spec wrong?
Comments in the TeX source of the ANSI standard are most certainly not
binding. So I'd say that Allegro CL is in error.
However, you can easily work around this using destructuring-bind.
Pascal
--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/