From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#52063: 28.0.60; Confusing presentation of lambda Date: Thu, 25 Nov 2021 14:07:45 -0500 Message-ID: References: <83czmqaegb.fsf@gnu.org> <874k82vwe5.fsf@gnus.org> <831r35afde.fsf@gnu.org> <87v90hu36b.fsf@gnus.org> <83v90h8zjw.fsf@gnu.org> <87r1b5u1cl.fsf@gnus.org> <83pmqp8vps.fsf@gnu.org> <87v90ge5rc.fsf@gnus.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3191"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Philipp Stephani , Filipp Gunbin , Eli Zaretskii , 52063@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 25 20:08:08 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1mqK6K-0000dD-Ki for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Nov 2021 20:08:08 +0100 Original-Received: from localhost ([::1]:32962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mqK6J-0000n9-L6 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 25 Nov 2021 14:08:07 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mqK6E-0000n1-2l for bug-gnu-emacs@gnu.org; Thu, 25 Nov 2021 14:08:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46496) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mqK6D-0003oU-RC for bug-gnu-emacs@gnu.org; Thu, 25 Nov 2021 14:08:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mqK6D-0002x2-Kc for bug-gnu-emacs@gnu.org; Thu, 25 Nov 2021 14:08:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Nov 2021 19:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52063 X-GNU-PR-Package: emacs Original-Received: via spool by 52063-submit@debbugs.gnu.org id=B52063.163786727811335 (code B ref 52063); Thu, 25 Nov 2021 19:08:01 +0000 Original-Received: (at 52063) by debbugs.gnu.org; 25 Nov 2021 19:07:58 +0000 Original-Received: from localhost ([127.0.0.1]:58042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqK69-0002wj-Pl for submit@debbugs.gnu.org; Thu, 25 Nov 2021 14:07:57 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:20463) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mqK67-0002wW-7U for 52063@debbugs.gnu.org; Thu, 25 Nov 2021 14:07:56 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 9EFBE10025F; Thu, 25 Nov 2021 14:07:49 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 3C55E100134; Thu, 25 Nov 2021 14:07:48 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1637867268; bh=/ko9lg0BV7lYe/97ExcdcuBAb7VkIWKkim86ItHPfq0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=FVCN7XPMKgIBkIMPhqUO5ZIQ6nhVfToUxcJaASC9CsWCF/2fml5SFukaQMNpqu58F 4WEfv5F4XRC3KDmRNGtu1G1wLYsk59EFlbLSRX4Hp5xmTZv9MU2Veub235TGZmdr/Z xH5FHK3X77ZU0Kh6Yws2xuJ7pFh2QJTQkJtMxcpNyOL8yoOrRUIIrqJOiBjcazh78u BN58gcHKILNd2EDtnHcQSld/C4DdjTE1tLvKASh0Z6WADVZJCOxCZN1WKcZyl2w7VB vJpGysu+dVI9u69iXqDfPvsPzzxCMXYZr3rxlYdUe7uWMn3J2vuCGFuR6RvAzSERPi iKaUdt3Ks8f4Q== Original-Received: from alfajor (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 25BAC12010B; Thu, 25 Nov 2021 14:07:48 -0500 (EST) In-Reply-To: <87v90ge5rc.fsf@gnus.org> (Lars Ingebrigtsen's message of "Thu, 25 Nov 2021 14:15:03 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:220847 Archived-At: > Depends on the length of the lexical list, though: > > (pp-emacs-lisp-code > (let ((bar 1)) > (lambda (f) (setq foo bar) (setq foo bar)))) > => > (closure ((bar . 1) t) (f) > (setq foo bar) > (setq foo bar)) > > can be unwieldy if the list is long. [ Taking a step back and ignoring practical concerns like whether it's easy to implement efficiently. ] We could have something like: (let ((foo 1) (bar 2) (baz 5)) (lambda (x) (+ x bar))) return an object like (closure (x) ((bar . 2)) (+ x bar)) instead of the current (closure ((baz . 5) (bar . 2) (foo . 1) t) (x) (+ x bar)) IOW, the final `t` can be dispensed with, we could swap the arglist and the captured environment, and we could filter the environment to only include variables which are actually used inside the function. Stefan