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


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Michael Heerdegen <michael_heerdegen <at> web.de>
Cc: jixiuf <jixiuf <at> qq.com>, 45619 <at> debbugs.gnu.org
Subject: bug#45619: 28.0.50; pcase-let on MacOS doesn't work
Date: Mon, 04 Jan 2021 15:37:59 -0500
> (pcase-let ((default-directory "/tmp/"))
>   (call-interactively 'find-file))
>
> I wonder what is messier: the warnings or the semantics resulting from
> avoiding the warnings.  I guess people would more often complain about
> the warnings...

I think the cleaner semantics is to say that if variables bound by pcase
are dynamically scoped the behavior is "undefined", and to add
a check&warning about it in pcase (the problem with the old "unused
var" warning is that it was cumbersome to avoid it, whereas this new
warning would be easy to avoid by moving the binding to a separate
`let`).


        Stefan





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.