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#54802: OClosure: Make `interactive-form` a generic function Date: Fri, 15 Apr 2022 12:08:04 -0400 Message-ID: References: <87r161to4p.fsf@yahoo.com> <87v8vbrx4w.fsf@yahoo.com> <878rs7rus8.fsf@yahoo.com> <87fsmfq8dl.fsf@yahoo.com> 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="3380"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 54802@debbugs.gnu.org To: Po Lu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Apr 15 18:09:10 2022 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 1nfOVR-0000ZD-Mn for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Apr 2022 18:09:09 +0200 Original-Received: from localhost ([::1]:41312 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nfOVQ-0004E8-LC for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Apr 2022 12:09:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nfOVK-0004Dx-42 for bug-gnu-emacs@gnu.org; Fri, 15 Apr 2022 12:09:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38031) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nfOVJ-0003N0-Rh for bug-gnu-emacs@gnu.org; Fri, 15 Apr 2022 12:09:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nfOVJ-0002Gq-LO for bug-gnu-emacs@gnu.org; Fri, 15 Apr 2022 12:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Apr 2022 16:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54802 X-GNU-PR-Package: emacs Original-Received: via spool by 54802-submit@debbugs.gnu.org id=B54802.16500389008672 (code B ref 54802); Fri, 15 Apr 2022 16:09:01 +0000 Original-Received: (at 54802) by debbugs.gnu.org; 15 Apr 2022 16:08:20 +0000 Original-Received: from localhost ([127.0.0.1]:60161 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nfOUb-0002Fk-Ks for submit@debbugs.gnu.org; Fri, 15 Apr 2022 12:08:20 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43455) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nfOUX-0002FQ-Ct for 54802@debbugs.gnu.org; Fri, 15 Apr 2022 12:08:17 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id B6F93805E4; Fri, 15 Apr 2022 12:08:07 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 2FC0C802BB; Fri, 15 Apr 2022 12:08:06 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1650038886; bh=qbcC9sZ0FiufIMB55s1G/9v9SeQ8iT/TamzM6+Coi9I=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=WoMFMtXd80UjJV/XQoJ8anvppsloDA45IK6LktvzHWsM0G6HDtEvwVRpmnIu+0rNX nAeH20rYaBo0wcqu4g9PlGAQz2Ej22QsOAIwcZfxgTCECOi3tFZSPcUDSvJjav0KJt 3RFXGYYlEESkwY6/TLYQHZpQgcE0+HKzff1D71ufzBf9cBFYLjakuG+2sR74+eXaSw cbyM6T+tgjDA/PozZfh0STEujC3e7Zk9ZzIq2M8u7UaBwB5kByEvkoWrAUz52oBNu3 o53QaJiIawxmJ6QKUepj6jF8PIarlK4SYgqKolJ24Hh/WqCXAMNENAOCSXbUMzYCfw Pl2uxPU5ihPEw== Original-Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0804D120600; Fri, 15 Apr 2022 12:08:05 -0400 (EDT) In-Reply-To: <87fsmfq8dl.fsf@yahoo.com> (Po Lu's message of "Fri, 15 Apr 2022 12:27:02 +0800") 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:229938 Archived-At: Po Lu [2022-04-15 12:27:02] wrote: > Stefan Monnier writes: >> I can do a sort of `oclosurep` from C already. But that doesn't >> guarantee that the OClosure has an interactive form, so in the case we >> match `oclosurep` I'd still need to call another function from the ELisp >> world (that's the one I called `generic-interactive-form` since it would >> most naturally be a generic function) > Well, as long as its possible, I think we should do that. It's definitely possible. The reason I resist doing that is that the resulting API is ugly (you basically have two "identical" functions with the only justification for the difference is that one is implemented in C and the other is a generic function) and the only existing reason for this ugliness is this one loop of yours whose behavior is brittle anyway, whose first execution is 100x times slower (so the remaining 2x slowdown when the loop is fast can't be that important), and whose subsequent fast executions could trivially be made faster by caching the result of the first call. So, I'm waiting to hear what others have to say about this choice. Eli and Lars, do you prefer the faster-but-uglier API or the cleaner-but-slower API for `interactive-form`? Stefan