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

nconc semantics



CLtL doesn't require that NCONC or APPEND check the types of its arguments.
The Symbolics implementation (see the function SYS:*NCONC) assumes that any
argument that isn't a cons (except the last, of course, which is allowed to
be anything) is NIL, so (NCONC T <anything>) == (NCONC NIL <anything>) =>
<anything>.  Checking whether the argument is a cons or not is required by
the semantics, but checking whether a non-cons is NIL would require
overhead that some might find unacceptable.  In general, Symbolics Lispms
only do type checking in hardware or microcode instructions, so that it can
be done in parallel with the computation.  Since NCONC isn't implemented in
hardware it doesn't check.

If the Symbolics compiler implemented optimization levels this would be an
appropriate place to use them.  With high safety NCONC and APPEND could
call a slower version that checked its arguments.