Matthieu Moy <[EMAIL PROTECTED]> writes:
> Mark Triggs <[EMAIL PROTECTED]> writes:
>
>> When I started looking at incorporating Miles's
>> `lambda-with-constant-bindings', I realised there were a number of
>> places in the code where we've done things like:
>>
>> `(lambda (...)
>> ...
>> (switch-to-buffer ,(current-buffer)))
>
> I don't have time to examine your code precisely right now, but this
> could be rewritten
>
> (let ((current-buf (current-buffer)))
> `(lambda ()
> (switch-to-buffer ,current-buf)))
>
> So, Miles' proposal would apply unchanged with a little bit more work
> for the "user".
Yep, this transformation is exactly what the macro is doing. For
example:
(capturing-lambda ()
(switch-to-buffer (capture (current-buffer))))
macroexpands to:
(lambda ()
(let ((G466533 (quote #<buffer *scratch*>)))
(funcall (lambda nil (switch-to-buffer G466533)))))
I'm not sure I see much benefit to making the user do this themselves,
unless you feel it would be more readable that way. I don't really
savour the thought of trying to think of a good variable name for every
value used in a lambda, but I'm not completely opposed to the idea.
>> Is this something that would count as a bugfix against 0.9, or
>> should I introduce this in a development branch?
>
> No strong opinion on this. That's more or less a bugfix, but the risk
> to introduce other bugs seems rather high to me.
>
> Perhaps we could put this in a 1.1 branch, and plan a 1.2 with "minor
> enhancement that were delayed after the 1.0" soon after the 1.0 ?
>
> Otherwise, release a 0.9.1 with this change and wait long enough to be
> sure we didn't introduce new bugs to release 1.0.
Yeah, either of these sounds good. We would be adjusting a fairly large
amount of code, so it's probably better to be safe.
Cheers,
Mark
--
Mark Triggs
<[EMAIL PROTECTED]>