From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Naming FCRs Date: Sun, 26 Dec 2021 23:12:48 -0500 Message-ID: References: <87bl123k41.fsf@yahoo.com> <591A9AE3-3B90-4C15-BBC5-E2710EF89075@stanford.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22645"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: "emacs-devel@gnu.org" To: Qiantan Hong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 27 05:13:53 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 1n1hOS-0005oL-Vw for ged-emacs-devel@m.gmane-mx.org; Mon, 27 Dec 2021 05:13:53 +0100 Original-Received: from localhost ([::1]:43148 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n1hOR-0006hW-NC for ged-emacs-devel@m.gmane-mx.org; Sun, 26 Dec 2021 23:13:51 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1hNl-00061Q-2B for emacs-devel@gnu.org; Sun, 26 Dec 2021 23:13:09 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:55402) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n1hNi-0002bN-3V for emacs-devel@gnu.org; Sun, 26 Dec 2021 23:13:07 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 1A963442959; Sun, 26 Dec 2021 23:13:04 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C256C442957; Sun, 26 Dec 2021 23:13:02 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1640578382; bh=qkDE8EEus9gFEVmDJTB0cT8uNcFFJVm1BE8y2VLXd9A=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Zi+Aj0scxu/Xt/BYNigKLBVUDkgXmL0C5HAXOEpm14DxJDW5h0ix/nJzhauuAUugs g39hdEalMiCBSijAauXezsq5fAi+u3SSrMgBfNaHDVMKODVGHqijzNw59O4+KuIMe6 +lDXQW6JcSmfoBCPVJjrjhPwkycELJHRf+S7GQM/cnB/RMJJItR885U/sGPbygcd7+ IrlhNTc6/w4awJtaNWQMgwcwj557GmG0oLy+Z2o38arSC7KDO1eDHrBoMLSCRiXGwQ IYq/BVVk9dv0z1uUY2PWSTzzdI3KlvdwoRtnIAkda00qMYv/k474jABcbozKZwkTal IgQx/JCwSMQJw== Original-Received: from ceviche (unknown [216.154.30.173]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8207C1201A4; Sun, 26 Dec 2021 23:13:02 -0500 (EST) In-Reply-To: <591A9AE3-3B90-4C15-BBC5-E2710EF89075@stanford.edu> (Qiantan Hong's message of "Mon, 27 Dec 2021 02:33:08 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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.29 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:283377 Archived-At: Po Lu [2021-12-27 09:35:42] wrote: > How about "functions-with-record"? Which we'd abbreviate to FWR pronounced "fower", as in "Wow! this concept is really fowerful!" ? There's something do it, tho the implementation doesn't really add any record to the functions, it just uses the existing representation of a function. So maybe a more fitting name would be "functions as records", abbreviated "far", as in "Wow! This name is really far-fetched!" ? Qiantan Hong [2021-12-27 02:33:08] wrote: > I believe MIT Scheme has what exactly you described, and is called > =E2=80=9Capply-hook=E2=80=9D, because it=E2=80=99s like hacking apply so = it knows how to call > an ordinary datum like a function. These apply hooks are more like CL's funcallable objects, which we can already simulate in ELisp with a symbol. Basically `set-apply-hook-procedure!` is `fset`. In contrast, FCRs are designed to be just normal closures, except they come with a type and you get direct access from outside the function to some of the vars that are closed over (and just as with closures, you don't get to change the code associated with an FCR object). By design, calling an FCR should not incur *any* overhead compared to calling the same thing defined as a "normal" function. Bob Rogers [2021-12-26 19:46:39] wrote: > Without looking at the code, this sounds more like a closure to me. Right, I rarely distinguish "closures" from "functions", but indeed, these are more closures in that their "heap object" characteristics are made more visible. > Since the slots are accessible outside the function, that would make it > a "transparent closure" . . . but I like the internal dissonance of > "open closure" better. ;-} I like that, thank you. Stefan