emacs-devel
[Top][All Lists]
Advanced

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

Re: Building Emacs overflowed pure space


From: Stefan Monnier
Subject: Re: Building Emacs overflowed pure space
Date: Thu, 20 Jul 2006 11:26:18 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>>> So it is safe to take the cdr at the end.
>> 
>> Maybe it is, but it will subtly change the semantics in case the loop body
>> modifies the list it's loooping over.

> But that subtle difference already exists between the cl and subr versions.
> IMO, we better make them consistent.

> As you point out, it is not safe to move the `cdr' if BODY modifies
> the list.  But we could just document this fact in the docstring, e.g.:

> dolist is a Lisp macro in `subr.el'.
> (dolist (var list [result]) body...)

> Loop over a list.
> Evaluate BODY with VAR bound to each car from LIST, in turn.
> Then evaluate RESULT to get return value, default nil.
> The result is undefined if BODY modifies the list.

Sure.  But I currently see no reason to prefer the cl-macs.el behavior over
the subr.el one (AFAICT my suggested code is just as efficient as the
cl-macs.el one), so I'm not sure whether we should change cl-macs.el or
subr.el's behavior.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]