[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

portable code walkers vs. portable code

    Date: Thu 10 Jul 86 16:43:43-MDT

    My contention is that it should be possible to write a portable program to 
    "walk" *any* valid Common Lisp program.  After all, this was the rationale
    for prohibiting implementations from defining their own additional special
    forms, right?  If you allow implementations to extend the syntax of
    lambda lists, you might as well let implementations extend the syntax by
    introducing more special forms, and let users define their own special
    forms too.  And once we do that, we might as well forget about having a 
    standard Lisp dialect in the first place.

The issue hinges on what the phrase "valid Common Lisp program" means.
The intention of the manual is that any implementation may put in
various extensions, but a valid Common Lisp program does not use any
such extensions.

Regarding code walkers, there was an attempt made to allow code walkers
to work not only on valid Common Lisp programs, but even on programs
that go outside the bounds of Common Lisp.  This attempt is the reason
for the magic list of special forms, and that idea that any new special
form should have a translator, etc.  As has been discussed in this
mailing list previous, it's not at all clear that this attempt works, or
can possibly work.  You are correct in pointing out that the attempt
certainly cannot work if implementations have extra lambda-list
keywords.  However, I think that we had already established that the
attempt could not work, anyway, for other reasons.

Your final contention is not true.  If we let implementations put in
their own special forms, that does not in any way prevent us from having
a common subset that is shared among all these implementations.  That is
what Common Lisp is, and that's why it's called Common Lisp.  It does
mean that you can't write a portable code-walker capable of
understanding any program in any extended dialect that contains Common
Lisp as a subset, which doesn't seem very surprising.  You can still
write a code walker that's fully portable and can be guaranteed to work
on any valid Common Lisp program, which means any program written
completely within the common subset.