GNU bug report logs - #20144
25.0.50; Functions using fboundp not known to be defined

Previous Next

Package: emacs;

Reported by: Philipp Stephani <p.stephani2 <at> gmail.com>

Date: Thu, 19 Mar 2015 15:56:01 UTC

Severity: wishlist

Merged with 8140

Found in versions 24.0.50, 25.0.50

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Philipp Stephani <p.stephani2 <at> gmail.com>
Cc: 20144 <at> debbugs.gnu.org
Subject: bug#20144: 25.0.50; Functions using fboundp not known to be defined
Date: Thu, 19 Mar 2015 15:27:45 -0400
severity 20144 wishlist
thanks

> (if (fboundp 'car)
>     (defalias 'mycar 'car)
>   (defun mycar (_l) (error "what")))

   (defalias 'mycar
             (if (fboundp 'car) 'car (lambda (_l) (error "what"))))

The difference is one of the two versions requires reasoning
(simple/trivial for you, but beyond the reach of the simple
byte-compiler we're using), whereas the other doesn't.

Admittedly, when you need to define two versions of a *set* of
functions, depending on a single test, the above trick of sinking the
testing into the `defalias' ends up being a bit ugly/inconvenient.


        Stefan




This bug report was last modified 10 years and 88 days ago.

Previous Next


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