From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: akater Newsgroups: gmane.emacs.devel Subject: Re: defmacro with built-in gensym declaration and initialization Date: Wed, 20 Jan 2021 19:28:06 +0000 Message-ID: <878s8n76ih.fsf@gmail.com> References: <87bldk6n2l.fsf@gmail.com> <87turbiuvr.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1640"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: "Basil L. Contovounesios" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Jan 20 20:39:50 2021 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 1l2JKW-0000H5-OA for ged-emacs-devel@m.gmane-mx.org; Wed, 20 Jan 2021 20:39:48 +0100 Original-Received: from localhost ([::1]:40826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2JKV-0004xM-QD for ged-emacs-devel@m.gmane-mx.org; Wed, 20 Jan 2021 14:39:47 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2JJd-0004WZ-Sj for emacs-devel@gnu.org; Wed, 20 Jan 2021 14:38:53 -0500 Original-Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:35167) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l2JJb-0006e8-Ge for emacs-devel@gnu.org; Wed, 20 Jan 2021 14:38:53 -0500 Original-Received: by mail-ed1-x536.google.com with SMTP id j13so2879845edp.2 for ; Wed, 20 Jan 2021 11:38:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=WlqVA+oGLA/TgI4ZnQ4bomBEpqvptY04KkyurCSJU8M=; b=IFuZO3/lbXXwIyJyAMCwhqha4fQ4XxmWIRGivahwqGCI1q2IjZau2i/K6eWHVvf5E1 b2waOIddWqk6wHucfsupBuQ5MA04oNE/gWxsrNAhUBZ80Dw95RV+U/v2Tq7cbkkS7V2m WNzGeyzAiCQM3FPERsu/Inmke90oNDkG7vh4lgUVQNrXKt1mAHc3AOuXlZAyXv5AQ/AI nKCNb8zZv0pbOS6XBfz/ZK9jhQa6Mo9qKEwI3V6DuKmyI8buTTS9Y6c9PPty+3QoSc+q POIuwoUJElcUH1oJ7GZD3UKUgiY+P4hdlXvT3YQ9VtWUn2jWByDt7zmrEPu+J26AWR9M 79RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=WlqVA+oGLA/TgI4ZnQ4bomBEpqvptY04KkyurCSJU8M=; b=ahk53grfEimedMHnvOdTxwyOo7kFK0TJS9Z56CaU+hTM/YDYHU9vcBV69jaSjouVfy 66rkxFKr09xXlAVXLcGf+z1CfV1aHb88YbBaphI1WC+6ArrEwixXrmPdbdvQR8ZkoDno +xNQw+2Eid+nuMWE4uccYEtDDuNR4c0ftF4khemVje1C856lWCsG7Iwxn5rmel8Wt/2p Kb/gvQkh36HVqpLl/fTjFpwlwTFUvqtT2fKzJlaHgrISaAYbrkbjM0EkjEe0OyTdWnkj nVeAmBGHgrsL/qzAzYz80ge3J5IW1LG5pdz7syjrBj6E38YwUUngt5eQ/AbLPBqFyF9o J1wQ== X-Gm-Message-State: AOAM532VSyplS3o2IJLZpHhpqFhpNqycGIc6jFvnhC+oi20/taPv/4Xs IXOSmHMwBkg3sl8K2oekpv0= X-Google-Smtp-Source: ABdhPJwzfvTUzFAPJbJefO8dmYMhHM/lMcaSjrVep42aGdBIWdNyinSW+p/U+hO7nIfSnM1UcDQ57Q== X-Received: by 2002:a50:d80c:: with SMTP id o12mr8148061edj.338.1611171528601; Wed, 20 Jan 2021 11:38:48 -0800 (PST) Original-Received: from localhost ([185.220.101.142]) by smtp.googlemail.com with ESMTPSA id v15sm1293881ejj.4.2021.01.20.11.38.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Jan 2021 11:38:47 -0800 (PST) In-Reply-To: <87turbiuvr.fsf@tcd.ie> Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=nuclearspace@gmail.com; helo=mail-ed1-x536.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, 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.23 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" Xref: news.gmane.io gmane.emacs.devel:263218 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable "Basil L. Contovounesios" writes: > IMO, this minor convenience is insufficient motivation for > conflating/complicating a macro's global arglist, i.e. its arity, > calling convention, etc., with utilities for its local body. Is there > some other motivation? Am I missing something? My motivation mostly comes from CL where complicated lambda lists are not considered an issue, and it didn't come to my mind it could be an issue for Emacs Lisp users. In particular, &gensym does indeed follow the design of &aux, described below as =E2=80=9Chideous=E2=80=9D (another s= urprise). I use &aux regularly, and I find it a nice addition as it reduces the nesting depth of defun and defmacro forms. &gensym does that and saves some boilerplate on top of it, I tried it in real life macros, found it useful, and that's pretty much it. > conflating/complicating a macro's global arglist, i.e. its arity, What's the arity of defmacro? This form already allows any number of arguments so as far as I can see adding another keyword does not change arity. Calling convention is backwards compatible. Again, Common Lisp implementations are allowed to introduce their own lambda list keywords so I didn't (and still don't) think extending lambda-list keywords set is a big deal. > Why not provide handy gensym/once-only local conveniences for macro > authors instead (some of which already exist in one form or another, > e.g. macroexp-let2, inline-letevals, and org-with-gensyms)? I don't have much experience with macroexp-let2 which on the first glance looks like an overcomplicated once-only that is mostly relevant for functions that are meant to be byte-compiled. Since we're moving to natively compiled Elisp, I was thinking it's going to become less relevant in near future, and &gensym covers most use cases of once-only. Again, org-with-gensyms is precisely something that's being replaced here with an alternative that is less verbose and has a decreased nesting depth. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJLBAEBCgA1FiEEgu5SJRdnQOF34djNsr6xYbHsf0QFAmAIhEYXHG51Y2xlYXJz cGFjZUBnbWFpbC5jb20ACgkQsr6xYbHsf0RkFxAAwibPujVf/Mbz4wexXpYzhzCZ uHVNTW03spl/Qg7ioJhG7Vv8QO5mKQLxN4rOOCSBbz+xslUrhPA/xSvDphH8CIAO cyq5x+rnJEfhjI2ALVeHV2lXCb4gF4HXaqHaC9ChwD620A22ASkuCV45aq2tRVWE PwfMw5D2Zv9J5TBM8/Qo4/R8RtoAFhyDWZ9DuI0sHnDRjH/4UHmunTgFxEacXPss Veg0S27S68SuAgdFV84KC8l/BhshzWpRcz6QGAKlE2u3Xr1yF/hx00eSDxe4tdXu 2khhXi1DHBnRapBxW66dj5urJmsAHTWrVy3Ak1ni7aSIqept5fhqJvzB5pU6m+EU 24TVskq92nwfT8zHwQ8qPf5hOaIaPoH0AMYLr4zIkAEQSdQ3esktsvzYfn1MAl0S TLxLj1i8HtHi4tR+yA9QmPc/sXYz5GsIQAa8pp7rd+R2sq//pAMNRbD3srpkUCKF UjhRlpdziBs4jMyvRobVazDrf27IJMxihB/fE/wkFsWqHUS9ll5LWBBe3AyWGshu n+TjiUEAL4KkkuqPLtgMwwMdcxG2yMXR5PWUqUv1IHqdMR6RpUO5HKorvprw+Rgp wulcyUrwh6yn3wRBYXVlq/vWuAL7MX7qMPa3lsNFHFeGs3wA2PGLltzl/2OFhgrg Z9hC8OVMMaTgy3E8Q1Y= =ZWou -----END PGP SIGNATURE----- --=-=-=--