From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Newsgroups: gmane.emacs.devel Subject: Re: Why shouldn't we have a #if .... #else .... #endif construct in Emacs Lisp? Date: Sun, 3 Sep 2023 13:27:31 +0100 Message-ID: References: <87zg2bosf3.fsf@dataswamp.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000004541320604738587" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1971"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Sep 03 14:28:45 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 1qcmDd-0000Mb-EI for ged-emacs-devel@m.gmane-mx.org; Sun, 03 Sep 2023 14:28:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qcmCp-0001kK-D2; Sun, 03 Sep 2023 08:27:55 -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 1qcmCl-0001k4-LQ for emacs-devel@gnu.org; Sun, 03 Sep 2023 08:27:51 -0400 Original-Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qcmCh-0001yd-3x for emacs-devel@gnu.org; Sun, 03 Sep 2023 08:27:51 -0400 Original-Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2b9c907bc68so7201671fa.2 for ; Sun, 03 Sep 2023 05:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693744064; x=1694348864; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4l/PaAg/39xfeEMTyGgb/rtxIsmoORkgAVH6wr5QyPM=; b=lLYm+G4tZrziWK5p74gkXFJUnS3tJsbIeScBMsbYG36GGiYKnft/Yfc1TEi1Mhs/8z 8ICQiF2o3vPFNRrlUNTfYs8GFaKsVAteW0ccRy40nX2QhCP3HgtGltHZ6qjurYph/wmT N1aZfm0Lsg+TxguA3KuObwL9SVK5mV16WOVv9rUG3FW7rboCbbO5YNK+a3iYSAzaWQzL n2OnIfFYrulM8moN1PvcZrjCx0pC+yu3dqm5DjLdCaxJBZEDnsP3SlwPp1NrsbCVDfw9 UxOnLNxyPoAa6PomHZknZ1G8HjEtptfQ5uEKbrRBqxx8RvwbjYbk0oP+hJ81TUt4J9F0 +ItQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693744064; x=1694348864; 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=4l/PaAg/39xfeEMTyGgb/rtxIsmoORkgAVH6wr5QyPM=; b=VXObFXRbc+Cfyj9tP28uMF7ZkStPFvxyPvPLSsIDecu2EfP8maQeuCjKxGqWzZKW/K g9532/LHE2LznRCDMDTgInfz+05bEacQv5BNscjHOy2WY4CmeRlvNGTHpj8GTeflKHo4 x16BvslyzhzbEQxftodJJOt+j2uiC1ZWGutjjtK8xXIzfM2TU0w2y5qWmCkPUwnvZYbi aglD+vcp+K3sAF/Nl85M3/uOWh4GMlPzc8RYGCtjiqO5uaYGau034JINIKULOduttI8m zpM9tHlspyyoo1QyVRhCFABhn4ofHSsos+GlIB0PBYDmZNNg29gjL5ef1x65KVx865Dp xo5A== X-Gm-Message-State: AOJu0YyQmjif6t/vXb5AxYUBK9AzV2EXTXqUPOpy78Xc9BLRh2oYMkGu UzQ8BEUgz9KerN+nSQV+RJEpk19Pz1GgTTLgTke3/4M6SaQ= X-Google-Smtp-Source: AGHT+IHkf7+ifbOxW90ITM6jvu3Ama6zsV+zIqU4F4QAr8ySo16GJRV+cCtLCq6uPynSw8JMQb/9/etU8egm+KKwhf8= X-Received: by 2002:a2e:721a:0:b0:2b9:e230:25ce with SMTP id n26-20020a2e721a000000b002b9e23025cemr5075704ljc.12.1693744063920; Sun, 03 Sep 2023 05:27:43 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::233; envelope-from=joaotavora@gmail.com; helo=mail-lj1-x233.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 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, MIME_BOUND_DIGITS_15=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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:309970 Archived-At: --0000000000004541320604738587 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, Sep 3, 2023, 00:15 Stefan Monnier via Emacs development discussions. wrote: > > > > FWIW, Common Lisp has reader macros to solve the problem: > > http://clhs.lisp.se/Body/24_aba.htm > > I don't see why reader macros would be needed here. > I didn't say they are "needed" to solve it. I merely said they would. And they do, quite effectively in Common Lisp, precisely for the C-like use cases presented here as paradigmatic. But as always there are multiple ways to skin a cat. CL's is particularly good IMO, and much more versatile than what is being proposed here. It skins this and more cats. For example it doesn't require changing the indentation of the form being ifdef'ed out. And the property of making some code invisible to the reader is great for adding/removing arguments conditionally in calls based on read-time knowledge. Anyway, I'm taking about a particular type of reader macro called "feature expressions" and that's what I linked to. Jo=C3=A3o --0000000000004541320604738587 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Sun, Sep 3, 2023, 00:15 Stefan Monnier via Emacs developmen= t discussions. <emacs-devel@gnu.org> wrote:
>
> FWIW, Common Lisp has reader macros to solve the problem:
>
http:= //clhs.lisp.se/Body/24_aba.htm

I don't see why reader macros would be needed here.=C2=A0=C2=A0

I didn&#= 39;t say they are "needed" to solve it. I merely said they would.= And they do, quite effectively in Common Lisp, precisely for the C-like us= e cases presented here as paradigmatic.

But as always there are multiple ways to skin a cat.=C2=A0<= /div>

CL's is particularly= good IMO, and much more versatile than what is being proposed here. It ski= ns this and more cats. For example it doesn't require changing the inde= ntation of the form being ifdef'ed out. And the property of making some= code invisible to the reader is great for adding/removing arguments condit= ionally in calls based on read-time knowledge.=C2=A0

Anyway, I'm taking about a particular type= of reader macro called "feature expressions" and that's what= I linked to.

Jo=C3=A3o<= /div>
--0000000000004541320604738587--