emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Naming FCRs


From: Jim Porter
Subject: Re: Naming FCRs
Date: Tue, 28 Dec 2021 10:35:07 -0800

(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?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]