From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.emacs.devel Subject: Re: [elpa] externals/org 26ef5e3e5b: org-src: Use `sh-mode' for all the shells it can handle Date: Mon, 17 Apr 2023 13:24:25 -0400 Message-ID: References: <168174708495.14139.12756054653439048176@vcs2.savannah.gnu.org> <20230417155805.3E200C1391A@vcs2.savannah.gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000016c7da05f98b7764" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12723"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Matthew Trzcinski , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 17 19:25:25 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1poSbV-00031V-3O for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Apr 2023 19:25:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1poSap-0004W6-00; Mon, 17 Apr 2023 13:24:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1poSam-0004Ve-HM for emacs-devel@gnu.org; Mon, 17 Apr 2023 13:24:40 -0400 Original-Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1poSak-0000CY-Uk for emacs-devel@gnu.org; Mon, 17 Apr 2023 13:24:40 -0400 Original-Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1a516fb6523so19591045ad.3 for ; Mon, 17 Apr 2023 10:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681752277; x=1684344277; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=srvCzQAw0soqA9t2K9qFMTuDb952moQy4OtxCLaZ8zY=; b=mK9W/MrxsbNTS+EuSILG7pCx4hVrcyJ/Yjh9n8zR35Y+6CEnVce8eOnOElgChFiHc+ 2Q7qMiXcpQTR9HH2+bOKXepEeDFEaRLp1REcufOUg5ZPDicuiefD+QsDwbKHrqR+XApl N2saT7gl2Eh1qVVZUoNF9W83Qbh7nYUZrClG9hu3fREd8DIxJKFmlSZDLK82dnZlm6GX 0JgTKBXhw9xB+c//uUir3MdToT2+vryIgfbzkL4GNiHK4B1RgJmoLDOHKpSe51ZGvufW EG6QnWSCk93fOYnbTlN5/5PIE3UPu3Fxu0OVzwVddkSozmDoWYKwSpY7NWIm2182DYk9 D+sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681752277; x=1684344277; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=srvCzQAw0soqA9t2K9qFMTuDb952moQy4OtxCLaZ8zY=; b=h2iDOW4w0CHjserkt4v3QuXvt8+Mi5aSGdKbbSP5fdqZ04Wx4csnR2MKHoZ6wQaBp7 HCtdJpPjemeunp9rwpsjaLojz0e/6fNsjl6vdd+peC10WbkZ0DCVEHNgEUMTNi88S4qZ g6rnEs1MMFZCdSQwv5TYkReXfIDLwX0eTtmaY1VRIEJYQEMhf6wXznCBkQ/16xKAKIBF ohPH5sPKDB66YtSLAWaL50qTrtWNgpiWClN371dIdnjlFc30FjHz2HU6oAyb2fyH3O43 rB/o8Dvfj22RSWGUH/aenefgJNV2iiaDgDGn4AvhC7f5L5HOXmN9HzVqmy8TO6q63c3C 7C6Q== X-Gm-Message-State: AAQBX9f7dhooUgiTSO8KUwJS5ALnlpoi8lpgzneiCZlGjliN+woXPidT giMp7nRJS+ZtFRzz25+Jea65QlRC8fxpBkM/3zA= X-Google-Smtp-Source: AKy350aGUtoqpstww+EXkQ1Hp6GZUF7+knjiCXJFxrIFg7WXMPoBgxabXZtifvNKcNyNmrehrPDQwCkEpZdV3xaPpmQ= X-Received: by 2002:a05:6a00:16c4:b0:625:d7e6:51a0 with SMTP id l4-20020a056a0016c400b00625d7e651a0mr7875271pfc.1.1681752277303; Mon, 17 Apr 2023 10:24:37 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=owinebar@gmail.com; helo=mail-pl1-x62e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:305378 Archived-At: --00000000000016c7da05f98b7764 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 17, 2023, 1:11 PM Stefan Monnier wrote: > >> ELISP> (macroexpand '`(,@(list 1 2) a b c d)) > >> (append (list 1 2) '(a b c d)) > >> ELISP> (macroexpand '`(a b c d ,@(list 1 2))) > >> (cons 'a (cons 'b (cons 'c (cons 'd (list 1 2))))) > >> ELISP> > > Why is the former more efficient than the latter? > > One allocates N=E2=82=81+N=E2=82=82 cons cells, then other only allocates= N=E2=82=81 cons-cells. > This is true regardless of how we macroexpand and byte-compile the code. > This only makes a diference for code that's executed several times > (i.e. not at toplevel). > I see - what you meant by "such ,@" was when the preceding elements are constant. I've seen a veteran Lisp programmer get bitten by side-effecting a list constructed with that feature of backquote. Lynn --00000000000016c7da05f98b7764 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Apr 17, 2023, 1:11 PM Stefan Monnier <monnier= @iro.umontreal.ca> wrote:
&g= t;>=C2=A0 =C2=A0 =C2=A0ELISP> (macroexpand '`(,@(list 1 2) a b c = d))
>>=C2=A0 =C2=A0 =C2=A0(append (list 1 2) '(a b c d))
>>=C2=A0 =C2=A0 =C2=A0ELISP> (macroexpand '`(a b c d ,@(list 1= 2)))
>>=C2=A0 =C2=A0 =C2=A0(cons 'a (cons 'b (cons 'c (cons &#= 39;d (list 1 2)))))
>>=C2=A0 =C2=A0 =C2=A0ELISP>
> Why is the former more efficient than the latter?

One allocates N=E2=82=81+N=E2=82=82 cons cells, then other only allocates N= =E2=82=81 cons-cells.
This is true regardless of how we macroexpand and byte-compile the code. This only makes a diference for code that's executed several times
(i.e. not at toplevel).

<= /div>
I see - what you meant by "such ,@" was wh= en the preceding elements are constant.=C2=A0=C2=A0
=
I've seen a veteran Lisp programmer get bit= ten by side-effecting a list constructed with that feature of backquote.=C2= =A0=C2=A0

Lynn

--00000000000016c7da05f98b7764--