From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Why are there two dolist? Date: Wed, 12 Aug 2009 02:33:23 +0200 Message-ID: References: <20090811.193025.204578572.hanche@math.ntnu.no> <20090811.202730.45673955.hanche@math.ntnu.no> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1250037229 31109 80.91.229.12 (12 Aug 2009 00:33:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 12 Aug 2009 00:33:49 +0000 (UTC) Cc: emacs-devel@gnu.org To: Harald Hanche-Olsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 12 02:33:42 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 1Mb1mc-0003ys-RH for ged-emacs-devel@m.gmane.org; Wed, 12 Aug 2009 02:33:39 +0200 Original-Received: from localhost ([127.0.0.1]:35661 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mb1ma-0003jZ-Rf for ged-emacs-devel@m.gmane.org; Tue, 11 Aug 2009 20:33:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mb1mV-0003j8-AX for emacs-devel@gnu.org; Tue, 11 Aug 2009 20:33:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mb1mQ-0003iq-Qk for emacs-devel@gnu.org; Tue, 11 Aug 2009 20:33:31 -0400 Original-Received: from [199.232.76.173] (port=43338 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mb1mQ-0003in-Ld for emacs-devel@gnu.org; Tue, 11 Aug 2009 20:33:26 -0400 Original-Received: from an-out-0708.google.com ([209.85.132.242]:35301) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mb1mQ-0005Id-47 for emacs-devel@gnu.org; Tue, 11 Aug 2009 20:33:26 -0400 Original-Received: by an-out-0708.google.com with SMTP id b6so1624856ana.21 for ; Tue, 11 Aug 2009 17:33:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=tatgfiJc+IKEkPIznbFOLQtwWyRG1ZGuhOL4S87derI=; b=LtyLxJp/uRsO7uTjIn36ZN7DkihJqRIcQGWPO0R+Us5QVW0TnWlvUhyhNXasSp0X2T R7ZP0ZrdfRx8b34g5eaCxdJdLmB3o9mVzSYBk23IMsiJ7lBOIaSQ7VAznWzwJdjJT8W3 SiBdgqwP8+0szdpYfgJW3oxV2W/BlF3IMMUF0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=RW5i1cwR56+PlLu8X7GELRU2rsPrc9IkeKpCKuPIfJtrrOFUnA2ovbNj1yWarX6Dij 5Er+1whhIdfNsvVLw+l2L9CtP1rkPjF+7sOowYYSOuQiXxmwAdfeHeXqGGoSQZXa0d/l LwJnSnUufNaLs1ByuhW9owNtG+S8JL5s44SMo= Original-Received: by 10.100.242.11 with SMTP id p11mr6237340anh.113.1250037203358; Tue, 11 Aug 2009 17:33:23 -0700 (PDT) In-Reply-To: <20090811.202730.45673955.hanche@math.ntnu.no> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:114113 Archived-At: On Wed, Aug 12, 2009 at 2:27 AM, Harald Hanche-Olsen w= rote: > + 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 > =C2=A0(flet ((foo (x) (if (eq x 'b) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0(return-from nil 'foo-done)))) > =C2=A0 =C2=A0(list 'from-dolist > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(dolist (var '(a b c) 'dolist-done) > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(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. I do not understand your code above, but is not the conclusion that the cl-macs.el version does not do what it is supposed to do? What value does it have then? (Perhaps it can be fixed, I don't know.)