unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Emacs developers <emacs-devel@gnu.org>
Subject: Re: Naming FCRs
Date: Tue, 28 Dec 2021 10:35:07 -0800	[thread overview]
Message-ID: <CANh=_JGT5KjQd8L0NSUvdVoc85dF7X0uZSfn51gFRwniFEX8Gw@mail.gmail.com> (raw)
In-Reply-To: <jwvczlheu3o.fsf-monnier+emacs@gnu.org>

(Re-adding the mailing list, since it got removed.)

On Mon, Dec 27, 2021 at 11:21 AM Stefan Monnier
<monnier@iro.umontreal.ca> 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?



  parent reply	other threads:[~2021-12-28 18:35 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-26 22:04 Naming FCRs Stefan Monnier
2021-12-26 22:29 ` Dmitry Gutov
2021-12-27 18:55   ` Stefan Monnier
2021-12-28  0:31     ` Dmitry Gutov
2021-12-27  0:46 ` Bob Rogers
2021-12-28 13:11   ` xenodasein--- via Emacs development discussions.
2021-12-29 16:33   ` Lars Ingebrigtsen
2022-01-04 20:31     ` Stefan Monnier
2022-01-11  3:25       ` Filipp Gunbin
2022-01-11  3:44         ` Stefan Monnier
2022-01-12  4:56           ` Richard Stallman
2022-01-12 15:10             ` Stefan Monnier
2021-12-27  1:35 ` Po Lu
2021-12-27  2:33   ` Qiantan Hong
2021-12-27  4:12     ` Stefan Monnier
2021-12-27  7:33       ` tomas
2021-12-29  1:09         ` Phil Sainty
2021-12-28  4:19   ` Richard Stallman
2021-12-28  5:43     ` Po Lu
2021-12-28 11:24       ` Andreas Schwab
2021-12-28 17:28         ` Stefan Monnier
2021-12-30 10:35           ` Andreas Schwab
2021-12-27  4:15 ` Richard Stallman
2021-12-27  5:46   ` LdBeth
2021-12-27 19:48     ` Stefan Monnier
2021-12-27  4:38 ` Jim Porter
     [not found]   ` <jwvczlheu3o.fsf-monnier+emacs@gnu.org>
2021-12-28 18:35     ` Jim Porter [this message]
2021-12-29  1:02       ` Phil Sainty
2021-12-29 16:19       ` Richard Stallman
2021-12-29 16:43         ` [External] : " Drew Adams
2021-12-29 19:01         ` Stefan Monnier
2021-12-30  2:54           ` LdBeth
2021-12-30  4:28           ` Richard Stallman
2021-12-30  8:43             ` tomas
2021-12-30 10:15               ` Tomas Hlavaty
2021-12-30 14:00                 ` Stefan Monnier
2021-12-30 18:46                   ` Tomas Hlavaty
2021-12-31  4:26                   ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CANh=_JGT5KjQd8L0NSUvdVoc85dF7X0uZSfn51gFRwniFEX8Gw@mail.gmail.com' \
    --to=jporterbugs@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).