[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: |
Philip Kaludercic |
Subject: |
Re: [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the shells it can handle |
Date: |
Mon, 17 Apr 2023 16:42:50 +0000 |
Andreas Schwab <schwab@linux-m68k.org> writes:
> 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
Would this also affect code in a `eval-when-compile' block (which was my
anecdotal case)? From what I see, that shouldn't be byte-compiled.
- Re: [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the shells it can handle, Stefan Monnier, 2023/04/17
- Re: [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the shells it can handle, Lynn Winebarger, 2023/04/17
- Re: [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the shells it can handle, Philip Kaludercic, 2023/04/17
- Re: [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the shells it can handle, Mattias Engdegård, 2023/04/17
- Re: [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the shells it can handle, Mattias Engdegård, 2023/04/17
- Re: [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the shells it can handle, Stefan Monnier, 2023/04/17
- Re: [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the shells it can handle, Mattias Engdegård, 2023/04/17
- Re: [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the shells it can handle, Stefan Monnier, 2023/04/17
- Re: [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the shells it can handle, Mattias Engdegård, 2023/04/18
Re: [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the shells it can handle, Stefan Monnier, 2023/04/17