emacs-devel
[Top][All Lists]
Advanced

[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 17:20:00 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Attachment: 0001-Optimize-byte-compilation-of-proper-list-p.patch
Description: Text Data

Attachment: 0002-Move-proper-list-p-tests-to-fns-tests.el.patch
Description: Text Data

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.

Makes sense, how's the attached?  Is there a better place to do this
than in syms_of_fns?  (I followed the example in src/json.c.)

>> diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
>> index 8bbe6292d9..0e953dc96b 100644
>> --- a/lisp/emacs-lisp/bytecomp.el
>> +++ b/lisp/emacs-lisp/bytecomp.el
>> @@ -3566,6 +3566,7 @@ byte-defop-compiler-1
>>  
>>  ;;####(byte-defop-compiler move-to-column   1)
>>  (byte-defop-compiler-1 interactive byte-compile-noop)
>> +(byte-defop-compiler-1 proper-list-p 1)
>
> I don't think this is needed.

Right.  For some reason the byte-compiler wasn't complaining about wrong
numbers of arguments without this compiler-form, but I can no longer
reproduce that.

I also attach a second patch which moves the proper-list-p tests to the
correct file following the function's rewriting in C.  WDYT?

Thanks,

-- 
Basil

reply via email to

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