emacs-devel
[Top][All Lists]
Advanced

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

Re: [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the


From: Andreas Schwab
Subject: Re: [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the shells it can handle
Date: Mon, 17 Apr 2023 18:37:51 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

On Apr 17 2023, Philip Kaludercic wrote:

>> Why is the former more efficient than the latter?  It looks like the former
>> would have to construct the '(1 2) list twice, and the latter only once.
>> And the '(a b c d) cons cells are only allocated once either way.
>
> (I believe) It is more efficient, since there are fewer function calls.
> I have had issues in the past with ,@ expanding to code that would have
> exceeded the maximal evaluation depth, until I split it up and manually
> used `append' that has the advantage of being implemented in C.

cons is a bytecode intrinsic, so it shouldn't make that much of a
difference.
(cons 'a (cons 'b (cons 'c (cons 'd (list 1 2 3))))) is translated into

0       constant  a
1       constant  b
2       constant  c
3       constant  d
4       constant  1
5       constant  2
6       constant  3
7       listN     7

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."



reply via email to

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