From: Andreas Schwab <schwab@linux-m68k.org>
To: Philip Kaludercic <philipk@posteo.net>
Cc: Lynn Winebarger <owinebar@gmail.com>,
Stefan Monnier <monnier@iro.umontreal.ca>,
Matthew Trzcinski <matt@excalamus.com>,
emacs-devel <emacs-devel@gnu.org>
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 [thread overview]
Message-ID: <875y9usbvk.fsf@igel.home> (raw)
In-Reply-To: <87bkjmh3st.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 17 Apr 2023 16:27:46 +0000")
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."
next prev parent reply other threads:[~2023-04-17 16:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <168174708495.14139.12756054653439048176@vcs2.savannah.gnu.org>
[not found] ` <20230417155805.3E200C1391A@vcs2.savannah.gnu.org>
2023-04-17 16:08 ` [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the shells it can handle Stefan Monnier
2023-04-17 16:16 ` Lynn Winebarger
2023-04-17 16:27 ` Philip Kaludercic
2023-04-17 16:37 ` Andreas Schwab [this message]
2023-04-17 16:42 ` Philip Kaludercic
2023-04-17 16:39 ` Mattias Engdegård
2023-04-17 16:47 ` Mattias Engdegård
2023-04-17 17:37 ` Stefan Monnier
2023-04-17 18:33 ` Mattias Engdegård
2023-04-17 20:08 ` Stefan Monnier
2023-04-18 9:50 ` Mattias Engdegård
2023-04-17 17:11 ` Stefan Monnier
2023-04-17 17:24 ` Lynn Winebarger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875y9usbvk.fsf@igel.home \
--to=schwab@linux-m68k.org \
--cc=emacs-devel@gnu.org \
--cc=matt@excalamus.com \
--cc=monnier@iro.umontreal.ca \
--cc=owinebar@gmail.com \
--cc=philipk@posteo.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).