From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#47992: [External] : bug#47992: 27; 28; Phase out use of `equal` in `add-hook`, `remove-hook` Date: Sun, 25 Apr 2021 01:16:09 +0000 Message-ID: References: <090f8bd5-368c-5684-85e1-65420049d47a@daniel-mendler.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15195"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "47992@debbugs.gnu.org" <47992@debbugs.gnu.org>, "jakanakaevangeli@chiru.no" To: Stefan Monnier , Daniel Mendler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 25 03:17:15 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 1laTOc-0003qc-Qh for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Apr 2021 03:17:14 +0200 Original-Received: from localhost ([::1]:40650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1laTOb-0007uD-TN for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 24 Apr 2021 21:17:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50140) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laTOR-0007u3-7r for bug-gnu-emacs@gnu.org; Sat, 24 Apr 2021 21:17:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58412) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1laTOQ-0005hY-Fm for bug-gnu-emacs@gnu.org; Sat, 24 Apr 2021 21:17:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1laTOQ-0007XZ-9u for bug-gnu-emacs@gnu.org; Sat, 24 Apr 2021 21:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Apr 2021 01:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47992 X-GNU-PR-Package: emacs Original-Received: via spool by 47992-submit@debbugs.gnu.org id=B47992.161931340428956 (code B ref 47992); Sun, 25 Apr 2021 01:17:02 +0000 Original-Received: (at 47992) by debbugs.gnu.org; 25 Apr 2021 01:16:44 +0000 Original-Received: from localhost ([127.0.0.1]:41725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1laTO7-0007Wy-O8 for submit@debbugs.gnu.org; Sat, 24 Apr 2021 21:16:43 -0400 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:43898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1laTO2-0007Wh-LA for 47992@debbugs.gnu.org; Sat, 24 Apr 2021 21:16:42 -0400 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13P1F7Y1165755; Sun, 25 Apr 2021 01:16:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2020-01-29; bh=xwCysK7OmOIWRuJ/wmb4wtwBgxot0yOseHhYsdESXt0=; b=IyRp3nfChRFkjY2phgjFcr8LRjYOljjxjXnNuL1CJWFd8uY8+iJdn6K7I6VqEAaQleR9 BYjAfZjayxcIu/X25lR7T1iBBPZhHUXUVv3uDpoV3ySKWzo8pH60vEGsbHtKUJa1quV+ /MFriTtcE1CxhHLqv8JMaWdx24cOu0rZvWh6frXa8TRvd2xdGmn0eKaPYIkLdvSWnWDC 0s1FGC3DiaCa/vMRyYn+oDKTlj1CpJ587bp+jxuB/DIGACuD2F2et6cnuCkE2SHy9hGR HZPPGRvtlti1mfeyFJ5H7Tpj7WU5PLTmXG9KRT2prI3BdBJqU3aZ+B4sr8rRZU8o6A24 xg== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 384b9n0v64-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 25 Apr 2021 01:16:11 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 13P1FYN5071562; Sun, 25 Apr 2021 01:16:11 GMT Original-Received: from nam02-cy1-obe.outbound.protection.outlook.com (mail-cys01nam02lp2053.outbound.protection.outlook.com [104.47.37.53]) by aserp3020.oracle.com with ESMTP id 384b51y04u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 25 Apr 2021 01:16:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=itMtx7OlYlkecsRKYM+tp7Kq7HN0FnIlgsPfyhJvXqTSKO7rttIL/qZRib+AiLaUf5gJSOcV7u55Qc6SvLOFMrDFREHOYr1EyKRaBk82+sUyY4NbGaP2cGk/SeSPbWoB5imWIakq6W5hzwWqDCQnJszFStLu95SrNa08ecSptgUEojh0nOTJU0Znu6ZLuYvuFMJrJfYpoN94/8mf6Nj6JJRTet+7v1UcY0jCTQOx1nANnSTutqRcYUM2VDfkq5DxEvAmZyN0kdR+Lo4bCQyEd/3T6uftwq9YcftbB7pDzfu+OP28Lr5xV3PsivRs4t0/6LUjrizNQAmz6Qs3KWac1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xwCysK7OmOIWRuJ/wmb4wtwBgxot0yOseHhYsdESXt0=; b=llESaCvbBEFxs/OdV41BQbidJiHZAtPcwS0Rj3CGaktw0jlSlgm1fhU3F7GOHkO4bvGT243AsX2dRJVJpOf4LeTEWJCo7ziDc6DHIVRlUWzuXhumUFZ7pa3YYaLFgOWNcQEnZsbSQ7HFvfgyX+oDQ/n0PXC3DBN3CttUr+Tt7vzMBNA+RdNJIbQVwPgtt2qWy4Jj6tAdY/MqaabX6dNBvBsAntFFPWH0jGco2dGmlCE1Ij/ZSe0gx9msH6kkyJ6+ugmNnGVHE9/D1W84eS/EbnjrhOmWdzLjZDpNFeFQE++5a07BzjydmTOv0jBtE/zPUv8WfdOfJ+xASinPupTzyQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xwCysK7OmOIWRuJ/wmb4wtwBgxot0yOseHhYsdESXt0=; b=hKkeDgFZo4Uh4LkmmfsKAuquZU6mwOneW1NXGH2UohU6uEydz2U7ZXk/UMGgxdOPWlTXmM8ctf7U6xKWwL+mzkDW7cm07dl3PPF5V6TFIM0GYDvjToaD49hg//cOJrtSaWmN941VuNIhrAu7AzWnTkZdUZjoebC64qnw3pcMplk= Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com (2603:10b6:806:11b::15) by SN6PR10MB2640.namprd10.prod.outlook.com (2603:10b6:805:49::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.22; Sun, 25 Apr 2021 01:16:09 +0000 Original-Received: from SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::2109:9725:fd4a:6494]) by SA2PR10MB4474.namprd10.prod.outlook.com ([fe80::2109:9725:fd4a:6494%6]) with mapi id 15.20.4065.021; Sun, 25 Apr 2021 01:16:09 +0000 Thread-Topic: [External] : bug#47992: 27; 28; Phase out use of `equal` in `add-hook`, `remove-hook` Thread-Index: AQHXOXCRlAKe4jS4J0a4UimtXIDqyw== In-Reply-To: Accept-Language: en-US Content-Language: en-US authentication-results: iro.umontreal.ca; dkim=none (message not signed) header.d=none;iro.umontreal.ca; dmarc=none action=none header.from=oracle.com; x-originating-ip: [73.170.83.28] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 061c87d9-277c-4997-8b9f-08d90787b535 x-ms-traffictypediagnostic: SN6PR10MB2640: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1RgQRrx+Hvjwc04p5zHqaa8Xa9tIsi/8zm+A4i7z6g9soTJTVn1J/INiGViJdPK3LUHJgeUSctCIEDIpLJ6vfglkI1SkI4KO+sMhobyklgVN+ASvV2+s+A8ITqTAqK1olX+X7RYrSrIVGWcrKhsMJReVR+bnv4S8qmBYpcpljahBN87/ZGJJpKsMqJygqS+HdNBqD/773kRO3iGNlNqf1/slLM6dSga/7P8osDp53noTPZPfLgNKjsmDw5946cbge4Wt4HjpanOa3RVAZwMT/CFc11qWbM+MBbIUyllWKCOkyYeDTQBDkIlkEen4l1yknVA8e8hQ9rzbcIFidd+WKutSirhHNpFtX61HPxvGA0V8jBADacF8pQq5ItPotC7HtumqDhWovXibM0W0Hj/7pA1Xg68QFErPDnewx+YE+XRnjVluE0jH0MKSgMD7RT/gDd1CodR9BnGYOTGlz9+8AkDJmHOAuntV4fILZjU75cH0wsz6ptaWYHSMgN+sifbR4/N0NMxGqeW71jkI6iU/nqZpHTQvEmlVsMvMf/0Ezrp9uT2YjtcGlgSc7goBXvTS4OAZhttcv1K+kNPePiXhDVVLVUfse903NT09mOPdwvWJGyBZEpfqe3zUdVz0pIqMrQuFVe64vgibWs6Q6bvyrw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR10MB4474.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(346002)(39860400002)(396003)(376002)(136003)(52536014)(8936002)(8676002)(5660300002)(33656002)(296002)(316002)(110136005)(54906003)(38100700002)(122000001)(4326008)(2906002)(71200400001)(44832011)(478600001)(9686003)(55016002)(7696005)(66946007)(64756008)(76116006)(66476007)(66556008)(6506007)(26005)(86362001)(186003)(66446008)(83380400001)(81973001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: kLDUf87vEcEFUhel+toNm4JGTESLD3B0WbPbR+TZ92WQkcCA3zGoDwuRK/vHnIMp+J7RDJbsNWQ83Gv/2Wmzx/ZPAueJQO6oSFDIjjmEJrVmejPOEarLPCLGkyoK87FpYoelAH3+aaEdVI2xFhWnIpFc3Kpn7NUI++7g6/NY1LWe2bNRtlwO962MYztKn9pdcaGdg/KG+P/mDhTZYmDPGBXWKX533yJOzSyfNiH09bXTW44V4OvY7Yiw4CiuuQ5gsEHJW0XFFQgqz8qd8Saw2RJo4mxVCJZcfH0bCbz6HHrooloRynnLPj0Yu2jLbopNmIOoihbtZmZ21globyJ0Us9fQaZzwS6yRzkM2wP/uULuQdagSKM5r1FaOaFhJnjfUJcJQxUU4/8+/a2/9/M0h6CXXMjlTmefvix9Dk8w32XaJjMUyfsF8Ekq35yybV1p8l4Zkwg0QVuRnfEnuzVlOFhjldMYdyR41lRzaNMpXLUsTwESwF4b6gpqP9BR6IqQ2YnuCFOHt7+PZtWlrbsneosCEBpKP3Irtc5JZmWwrWVX9ukoDt393SphRQ98JNgsXoDFdkT0SBKWaZ4qbP8xcm9+0EaoxRck4juUsCZy4QpCgHbNdCG7Ur1cwz8Tq0QaJxXdpnu1fjsHNRC29Ukzb95bEtD7bjcI6bD2FUn3Zzdv4IDu9RttPOMEyhqUbOsD4H4Z9a1Bd3qhYNf/esw5FrZV9Tr0QlclQEZ4VHxspeGrGoVikfNDUs7krIwA sFka7vTo3zWPjTM5Oq8rxCTaDPOv/2dG6nEYNfkFsQWiudFqoWOMMm2h0gi0gz3as7TOviV5TbUlr0ek/yxwPqx1rm6j3Ehyo/ x-ms-exchange-transport-forked: True X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA2PR10MB4474.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 061c87d9-277c-4997-8b9f-08d90787b535 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Apr 2021 01:16:09.1143 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: BpQvg3ZiR2fmku3XTMEOgrQQbT1/hyZAxwbFDDseFU2ajrYoKwcN76BPkIxRpS1wnMF0htwFrXEeeJMrSftfvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR10MB2640 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9964 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 bulkscore=0 mlxscore=0 malwarescore=0 phishscore=0 adultscore=0 mlxlogscore=836 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104250006 X-Proofpoint-ORIG-GUID: DJX1OjUA2XbzsAg85kBET2P5XBx_xNKq X-Proofpoint-GUID: DJX1OjUA2XbzsAg85kBET2P5XBx_xNKq X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9964 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 suspectscore=0 spamscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2104250006 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:204835 Archived-At: > >>> Perhaps `equal' can be fixed to do something better with closures? > >> > >> There's no magic: `equal` has to check the structural equality, so it > >> has to recurse through the whole structure, including all the > >> closed-over variables to which it refers. > > > > Well, structural equality on closures is an arbitrary choice. One > > could simply refuse to compare closures structurally and treat > > them as opaque objects. >=20 > Currently we could do that for byte-compiled closures > but not for interpreted ones. Also what I hinted at (I didn't know whether we might in fact already do that), and why I spoke specifically of supporting also interpreted code. Emacs users often use Lisp as part of their interaction with the editor, so: interpreted code. Lose that and we lose Emacs. IMHO. And what would we be losing it for? Some performance gain for closures used as hooks? If you're convinced of the need or desirability of such a change... To be clear, by lose that I mean the ease of using Lisp interactively, which today still means interpretation. You'll say that you'll replace all interpretation by on-the-fly jitty compilation... That's also why I wrote that hint about possibly doing something better with closures wrt `equal'. We're not there - not by a long shot. And doing what's been proposed here doesn't get us there.=20 > Equality on functions is fundamentally undecidable and it's nigh-on > impossible to provide a sane and well-defined "approximation" of it > either (at least not without significantly restricting the set of > optimizations that the compiler can be allowed to perform). 100% agreement. And there's no need for it, for Emacs. > The upside is that this fundamental problem was the motivation for the > development of type classes in Haskell which are a great feature > (nowadays used in most proof assistants and in several other > programming languages such as Scala and Rust). Meanwhile, back at the Emacs ranch, for actual users... (Not that a Haskell Emacs wouldn't be an interesting project. Please go for it.)