From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Re: defmacro with built-in gensym declaration and initialization Date: Thu, 21 Jan 2021 21:23:59 +0000 Message-ID: <87turaasr4.fsf@tcd.ie> References: <87bldk6n2l.fsf@gmail.com> <87turbiuvr.fsf@tcd.ie> <878s8n76ih.fsf@gmail.com> <87o8hj9vl9.fsf@tcd.ie> <875z3q6q51.fsf@gmail.com> <875z3qc8ur.fsf@tcd.ie> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29090"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: akater , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 21 22:25:21 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 1l2hSC-0007Qh-HF for ged-emacs-devel@m.gmane-mx.org; Thu, 21 Jan 2021 22:25:20 +0100 Original-Received: from localhost ([::1]:52698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2hSB-0004H5-I3 for ged-emacs-devel@m.gmane-mx.org; Thu, 21 Jan 2021 16:25:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59564) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2hR3-0003ix-Ag for emacs-devel@gnu.org; Thu, 21 Jan 2021 16:24:09 -0500 Original-Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:41128) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l2hQx-0008CG-LU for emacs-devel@gnu.org; Thu, 21 Jan 2021 16:24:08 -0500 Original-Received: by mail-wr1-x42d.google.com with SMTP id a12so3142219wrv.8 for ; Thu, 21 Jan 2021 13:24:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=BSPZ5xfBxyN0AfYR0XMPXt1ncICk4J09YtjpCCR0R1Y=; b=v3Ac/4AbkjNvIuyWgGSI/mygH6h/ePeH8M2lZnf5VpFOHgzq6lrGy05bRi+ErNIhw0 IPQsXDIGWtUtTEHMAmUA0bDuk5Rx7sm3Zwx49BAjd7PbsgTPsBzLw85wC41T7AczAVOg w5GbMPNGmCD0b/eX3wOk2F0k5bYaXQF04BgZe97YYhZNfDNIvaq+7JW0QEDsahO3P9LP 4BTHonGGCVYbhL0TgIvZC+vyEhQwgCO+a64LuO6tG4hbEhOMn6wbBzNBU1sxtRfRx8DR 6Pm2jlvRfGjY3+hjiYkTxW0F8Qc/ozaw7QndYH3y7DAz0ISQy1SD6KR2jdw77uighGfb NvYQ== 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:references:date:in-reply-to :message-id:user-agent:mime-version; bh=BSPZ5xfBxyN0AfYR0XMPXt1ncICk4J09YtjpCCR0R1Y=; b=JIHbb7XuCdmBYkl+LrpXRG5A/XWN2MYlkNzsMtWvagQfDg2WzJSPWSvqdbiEOw6GSC v4AXfKB10TLmt71JXxQduCO5Uv2eixICwa03PifuO7XqlzziqMIdRcjoRhd9sqVKaukR z6XYdZ73oYRhSiiwLoE8mrm7AdQCHCiGXwhesOm4EVvlMTes1ei3hjVRyiPT0m3gRNCC V9J78bRkmeGflwb59yI1tioxXoQOJRRL1Vt2ZDKbXnQhE4g46mljPETMNo7Fdx7CjZ5p Q9xoXj9DR9aRtrqPv1H5nivNqu2P5QmQsZ9VBJad7hi91hl7QrBmZ98M8Gxusx132oTA MZ+A== X-Gm-Message-State: AOAM533g/Mfb5w1ZJQo4GTJwhKXx97J0AsvtdyChhN9u7qAOUO6fXxvX tDZxpLUIa8YE1an3F+btyDk+og== X-Google-Smtp-Source: ABdhPJyxLtZQE1hgsShisrJEbIDv6NxlkD0d81bkjr69XK+v6mkPJy8QGIJPdP9ueQTgCaL9UNZNyw== X-Received: by 2002:adf:ee4d:: with SMTP id w13mr1333480wro.216.1611264241646; Thu, 21 Jan 2021 13:24:01 -0800 (PST) Original-Received: from localhost ([2a02:8084:20e2:c380:d15:339e:aa10:60f1]) by smtp.gmail.com with ESMTPSA id c18sm30573609wmk.0.2021.01.21.13.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 13:24:00 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Thu, 21 Jan 2021 16:05:53 -0500") Received-SPF: none client-ip=2a00:1450:4864:20::42d; envelope-from=contovob@tcd.ie; helo=mail-wr1-x42d.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=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:263256 Archived-At: Stefan Monnier writes: >>> Sorry, I suspect I misunderstood. What's a native arglist? Doesn't >>> defmacro already have native support for &optional and &rest keywords? >> Yes, and that's what I mean by native arglists - the ones possessed by >> built-in C objects such as subroutines, lambda expressions, compiled >> code, dynamic module functions, etc. and used by built-in C functions >> such as funcall. >> By contrast, cl-defmacro, other CL compatibility definitions, etc. have >> to parse a plain Elisp arglist for CL-specific features like &aux. > > FWIW, `defmacro` is itself a macro, just like `cl-defmacro`, so it > wouldn't be that terribly hard (the only problem is that it needs to be > implemented without itself using macros, more or less). Oh, right. > For me it's more a question that whatever something like `&gensym` can't > use values that are computed during the macro expansion, , so > > (defmacro M (ARGS &gensym FOO) > ...) > > is equivalent to something like: > > (defmacro M (ARGS) > (with-gensyms (FOO) > ...)) > > except: > - it's a bit more concise > - it exposes internal implementation details into the arglist, which is > usually considered as part of the signature. > - it doesn't cover the cases where you need `with-gensyms` deeper than > at the toplevel of the macro's body. > > I find the added concision doesn't pay for the other two downsides. Agreed, -- Basil