From: Lennart Borgman <lennart.borgman@gmail.com>
To: Harald Hanche-Olsen <hanche@math.ntnu.no>
Cc: emacs-devel@gnu.org
Subject: Re: Why are there two dolist?
Date: Wed, 12 Aug 2009 02:33:23 +0200 [thread overview]
Message-ID: <e01d8a50908111733t2cdb1ecajd73bd5eed828d8ee@mail.gmail.com> (raw)
In-Reply-To: <20090811.202730.45673955.hanche@math.ntnu.no>
On Wed, Aug 12, 2009 at 2:27 AM, Harald Hanche-Olsen<hanche@math.ntnu.no> wrote:
> + Lennart Borgman <lennart.borgman@gmail.com>:
>
>> 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.
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.)
next prev parent reply other threads:[~2009-08-12 0:33 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-11 22:14 Why are there two dolist? Lennart Borgman
2009-08-11 22:36 ` Lennart Borgman
2009-08-12 8:45 ` David Kastrup
2009-08-12 8:52 ` Lennart Borgman
2009-08-11 22:37 ` Miles Bader
2009-08-11 22:42 ` Lennart Borgman
2009-08-11 22:51 ` Miles Bader
2009-08-11 23:04 ` Lennart Borgman
2009-08-11 23:30 ` Harald Hanche-Olsen
2009-08-11 23:34 ` Miles Bader
2009-08-11 23:41 ` Lennart Borgman
2009-08-11 23:48 ` Miles Bader
2009-08-11 23:39 ` Lennart Borgman
2009-08-12 0:27 ` Harald Hanche-Olsen
2009-08-12 0:33 ` Lennart Borgman [this message]
2009-08-12 0:54 ` Miles Bader
2009-08-12 0:59 ` Lennart Borgman
2009-08-12 1:24 ` Harald Hanche-Olsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e01d8a50908111733t2cdb1ecajd73bd5eed828d8ee@mail.gmail.com \
--to=lennart.borgman@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=hanche@math.ntnu.no \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.