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

Questions about specification and possible implementations



Here's a terse list of major questions I have about Common LISP, with
motivation included in some cases. If any questions are interesting
yet ambiguous, feel free to ask for more info. I tend to be too
verbose with my netmail, so I'm trying to be terse here.

In Common LISP there seems to be a strong dichotomy between functions
(all arguments evaluated before call) and macros&SpecialForms, almost
to the point of forbidding implementors to jump across the barrier.
Yet some functions with all the &OPTIONAL and &KEY arguments may be
difficult or inefficient to implement as true functions, and thus may
be implemented as FEXPRs in the interpretor and MACROs in the
compiler. The question is, what will (FUNCTION foo) do if foo is the
name of a MACRO or FEXPR? It's supposed to be the functional
interpretation of foo, so does it make up a function that calls the
MACRO or FEXPR even though inefficient, or does it totally break down
because there's no functional interpretation for a MACRO or FEXPR? If
(FUNCTION foo) does work, is the result suitable for passing to APPLY
or MAP and does it have the expected semantics as if were really a
function in the first place?

The book says the set of special forms is fixed and no way is provided
to make new ones. But is any way provided to define some of the
special forms from LISP level in the first place, or must all be
handcoded in assembly language or C etc.? Is any way provided to
install bugfixes in special forms by overlaying the old definition
with a new one?

At the front of the chapter on numbers it claims:
 (LET ((X Z) (Y Z))
   (EQ X Y))
may be false if the value of Z is a number. I can't see a mechanism
for this in any reasonable LISP unless Z is not only presently a
number but has been declared a number and this is compiled code which
represents the value of Z as a machine number instead of a LISP
object, whereas X and Y are undeclared and thus LISP objects, so new
objects must be constructed for X and Y to hold the value Z, and these
new objects won't be EQ to each other. But could somebody who really
knows tell me what the true explanation is?? The book leaves this a
complete mystery.

Minor questions:

In the introductory chapter, the Common-LISP book says semicolon
causes all characters up to eol to be discarded, but doesn't say
whether eol is kept or discarded.

Ditto, doesn't say which characters inside "" are automatically
letterified and which have their usual semantic effects and thus need
explicit letterification to be treated as string text.

Ditto, backslash at end of line does what? (Illegal, quote just the
next character which may be half of a crlf on some systems, quote the
eol token always?)

Ditto, vertical-bar, same questions as for "".

(If above questions are answered elsewhere in manual, need pointer
from intro to where info given?)

When COPY-SYMBOL is done, the pnames will be the same, but will they
be EQ or just EQUAL?

The book doesn't say what (/ 1 0) does. Is it an error, or does it
signal an error, or does it return the ratio of 1/0 as a way of
representing infinity, or what?

If NIL is an element of an assoc list, does this element get skipped
over by ASSOC et al or is it a stop flag?

How are the axis numbers of an array numbered, that is if you
create an array by (MAKE-ARRAY 3 5 7) then will (ARRAY-DIMENSION array 0)
return 3 or 7?
-------