GNU bug report logs - #49116
28.0.50; Why `bound-and-true-p' is not working in lexical binding?

Previous Next

Package: emacs;

Reported by: Jean Louis <bugs <at> gnu.support>

Date: Sat, 19 Jun 2021 11:43:02 UTC

Severity: normal

Found in version 28.0.50

Done: Phil Sainty <psainty <at> orcon.net.nz>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Phil Sainty <psainty <at> orcon.net.nz>
Cc: 49116 <at> debbugs.gnu.org, psainty <at> orcon.net.nz, bugs <at> gnu.support
Subject: bug#49116: 28.0.50; Why `bound-and-true-p' is not working in lexical binding?
Date: Sat, 19 Jun 2021 15:54:59 +0300
> Date: Sun, 20 Jun 2021 00:49:14 +1200
> From: Phil Sainty <psainty <at> orcon.net.nz>
> Cc: 49116-done <at> debbugs.gnu.org
> 
> (bound-and-true-p VAR) is syntactic sugar for (and (boundp 'VAR) VAR)
> which means that it works only for dynamic variables (i.e. variables
> stored in the value slot of a symbol).
> 
> Under lexical binding, function arguments are lexical variables, which
> means they are not stored in the symbol of that name, and hence cannot
> be detected with `boundp'.

Should this be mentioned in the doc string of bound-and-true-p?




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

Previous Next


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