[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Predicate for true lists
From: |
Basil L. Contovounesios |
Subject: |
Re: Predicate for true lists |
Date: |
Tue, 09 Apr 2019 21:12:49 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>> @@ -1160,8 +1161,8 @@ byte-optimize-set
>> make-list make-string make-symbol marker-buffer max member memq min
>> minibuffer-selected-window minibuffer-window
>> mod multibyte-char-to-unibyte next-window nth nthcdr number-to-string
>> - parse-colon-path plist-get plist-member
>> - prefix-numeric-value previous-window prin1-to-string propertize
>> + parse-colon-path plist-get plist-member prefix-numeric-value
>> + previous-window prin1-to-string proper-list-p propertize
>> degrees-to-radians
>> radians-to-degrees rassq rassoc read-from-string regexp-quote
>> region-beginning region-end reverse round
>
> I think it'd be better to add a `side-effect-free` property rather than
> add to this list. We should be moving away from having this list in
> byte-opt.el since that info can also be used when byte-opt is not loaded.
Should the Elisp manual be updated to reflect this?
>From fd52e0b08866ecdb93088e539423ee8af6db2fa9 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <address@hidden>
Date: Tue, 9 Apr 2019 20:55:25 +0100
Subject: [PATCH] Update side-effect-free primitive docs
* doc/lispref/internals.texi (Writing Emacs Primitives): Describe
currently preferred approach to marking built-in functions as
side-effect-free.
---
doc/lispref/internals.texi | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index 8ebe47d9ad..826818c380 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -1031,10 +1031,13 @@ Writing Emacs Primitives
@file{lisp.h} contains the definitions for some important macros and
functions.
- If you define a function which is side-effect free, update the code
-in @file{byte-opt.el} that binds @code{side-effect-free-fns} and
address@hidden so that the compiler optimizer
-knows about it.
+ If you define a function which is side-effect free, give it a
address@hidden @code{side-effect-free} declaration (@pxref{Declare
+Form}) or function property (@pxref{Symbol Plists}) so that the
+compiler optimizer knows about it. Alternatively, you can update the
+code in @file{byte-opt.el} that binds @code{side-effect-free-fns} and
address@hidden, but this approach is less
+modular and no longer encouraged.
@node Writing Dynamic Modules
@section Writing Dynamically-Loaded Modules
--
2.20.1
Thanks,
--
Basil
Re: Predicate for true lists,
Basil L. Contovounesios <=
- Re: Predicate for true lists, Stefan Monnier, 2019/04/09
- Re: Predicate for true lists, Eli Zaretskii, 2019/04/09
- Re: Predicate for true lists, Alex Branham, 2019/04/10
- Re: Predicate for true lists, Basil L. Contovounesios, 2019/04/10
- RE: Predicate for true lists, Drew Adams, 2019/04/10
- Re: Predicate for true lists, Basil L. Contovounesios, 2019/04/10
- Re: Predicate for true lists, Eli Zaretskii, 2019/04/10
- Re: Predicate for true lists, Basil L. Contovounesios, 2019/04/17
- Re: Predicate for true lists, Stefan Monnier, 2019/04/17
- Re: Predicate for true lists, Basil L. Contovounesios, 2019/04/21