bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#45619: 28.0.50; pcase-let on MacOS doesn't work


From: Stefan Monnier
Subject: bug#45619: 28.0.50; pcase-let on MacOS doesn't work
Date: Mon, 04 Jan 2021 12:41:26 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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

It's messier than that: the issue is that it doesn't bind variables
which aren't used lexically (this is needed to avoid spurious warnings
about unused vars when the var is used in on place but not in another).

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

We could try and make `pcase` more aware of dyn-scoped vars and have it
refrain from optimizing away "unused" dyn-scoped vars, but maybe it's
better to document it (and maybe even add a warning when a dyn-scoped
var is bound by `pcase`, like we already have for dyn-scoped vars bound
as function arguments).


        Stefan






reply via email to

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