From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Harald Hanche-Olsen Newsgroups: gmane.emacs.devel Subject: Re: Why are there two dolist? Date: Tue, 11 Aug 2009 20:27:30 -0400 (EDT) Message-ID: <20090811.202730.45673955.hanche@math.ntnu.no> References: <20090811.193025.204578572.hanche@math.ntnu.no> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1250036879 27875 80.91.229.12 (12 Aug 2009 00:27:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Aug 2009 00:27:59 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 12 02:27:52 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Mb1h2-0002EM-FC for ged-emacs-devel@m.gmane.org; Wed, 12 Aug 2009 02:27:52 +0200 Original-Received: from localhost ([127.0.0.1]:52050 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mb1gz-0000qA-R9 for ged-emacs-devel@m.gmane.org; Tue, 11 Aug 2009 20:27:49 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mb1gs-0000oV-K1 for emacs-devel@gnu.org; Tue, 11 Aug 2009 20:27:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mb1gn-0000l4-CP for emacs-devel@gnu.org; Tue, 11 Aug 2009 20:27:41 -0400 Original-Received: from [199.232.76.173] (port=47257 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mb1gn-0000l1-7E for emacs-devel@gnu.org; Tue, 11 Aug 2009 20:27:37 -0400 Original-Received: from abel.math.ntnu.no ([129.241.15.50]:51352) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1Mb1gl-0004OW-Lv for emacs-devel@gnu.org; Tue, 11 Aug 2009 20:27:36 -0400 Original-Received: (qmail 20856 invoked from network); 12 Aug 2009 00:27:32 -0000 Original-Received: from gauss.math.ntnu.no (HELO localhost) (hanche@129.241.15.102) by abel.math.ntnu.no with ESMTPA; 12 Aug 2009 00:27:32 -0000 In-Reply-To: X-URL: http://www.math.ntnu.no/~hanche/ X-Mailer: Mew version 6.2.51 on Emacs 23.0.94 / Mule 6.0 (HANACHIRUSATO) X-detected-operating-system: by monty-python.gnu.org: Solaris 8 (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:114112 Archived-At: + Lennart Borgman : > Thanks, but I do not understand all you wrote here. Could (return-from > NAME) be inside a function in dolist or does it have to be just inside > dolist so to say? Hmm. I was writing some code to demonstrate my point, but found to my surprise that the following snippet (block nil (flet ((foo (x) (if (eq x 'b) (return-from nil 'foo-done)))) (list 'from-dolist (dolist (var '(a b c) 'dolist-done) (foo var))))) which returns foo-done in a proper CL, returns (from-dolist foo-done) in elisp with the cl package loaded. This seems wrong. In CL, flet declares a lexically local function binding. Since the declaration of foo here is lexically outside the dolist, the return-from inside the body of foo should not see the implicit block named nil in the dolist, and that is what happens in CL. In elisp, however, that does not work as I expected. I'm confused. - Harald