GNU bug report logs - #45619
No warning when pcase-let is binding dynamic variable

Previous Next

Package: emacs;

Reported by: jixiuf <jixiuf <at> qq.com>

Date: Sun, 3 Jan 2021 09:05:01 UTC

Severity: normal

Found in version 28.0.50

Full log


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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: jixiuf <jixiuf <at> qq.com>
Cc: 45619 <at> debbugs.gnu.org, Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: Re: bug#45619: 28.0.50; pcase-let on MacOS doesn't work
Date: Mon, 04 Jan 2021 13:44:33 +0100
jixiuf <jixiuf <at> qq.com> writes:

> (pcase-let ((`(,default-directory) '( "/tmp/")))
>     (call-interactively 'find-file))
>
> Expected behavior: Find file in "/tmp/"
> Observed behavior: Find file in "~"

AFAICT the issue here is that `pcase-let' always creates lexically
scoped bindings, even for special variables.  That can be surprising.

@Stefan, what can we do?  Document better?  Add compiler warnings?  Or
is it possible to "fix" this?

Regards,

Michael.




This bug report was last modified 3 years and 112 days ago.

Previous Next


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