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

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

bug#20144: 25.0.50; Functions using fboundp not known to be defined


From: Stefan Monnier
Subject: bug#20144: 25.0.50; Functions using fboundp not known to be defined
Date: Thu, 19 Mar 2015 15:27:45 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

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





reply via email to

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