[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why shouldn't we have a #if .... #else .... #endif construct in Emac
From: |
Ihor Radchenko |
Subject: |
Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp? |
Date: |
Sat, 09 Sep 2023 10:32:37 +0000 |
Richard Stallman <rms@gnu.org> writes:
> We can make the byte compiler recognize any pattern of code
> and treat it specially. It has two sets of special
> patterns: those for inside function definitions (being compiled in
> the strict sense of the word), and those for top level.
>
> A pattern for top level could recognize patterns like
>
> (if (fboundp ...) ...) and (if (not (fboundp ...)) ...)
>
> and do whatever the proposed `static-if' function would have done.
>
> Why not?
Because there are cases when `fboundp' should be checked at runtime.
For example, some parts of Org use `fboundp' to check if certain
third-party optional dependencies are loaded. If `fboundp' is resolved
at compile time, such checks will be broken.
--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, (continued)
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Richard Stallman, 2023/09/05
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Andreas Schwab, 2023/09/06
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Alan Mackenzie, 2023/09/06
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Alan Mackenzie, 2023/09/06
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Richard Stallman, 2023/09/08
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?,
Ihor Radchenko <=
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Richard Stallman, 2023/09/09
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Ihor Radchenko, 2023/09/10
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Richard Stallman, 2023/09/13
- Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Ihor Radchenko, 2023/09/20
Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp?, Ulrich Mueller, 2023/09/05