GNU bug report logs - #26073
How should cl-symbol-macrolet interact with rebindings?

Previous Next

Package: emacs;

Reported by: Paul Pogonyshev <pogonyshev <at> gmail.com>

Date: Sun, 12 Mar 2017 13:26:01 UTC

Severity: normal

Tags: fixed

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 26073 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Paul Pogonyshev <pogonyshev <at> gmail.com>
Cc: 26073 <at> debbugs.gnu.org
Subject: Re: bug#26073: workaround
Date: Mon, 20 Mar 2017 09:25:01 -0400
>> I'm wondering why generator.el uses cl-symbol-macrolet like that
> Because that's how it works. It needs to store variables in an outer
> scope so that their values are preserved between calls to `iter-next'
> on the same iterator. Therefore it "rebinds" local variables to
> different symbol and declares those symbols in outer scope, so that
> they become non-local variables captured by resulting closures.

Could you give me some concrete (but simple) example?

> bug in in `cl-symbol-macrolet' that incorrectly applies `bindings' to
> forms with lambdas.

Yes, I understand this part of the problem (and fixing it should
actually be easier than for `let` since in lexical-binding mode, all
lambda args are lexically scoped, regardless of special-variable-p).
[ Note: I haven't looked at your suggested patch, but I agree with your
  problem&solution description so your patch is probably right.  ]


        Stefan




This bug report was last modified 7 years and 100 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.