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


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

From: Michael Heerdegen <michael_heerdegen <at> web.de>
To: Jean Louis <bugs <at> gnu.support>
Cc: 49116 <at> debbugs.gnu.org
Subject: Re: bug#49116: 28.0.50; Why `bound-and-true-p' is not working in
 lexical binding?
Date: Wed, 23 Jun 2021 01:00:11 +0200
Jean Louis <bugs <at> gnu.support> writes:

> (defun verify-direction (timestamp &optional direction)
>   (cond ((bound-and-true-p direction) (message "OK"))))
>
> (verify-direction "10:00" t) ⇒ nil

BTW, if your original intention was to check whether a function argument
has been specified in a function call (including nil) -- optional
arguments in `cl-defun' support such a feature.

Michael.




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

Previous Next


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