From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Qiantan Hong Newsgroups: gmane.emacs.devel Subject: Generic autoloading? [Was Patch: perform autoloading when docs is missing from autoload object] Date: Fri, 17 Sep 2021 16:56:34 +0000 Message-ID: <2ABC3C0C-CBF7-44D9-B498-B548F820B125@mit.edu> References: 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="25799"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Arthur Miller , "emacs-devel@gnu.org" To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 17 18:58:17 2021 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 1mRHBp-0006TC-R8 for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Sep 2021 18:58:17 +0200 Original-Received: from localhost ([::1]:41748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRHBo-0003ar-Ma for ged-emacs-devel@m.gmane-mx.org; Fri, 17 Sep 2021 12:58:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRHAu-0001UV-U7 for emacs-devel@gnu.org; Fri, 17 Sep 2021 12:57:21 -0400 Original-Received: from outgoing-exchange-1.mit.edu ([18.9.28.15]:53738) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRHAs-0007Mn-2d for emacs-devel@gnu.org; Fri, 17 Sep 2021 12:57:20 -0400 Original-Received: from w92exedge3.exchange.mit.edu (W92EXEDGE3.EXCHANGE.MIT.EDU [18.7.73.15]) by outgoing-exchange-1.mit.edu (8.14.7/8.12.4) with ESMTP id 18HGvDI3015621; Fri, 17 Sep 2021 12:57:16 -0400 Original-Received: from w92expo16.exchange.mit.edu (18.7.74.70) by w92exedge3.exchange.mit.edu (18.7.73.15) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 17 Sep 2021 12:56:49 -0400 Original-Received: from oc11expo16.exchange.mit.edu (18.9.4.47) by w92expo16.exchange.mit.edu (18.7.74.70) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Fri, 17 Sep 2021 12:56:34 -0400 Original-Received: from oc11expo16.exchange.mit.edu ([18.9.4.47]) by oc11expo16.exchange.mit.edu ([18.9.4.47]) with mapi id 15.00.1497.023; Fri, 17 Sep 2021 12:56:34 -0400 Thread-Topic: Generic autoloading? [Was Patch: perform autoloading when docs is missing from autoload object] Thread-Index: AQHXq+T4YiNukoskhE2H5HsnFFO5jg== In-Reply-To: Accept-Language: en-US Content-Language: en-US x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [128.12.11.144] Content-ID: Received-SPF: pass client-ip=18.9.28.15; envelope-from=qhong@mit.edu; helo=outgoing-exchange-1.mit.edu X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:274898 Archived-At: Just in case, is it possible to provide a generic autoload mechanism that run arbitrary function to load the missing function,=20 instead of hardcoded to basically a REQUIRE? This can be very helpful for my object capabilities implementation because it can be used to support importing object graph more lazily. (Instead of needing to traverse a full reference closure of a function, we can stop at arbitrary function and resume traversal only when that function is called). Currently I can fake it with a closure that knows where it is and replace itself once called. But it feels like reimplementing the same thing twice. (I think current autoload can also be implemented in pure Elisp in this way, but we already have autoload object, so why not generalize it = a bit). Best, Qiantan