Re: what are allowed special forms? (CLHS clarification)

From: Duane Rettig (duane_at_franz.com)
Date: 01/14/05


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   


Relevant Pages

  • Re: what are allowed special forms? (CLHS clarification)
    ... >> eg. the special operators to implement continuations in Common Lisp. ... then it might expand into an IF form or a series of the ... Tail of black dog keeps good time. ...
    (comp.lang.lisp)
  • Re: 16:9 in SD?
    ... station would go to the expense to expand the field of view on a ... declining aspect ratio standard ... vertically distorted picture you describe. ... I hope it becomes more common in the future as more people get TVs that can ...
    (alt.tv.tech.hdtv)
  • Re: sinx + sin2x = 1
    ... I don't kno what to do with that... ... Expand the sin. ... common factor of sin. ... and is available in any standard text at that level, or a web search ...
    (uk.education.maths)
  • Re: Problem with variable
    ... I think that the shell MUST expand $COMMON, ... but if I define $COMMON before creating *.class, ... impossibile trovare il file o la directory ... Shell Scripting Recipes: ...
    (comp.unix.shell)
  • Re: backgroundColor
    ... which is inappropriate to expand in a public ... >> Perl-humorist into the common use. ... > I think you'll find the usage of 'foo' and 'bar' as common dummy names ...
    (comp.lang.javascript)