[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Naming FCRs
From: |
Dmitry Gutov |
Subject: |
Re: Naming FCRs |
Date: |
Tue, 28 Dec 2021 02:31:36 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 |
On 27.12.2021 21:55, Stefan Monnier wrote:
Dmitry Gutov [2021-12-27 00:29:29] wrote:
On 27.12.2021 01:04, Stefan Monnier wrote:
- Monomaniac objects (since they're a bit like OO-style objects but
limited to have only exactly one method).
A function with a value attached sounds like a "method".
Hmm... in my mind a method is more like a function attached to a (set
of) objects.
In Ruby object model anyway, a Method is a method bound to a particular
instance of a class (https://ruby-doc.org/core-2.7.1/Method.html),
whereas for methods not bound to any given value the term is "unbound
method" (https://ruby-doc.org/core-2.7.1/UnboundMethod.html).
Though I suppose one semantic distinction is that when one thinks about
methods, some "class" is present in the context, and one would usually
expect that said class should contain other methods as well (i.e. the
value that is said method is bound to, can respond to some other
methods), which matters to how one organizes code. But... that's not
necessarily true when one considers CLOS or our cl-defmethod, right?
Anyway, perhaps an unambiguous term could be "bound method".
Or if we take JavaScript, the return value of Function#bind
(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind)
is described as "bound function". But JS uses the word "function" for
both "normal" functions and methods, so I suppose "bound method" would
be less ambiguous.
On the third hand, the adjective hints at some action of "binding" which
is supposed to produce such values, which is true of both Ruby and JS
examples. If there is nothing similar going on in fcr.el, maybe such
term wouldn't be ideal.
Not too fun, though.
There's a fair bit of potential by playing with the "meth" prefix, I think.
Following the glorious tradition of "gimp", "git" and "slime".
I also looked at the branch briefly -- if it's what it sounded like then you
might be setting up a new "Callable protocol" which can allow any object to
serve as a function, not just records? Like how maps are callable
in Clojure.
Not really. It's more about adding object characteristics to functions than
adding function characteristics to objects.
All right, then.