From: Paul Dietz
Subject: Lisp standard question (for language lawyers)
Date: 
Message-ID: <88f3ju$f46$1@schbbs.mot.com>
According to the CL standard (as embodied in the
Hyperspec), the DOLIST macro iterates over elements
of a list.

Now, 'list' is defined to include 'dotted lists',
which end in atoms other than NIL.  This would
imply that DOLIST should check for termination
using ENDP rather than NULL.

Is that correct?

The standard does say that the standard functions
that expect lists should be prepared to signal
a type-error if the argument is a dotted list
(14.1.2.3), but DOLIST is not a function, it's
a macro.

	Paul Dietz
	······@email.mot.com

From: Barry Margolin
Subject: Re: Lisp standard question (for language lawyers)
Date: 
Message-ID: <mIEq4.82$M31.4692@burlma1-snr2>
In article <············@schbbs.mot.com>,
Paul Dietz <·····@comm.mot.com> wrote:
>According to the CL standard (as embodied in the
>Hyperspec), the DOLIST macro iterates over elements
>of a list.
>
>Now, 'list' is defined to include 'dotted lists',
>which end in atoms other than NIL.  This would
>imply that DOLIST should check for termination
>using ENDP rather than NULL.
>
>Is that correct?
>
>The standard does say that the standard functions
>that expect lists should be prepared to signal
>a type-error if the argument is a dotted list
>(14.1.2.3), but DOLIST is not a function, it's
>a macro.

IMHO, this was probably overly precise wording, not intentional.  I believe
the intent was that *everything* that is described as expecting lists
should be prepared to signal if the argument is dotted.  The idea was that
we didn't want to say "proper list" throughout the specification; except
where stated otherwise, "list" means "proper list".

-- 
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Christopher Browne
Subject: Re: Lisp standard question (for language lawyers)
Date: 
Message-ID: <L%Hq4.20069$0p1.436525@news4.giganews.com>
Centuries ago, Nostradamus foresaw a time when Paul Dietz would say:
>According to the CL standard (as embodied in the
>Hyperspec), the DOLIST macro iterates over elements
>of a list.
>
>Now, 'list' is defined to include 'dotted lists',
>which end in atoms other than NIL.  This would
>imply that DOLIST should check for termination
>using ENDP rather than NULL.
>
>Is that correct?
>
>The standard does say that the standard functions
>that expect lists should be prepared to signal
>a type-error if the argument is a dotted list
>(14.1.2.3), but DOLIST is not a function, it's
>a macro.

Hmmm...

CLISP expands thusly:
> (macroexpand-1 '(dolist (x '(1 2 3 4 5)) (princ (+ x 1))))

(DO* ((#:G1090 '(1 2 3 4 5) (CDR #:G1090)) (X NIL)) ((ENDP #:G1090) NIL)
  (DECLARE (LIST #:G1090)) (SETQ X (CAR #:G1090)) (PRINC (+ X 1))
) ;

That's only one example, but consistent with your thesis...
-- 
Rules of the Evil Overlord #39. "All naive, busty tavern wenches in my
realm will be replaced with surly, world-weary waitresses who will
provide no unexpected reinforcement and/or romantic subplot for the
hero or his sidekick." 
<http://www.eviloverlord.com/lists/overlord.html>
········@hex.net- <http://www.hex.net/~cbbrowne/lisp.html>