From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jim Porter Newsgroups: gmane.emacs.devel Subject: Re: Naming FCRs Date: Tue, 28 Dec 2021 10:35:07 -0800 Message-ID: References: <01d516b3-86ca-fdf3-73f0-49b2e6930499@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2376"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 28 19:36:20 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 1n2HKe-0000R8-40 for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Dec 2021 19:36:20 +0100 Original-Received: from localhost ([::1]:47110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2HKc-0003uH-Oi for ged-emacs-devel@m.gmane-mx.org; Tue, 28 Dec 2021 13:36:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2HJh-000357-Ld for emacs-devel@gnu.org; Tue, 28 Dec 2021 13:35:21 -0500 Original-Received: from [2607:f8b0:4864:20::a35] (port=37808 helo=mail-vk1-xa35.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n2HJf-00040W-Sv for emacs-devel@gnu.org; Tue, 28 Dec 2021 13:35:21 -0500 Original-Received: by mail-vk1-xa35.google.com with SMTP id g65so10799865vkf.4 for ; Tue, 28 Dec 2021 10:35:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ahsWFfkCJp10Z38qtCId9/iN1beOXyZsWbWASzhOTpQ=; b=nau3q6Z4ccGE32iMkUsfbLDhX0hSgV0YcaKRdbmT5ccztTImA9ny+wqz0tUEdvUe81 h/InSwFuBj4TeJvRekyPwqdZZ057rNnrbUJ6eXe8HgS5C9yy2kofEpz75W17OkExMVX9 RnUUX0jUd20sB6HD1OnnpCcfP+u/RSHtxl+o1K2TKTNJ5PMxFjyJzGZSMfxNUq0M86rG nLqC0jPDimdK/L2x3v9cTsEK0ySGnN4DaGkHhBCX4ZvamXbyxMZxN7t3Wki4HzxIxcNZ NgsgGipRbLBEHXBcKwVx810RmEXkP+ZsTJlbSmg6eVL/gaYDp4Xjpa8+gcLHbAwVoWoo JPNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ahsWFfkCJp10Z38qtCId9/iN1beOXyZsWbWASzhOTpQ=; b=hflEfimfHQbT3izBGf4mLJiKiRzNMMH1VOHf+YBnvjlTXZErfejHroubtly1vf3elg RfuZhswhBu5pTrvQwZAbOhYliF7HLGzhaLXjYk+bQDe2duQUinY9iEKwsEXw2PZSQuGw UYbXSFHNRoiJipyFbNN6vkcT2QiBijJaHLsiiFmAVV5Qk1WN5ZwHcG3IB1GAUSST+9zS 2a1r4o1eVpAjESjHPg5XnlJrZPnzxGJCFn0OvDurA9ZSK1cpHZWwUT+8JMKwpPIt6fEl u0fVm4pHOpLam9rv5WVJsGSX78LAsMfrxYDgO0kMPfaH2Xgq9PQPn6Rv9nvjkVoHBxlK 7aEg== X-Gm-Message-State: AOAM530W35Ww6u5AMXfnr7lpIDCXbvUCqi7aW6ZvdVXXwbveniBsdD68 CWSqCArPMbDD4L7z1NNPFDdy1ltVEWr+hdOK5o0= X-Google-Smtp-Source: ABdhPJykjD4YxpKFN4Xa1tQ3oeXSAr/GjCNRaUQtsphc0x4KpisFdqiLiJ2qiWxzGDYjJ8Uaq95He0AY4WwWRH6mLXk= X-Received: by 2002:a1f:e1c7:: with SMTP id y190mr7331634vkg.31.1640716518525; Tue, 28 Dec 2021 10:35:18 -0800 (PST) In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::a35 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::a35; envelope-from=jporterbugs@gmail.com; helo=mail-vk1-xa35.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:283520 Archived-At: (Re-adding the mailing list, since it got removed.) On Mon, Dec 27, 2021 at 11:21 AM Stefan Monnier wrote: > > >> - Monomaniac objects (since they're a bit like OO-style objects but > >> limited to have only exactly one method). > > Perhaps "function object"? > > That suffers from the same problem as FCR in that it suggests that the > primary characteristic is "an object" rather than "a function". For me at least, the benefit of "function object" is that it's already the established name for something like this in the C++ world[1]. When I think of a function object, I think (in C++) of a class/struct that holds some data but exists primarily to be used as a function (typically by passing it to a metafunction). However, for non-C++ programmers, I can see how it would give the wrong connotation. > > On the other hand, the "associated state" is fuzzy enough that > > a reader might think "function object" includes closures, since those > > contain state too. > > Plain old `lambda` is a strict subset of `fcr-lambda`, so yes, the usual > closures are just the most basic kinds of FCRs (FCRs introduce a type > hierarchy just as is done for defstructs and defclass and plain old > closures can be compared to the "object" class that sits at the root). Ok, in that case it sounds to me like the ideal name would give the reader the sense that this is a generalization of a closure. One possibility would be a "bound function", since you're binding some data to it. Then lambdas could be described as "lexically-bound functions" which, if I'm understanding FCRs correctly, makes the relationship between the two reasonably clear. As for a fun name derived from that, maybe "bofun"? It sounds a bit like bosun, someone "responsible for the components of a ship's hull", and you could probably make a vague analogy to FCRs being responsible for their associated records. Bofun also apparently means "fauna" in the Yoruba language. [1] Let's ignore the term "functor", which could confuse people with a mathematics background. > >> A good name would ideally come with a fun abbreviation. > >> Feel free to send me your ideas, > > Or how about a "structured function", > > I like that one, thanks. > > > A "strunction"? Ok, maybe that last one leans a little too far towards > > "fun" and not enough towards "comprehensible"... > > Struf?