[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
zerop: compiler macro vs defsubst (was: no empty (zero) string predicate
From: |
Nicolas Richard |
Subject: |
zerop: compiler macro vs defsubst (was: no empty (zero) string predicate in Elisp) |
Date: |
Mon, 27 Apr 2015 12:28:14 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> C-h f zerop RET says:
>
> zerop is a compiled Lisp function in `subr.el'.
> [...]
> This function has a compiler macro `zerop--anon-cmacro'.
>
> and if you look at this mysterious zerop--anon-cmacro, you'll see that
> it optimizes `zerop' by rewriting it to (= 0 ...), which is implemented
> more efficiently.
IIUC the efficiency is obtained by inlining the definition thus avoiding
a function call. What's the difference between using that compiler macro
and using defsubst ?
--
Nicolas
- no empty (zero) string predicate in Elisp, Emanuel Berg, 2015/04/24
- Re: no empty (zero) string predicate in Elisp, Stefan Monnier, 2015/04/25
- Message not available
- Message not available
- Re: no empty (zero) string predicate in Elisp, Pascal J. Bourguignon, 2015/04/26
- Re: no empty (zero) string predicate in Elisp, Stefan Monnier, 2015/04/26
- Message not available
- Re: no empty (zero) string predicate in Elisp, Rusi, 2015/04/26
Message not available
- Re: no empty (zero) string predicate in Elisp, Emanuel Berg, 2015/04/26
- Re: no empty (zero) string predicate in Elisp, Pascal J. Bourguignon, 2015/04/26
- Re: no empty (zero) string predicate in Elisp, Emanuel Berg, 2015/04/26
- Re: no empty (zero) string predicate in Elisp, Marcin Borkowski, 2015/04/26
- Message not available
- Re: no empty (zero) string predicate in Elisp, Emanuel Berg, 2015/04/26
- Re: no empty (zero) string predicate in Elisp, Marcin Borkowski, 2015/04/26