Re: what are allowed special forms? (CLHS clarification)
From: Duane Rettig (duane_at_franz.com)
Date: 01/14/05
- Next message: Don Geddis: "Re: Requirement to define macros before use in interpreted code?"
- Previous message: Steven E. Harris: "Re: CL idioms"
- In reply to: Pascal Bourguignon: "Re: what are allowed special forms? (CLHS clarification)"
- Next in thread: Pascal Bourguignon: "Re: what are allowed special forms? (CLHS clarification)"
- Reply: Pascal Bourguignon: "Re: what are allowed special forms? (CLHS clarification)"
- Reply: Joerg Hoehle: "Re: what are allowed special forms? (CLHS clarification)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 14 Jan 2005 09:50:51 -0800
Pascal Bourguignon <spam@mouse-potato.com> writes:
> Duane Rettig <duane@franz.com> writes:
>
> > I believe that in order to ensure that code-walkers can be written
> > portably, the implementor _must_ provide a macro that allows the
> > walker to expand that form and get past it.
>
> I agree that it would be desirable. But what if the implementation
> specific special operator implements a feature that is not
> implementable (in less than a virtual machine) with COMMON-LISP
> special operators?
>
> eg. the special operators to implement continuations in Common Lisp.
>
> Really, it's hard to ask the implementors to provide a whole virtual
> machine implemented in Common-Lisp to explain to the code walkers the
> semantics of their special operators.
I've seen this kind of thing said before on this thread, but I don't
understand why it has been said: why do you limit what a macro can
expand to to be in terms of special-operators? What is wrong with
a macroexpansion for an implementation-specific special-operator
expanding to just a function call? Or perhaps a combination of
function calls and standard special-operators? The function
syntax is far more common in Common Lisp than special operators
are; it is the default for parsing a form if the symbol in the car
of the form has no other definition.
Remember, the whole name of this walking game is understanding the
syntax of the special form; if some element is to be evaluated out
of the normal left-to-right order, it can be easily expanded by a
macro that switches the order. If an element is to be conditionally
evaluated, then it might expand into an IF form or a series of the
same. I've never been interested in analyzing this, but if memory
serves correctly, some have said that call/cc can be implemented in
terms of unwind-protect (and/or catch/throw? whatever...).
And so on...
-- Duane Rettig duane@franz.com Franz Inc. http://www.franz.com/ 555 12th St., Suite 1450 http://www.555citycenter.com/ Oakland, Ca. 94607 Phone: (510) 452-2000; Fax: (510) 452-0182
- Next message: Don Geddis: "Re: Requirement to define macros before use in interpreted code?"
- Previous message: Steven E. Harris: "Re: CL idioms"
- In reply to: Pascal Bourguignon: "Re: what are allowed special forms? (CLHS clarification)"
- Next in thread: Pascal Bourguignon: "Re: what are allowed special forms? (CLHS clarification)"
- Reply: Pascal Bourguignon: "Re: what are allowed special forms? (CLHS clarification)"
- Reply: Joerg Hoehle: "Re: what are allowed special forms? (CLHS clarification)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|