bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#7408: 23.2.1 dolist -- subr.el and cl-macs differ with nil-block ret


From: Stefan Monnier
Subject: bug#7408: 23.2.1 dolist -- subr.el and cl-macs differ with nil-block return
Date: Mon, 15 Nov 2010 14:38:52 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

>>> The current definition of dolist in subr.el breaks lot of things that rely
>>> on the standard 'dolist' behavior:
>> 
>>>     $ emacs -Q --debug-init --batch --eval "(dolist (elt '(1 2)) (return 
>>> elt))"
>>>     Symbol's function definition is void: return
>> 
>> By standard, you mean "CL", right?  If you want CL behavior, then do
>> (require 'cl), and it will then work.


> So this is one of the reasons you should do

>    (eval-when-compile (require 'cl))

> Or? ;-)

Don't know about "should", but it can be one of the cases where you
might want to do that, yes.  Of course, you can also change your code to
use catch&throw instead (which is what's used by `return' under the
hood, AFAIK).


        Stefan





reply via email to

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