[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why are there two dolist?
From: |
Harald Hanche-Olsen |
Subject: |
Re: Why are there two dolist? |
Date: |
Tue, 11 Aug 2009 20:27:30 -0400 (EDT) |
+ Lennart Borgman <address@hidden>:
> 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
- Re: Why are there two dolist?, (continued)
- Re: Why are there two dolist?, Miles Bader, 2009/08/11
- Re: Why are there two dolist?, Lennart Borgman, 2009/08/11
- Re: Why are there two dolist?, Miles Bader, 2009/08/11
- Re: Why are there two dolist?, Lennart Borgman, 2009/08/11
- Re: Why are there two dolist?, Harald Hanche-Olsen, 2009/08/11
- Re: Why are there two dolist?, Miles Bader, 2009/08/11
- Re: Why are there two dolist?, Lennart Borgman, 2009/08/11
- Re: Why are there two dolist?, Miles Bader, 2009/08/11
- Re: Why are there two dolist?, Lennart Borgman, 2009/08/11
- Re: Why are there two dolist?,
Harald Hanche-Olsen <=
- Re: Why are there two dolist?, Lennart Borgman, 2009/08/11
- Re: Why are there two dolist?, Miles Bader, 2009/08/11
- Re: Why are there two dolist?, Lennart Borgman, 2009/08/11
- Re: Why are there two dolist?, Harald Hanche-Olsen, 2009/08/11