From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Whitton Newsgroups: gmane.emacs.devel Subject: Re: #'quoting functions when they are used as identifiers Date: Sun, 27 Mar 2022 11:58:32 -0700 Message-ID: <87zglbql2f.fsf@athena.silentflame.com> References: <87bkxrh97s.fsf@bernoul.li> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31633"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Emacs/29.0.50 (x86_64-pc-linux-gnu) To: Jonas Bernoulli , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 27 20:59:53 2022 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 1nYY7D-00080B-7w for ged-emacs-devel@m.gmane-mx.org; Sun, 27 Mar 2022 20:59:52 +0200 Original-Received: from localhost ([::1]:58194 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYY7C-0004FK-2a for ged-emacs-devel@m.gmane-mx.org; Sun, 27 Mar 2022 14:59:50 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53568) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYY63-0003Xt-RV for emacs-devel@gnu.org; Sun, 27 Mar 2022 14:58:40 -0400 Original-Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:54109) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYY61-0007QB-W2 for emacs-devel@gnu.org; Sun, 27 Mar 2022 14:58:39 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id CFDBA3200AF3; Sun, 27 Mar 2022 14:58:34 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Sun, 27 Mar 2022 14:58:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=spwhitton.name; h=cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; bh=IrI0BBNacDv98fPv6g1aGzZDTXs2tOv5K7ewcj gQyQY=; b=Fk/OVWzGXU25jCL8gIwGhUh0hWApwXU8c5D5z9rSrkDriGdaBdG3ai JUSP2/Vjl3uNMe6Sn84bJUSCQXf56G1lsT5G99lXoAz+h1c6n4fl2Rkwg+VAg7ox 8i8RhaL1StlLd02+BZmDVC4EP9oeSLII9BBxvtZQeJQgTPk9ZZJMsFC+uVJRCuY5 uiWxxYrzSpwIT9jz4ekkQmhgLHvbnHcjWf2+jUAnvnfv5oRZ1KrE4pG0fnqOp182 MGiZdWhThJcAtOSQCOV8XeYY3GQfXvid+4JRJBoOMWwormpNmBEwOX7cQuc69eWj P9ZXtnRBU2DNZSjYwGrl65FuWiqPtSmA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=IrI0BBNacDv98fPv6 g1aGzZDTXs2tOv5K7ewcjgQyQY=; b=OnLei3oixMLGnsgDDlOQSm2enGSY2iv98 2vaT56XMaWTAKOcEFgB8ezbt0NQehwMdllMXmWaIB+OCdw+4uTm+ovJQJo4GgVUX elNP2ptYku0Gv9mM9TKJYLEhrRV8TfkRD+nKLFSBhWTaHs+IGE6ufBkqIanpxxXz o4reZqOvOHpbACnWrCTaX56DKsMHjsX8RZhiyxRX8UCpHpvS1DiBrGTeOff1yKRn lSH8C4olWg/HYsbuJ/5JZvqNSxp1arrJVN9ZBoEd0UMmdW9hjY2JW+FcyfR3ldgy LkAybbcHcc1OYkiR9OBODj3UI4EIYoPep0bRAaOAbDkBFl9Ar4XFQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudehhedgudeffecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffujghffgffkfggtgesthdttddttdertdenucfhrhhomhepufgvrghn ucghhhhithhtohhnuceoshhpfihhihhtthhonhesshhpfihhihhtthhonhdrnhgrmhgvqe enucggtffrrghtthgvrhhnpeelgeeggfdvieejvdfhudfggeetgfekkeeuieeljeejhedu geegfeetgefhueffkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehsphifhhhithhtohhnsehsphifhhhithhtohhnrdhnrghmvg X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 27 Mar 2022 14:58:33 -0400 (EDT) Original-Received: by athena.silentflame.com (Postfix, from userid 1000) id 315501B6505; Sun, 27 Mar 2022 18:58:32 +0000 (UTC) In-Reply-To: <87bkxrh97s.fsf@bernoul.li> Received-SPF: pass client-ip=64.147.123.20; envelope-from=spwhitton@spwhitton.name; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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" Xref: news.gmane.io gmane.emacs.devel:287510 Archived-At: Hello, On Sun 27 Mar 2022 at 02:27pm +02, Jonas Bernoulli wrote: > I was wondering whether it is wrong per se to function-quote a > function-bound symbol if it serves as an argument to a function that > does not actually call the argument as a function but for which it > would never-the-less be a bug to be passed a symbol that isn't bound > as a function. I've struggled with this. If you assume that sharpquote has the same meaning (ignoring implementation) as the sharpquote in Common Lisp, then I can give an answer. Suppose that you are choosing between (f #'foo) and (f 'foo). Then - use #'foo if f will do something with the function object which may be invoked using (foo ...) in the lexical environment in which the (f #'foo) would occur - otherwise, use 'foo, because f will do something with the symbol `foo', but not its function binding. > I am considering adding #'quotes because I would like to get that > feedback from the byte-compiler. On the other hand, one might argue > that doing that is misleading to the human reader because the symbol > is not actually intended to be called as a function, it just has to be > a symbol that is fboundp, else there would be a bug (due to a typo or > renaming). According to the CL meaning for sharpquote, this wouldn't make sense. I think I'd find it confusing myself, but then, I write lots of CL. I really don't know how close the Emacs Lisp sharpquote is meant to be to the CL sharpquote. The technical difference is that CL doesn't have symbol function indirection as described by (info "(elisp) Function Indirection"). -- Sean Whitton