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#66867: lexical binding? Date: Thu, 02 Nov 2023 17:21:23 -0400 Message-ID: References: <15949.1698806098@archlinux> <39969.1698815795@archlinux> <87v8algdkr.fsf@web.de> <161636.1698946888@archlinux> 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="24572"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Greg Minshall , Michael Heerdegen , 66867@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 02 22:22:40 2023 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 1qyf9D-0006Ac-6A for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Nov 2023 22:22:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qyf93-0005N8-Fk; Thu, 02 Nov 2023 17:22:29 -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 1qyf91-0005Mq-Ld for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 17:22:27 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qyf91-0007yu-Cw for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 17:22:27 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qyf9a-0002Jn-Gq for bug-gnu-emacs@gnu.org; Thu, 02 Nov 2023 17:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Nov 2023 21:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66867 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 66867-submit@debbugs.gnu.org id=B66867.16989601308843 (code B ref 66867); Thu, 02 Nov 2023 21:23:02 +0000 Original-Received: (at 66867) by debbugs.gnu.org; 2 Nov 2023 21:22:10 +0000 Original-Received: from localhost ([127.0.0.1]:56290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyf8k-0002IZ-FT for submit@debbugs.gnu.org; Thu, 02 Nov 2023 17:22:10 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:45030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qyf8f-0002Hx-CR for 66867@debbugs.gnu.org; Thu, 02 Nov 2023 17:22:09 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id C2E248076B; Thu, 2 Nov 2023 17:21:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1698960084; bh=WcwfHovaOVoxhg74e7yKFipNxOo+Ph9ROz/VWHc/Q3A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=akaneCLIIuNMH53id1Nb2BF0L78UF2TpVaRag5yB07Pvq2G8TKyKIQ6MEd7GTehre yfRcJWGb/WS/2hg7TTa3TJxbuWFQvEfcs78dKAV5lO8rU+varcayZmGGEaRvmiHtgZ GQRYzX0RfbxUohQv4FDQ5rEs3Yc5UdaXcX4klIlDeKt0/zKmmE6Gu7Gu2zJLfrvHMe aUM6LT+Q++K0/bLSZWwvIukKEet3rHdlVgPuMabx5WeWeKqhWvgtQ2Qf2KQIJD9exL 17P2/e1bazkY5+WF0jlhQsuPsVfdfR/5WR7kB/mneiyeKYJmZmKcCCggtE0yvhVDcY +PpNV/WyicdCw== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 06FA480087; Thu, 2 Nov 2023 17:21:24 -0400 (EDT) Original-Received: from pastel (unknown [45.72.195.71]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id CF7BF12040A; Thu, 2 Nov 2023 17:21:23 -0400 (EDT) In-Reply-To: (Stefan Kangas's message of "Thu, 2 Nov 2023 12:39:15 -0700") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:273680 Archived-At: >>>> maybe the Oclosure code should enforce lexical-binding, if it can, or >>>> throw an informative error in the case it can't so enforce? >>> Stefan M, what do you think? >> A (cl-assert lexical-binding) in something like `oclosure--lambda` >> sounds good, yes. > Thanks, so patches welcome. Should it go to `emacs-29` or `master`? Stefan diff --git a/lisp/emacs-lisp/oclosure.el b/lisp/emacs-lisp/oclosure.el index ae0038b45e6..c23dd5a36da 100644 --- a/lisp/emacs-lisp/oclosure.el +++ b/lisp/emacs-lisp/oclosure.el @@ -350,6 +350,7 @@ oclosure--lambda should be mutable. No checking is performed." (declare (indent 3) (debug (sexp (&rest (sexp form)) sexp def-body))) + (cl-assert lexical-binding) ;Can't work in dynbind dialect. ;; FIXME: Fundamentally `oclosure-lambda' should be a special form. ;; We define it here as a macro which expands to something that ;; looks like "normal code" in order to avoid backward compatibility