emacs-devel
[Top][All Lists]
Advanced

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

Re: Why are there two dolist?


From: Lennart Borgman
Subject: Re: Why are there two dolist?
Date: Wed, 12 Aug 2009 01:39:57 +0200

On Wed, Aug 12, 2009 at 1:30 AM, Harald Hanche-Olsen<address@hidden> wrote:

>> Maybe the CL version should go away instead? It creates a lexically
>> scoped block with a name nil. The explanation in (defmacro block ...)
>> does however not say what is lexically scoped so I have no clue.
>
> AFAICT, the only thing lexically scoped is the name of the block.
> In other words, (return-from NAME) will return from the innermost
> block named NAME that lexically contains the return-from form. I think
> this is pretty well explained in the block docstring?


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?


>> (And I do not know if return-from mentioned there can work with a
>> nil name.)
>
> (return-from nil) is perfectly good CL, so it ought to work.


Thanks.


>> However if if means that one dolist version makes VAR lexically scoped
>> and the other does not, then the difference is big.
>
> But it doesn't mean that, as a simple experiment bears out. I think
> the only difference between the two is the block, and that will not
> affect any elisp code that is unaware of block and return-from.


If I understand you correctly the only difference is if (return-from
nil) goes to dolist or maybe outside of that?

But that is of course a big difference too.


> - Harald
>
>
>




reply via email to

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