Some comments on the linguist contribution.

While 'invocant' and 'invoker' may be 'functionally equivalent', it seems to me that in fact 'invocant' is correct.

'Invocant' indicates a thing that invokes, and does not imply necessarily an intent. By analogy, we have 'defendant' in normal usage, someone for whom a defense is being made.

Since everything in Raku is an object, then being an object means that there are methods which can be called on the object. When a method is called on an object, as in '$some-string.IO.lines()', the method 'lines' is given the object '$some-string.IO' on which it has been called. It is the invocant.

Some form of intent would be needed for 'invoker'. By analogy, 'defender' is used when an defenser is being made on behalf of someone else - the defendant.  So, in Raku, suppose we have some 'sub outputting' as in

sub ouputting ( $string, &action )

and &action = IO::lines();

Then it would seem to me that if '&action($string)' inside 'outputting' would make 'outputting' the invoker, and '$string' the invocant for 'lines()'.

Regarding the difference between 'employer/employee' 'payer/payee': the relationship is one where the action is carried out by one entity - the subject - directly with respect to another - usually called the object. One person hires - the employer, who is doing it with an intent, and the other is being hired.

The relationship between 'defender/defendant' indicates the direction of the action is not from the defender to the defendant, but to something else, usually the court.

Naturally, there are bound to be exceptions, but the subtle distinctions between the suffixes '-er', '-ant', and '-ee', are worth preserving. Raku was specified by a linguist, and it is very much apparent.

On 30/08/2020 22:08, Stuckwisch, Matthew wrote:
So I guess I got included on this as the resident language professor :-) (although I probably should subscribe to p6 users at some point) I didn't see the whole thread in the e-mail I got copied in on, so apologizes if I repeat much.

I'll spare everyone all the linguistic details, but suffice it to say, invocant and invoker are functionally equivalent.  The former is a nominalized adjective, and the latter a noun proper.  They mean "the one that invokes (calls)".   We can use either, but I'd recommend we be very consistent.  Invocant seems to be the preferred, so let's use it exclusively. On the other side, we have invoked and invokee, which in English share a similar distinction (although nominalizing the former often sounds odd, and adjectifying the latter would probably be read as missing a genitive 's).

Summed up, we should avoid using invocant to refer to a method that's being called.  Generally, just calling it a "method" is sufficient, but if need be, I'd go with "the invoked method".  We probably can write documentation to avoid the formalisms altogether, though, by saying something to the effect of

> Opens the file [represented by the [calling] object] and returns its lines.

That's fairly simple and clear.  In an article about signatures, however, I think using the term is absolutely appropriate, and warrants defining it parenthetically inline as "the object that calls/invokes the associated method".  I get that using the word "call" muddies the water (the formal distinction that tchrist was getting at is that a sub has no invocant except perhaps a calling context, ie the "caller" — which a method also has), but we already did that by having methods use CALL-ME instead of INVOKE-ME :-) *

MSS


* Of course, the reason was to harmonize calls of all code, and the fluid nature of allowing transitive methods be used as subs and viceversa (method $invocant: @args and $invocant.&sub) means that one term had to rule them all.

------------------------------------------------------------------------
*From:* William Michels <w...@caa.columbia.edu <mailto:w...@caa.columbia.edu>>
*Sent:* Sunday, August 30, 2020 2:44:55 PM
*To:* yary <not....@gmail.com <mailto:not....@gmail.com>>
*Cc:* perl6-users <perl6-users@perl.org <mailto:perl6-users@perl.org>>; ToddAndMargo <toddandma...@zoho.com <mailto:toddandma...@zoho.com>>; Brad Gilbert <b2gi...@gmail.com <mailto:b2gi...@gmail.com>>
*Subject:* Re: lines :$nl-in question
Do you agree with that definition, Yary? Brad? Here it is:

"Invocant"

"Caller, the one who calls or invokes. The invocant of a method would
be the object on which that method is being called, or, in some cases,
the class itself. Invocant is used instead of caller because the
latter refers to the scope."

https://docs.raku.org/language/glossary#Invocant

At first blush, the definition at
https://docs.raku.org/language/glossary#Invocant contradicts the
definition given to us by Brad. English speaker will typically use the
following word pairs to denote 1. an actor and 2. a recipient of some
action. So we have the following:

Payer vs. Payee
Lessor vs. Lessee
Employer vs. Employee

So going with the typical English usage above, the pattern would
continue with "Caller" vs "Callee" and "Invoker" vs
"Invokee/Invocant".  Therefore my humble reading of the definition
given by Brad, as well as a post authored by a certain TChrist on
StackExchange [1], suggests to me that "Invocant" is a synonym for
"Callee" (or the possibly-imaginary word "Invokee"). One can look at
the definition of "Invoker" online provided by Oracle with regards to
the Java programming language [2], to further distinguish "Invoker" vs
"Invocant".

HTH, Bill.

W. Michels, Ph.D.

[1] https://english.stackexchange.com/a/59070
[2] https://docs.oracle.com/javase/8/docs/api/index.html?javax/xml/ws/spi/Invoker.html


On Sun, Aug 30, 2020 at 9:54 AM yary <not....@gmail.com <mailto:not....@gmail.com>> wrote:
>
> The Raku glossary has a definition
> https://docs.raku.org/language/glossary#Invocant
>
> suggestion, link to that where the term appears.
>
> -y
>
>
> On Sun, Aug 30, 2020 at 9:16 AM William Michels via perl6-users <perl6-users@perl.org <mailto:perl6-users@perl.org>> wrote:
>>
>> Inline:
>>
>> On Sun, Aug 30, 2020 at 12:49 AM Brad Gilbert <b2gi...@gmail.com <mailto:b2gi...@gmail.com>> wrote:
>> >
>> > Invocant is in the dictionary though.
>> >
>> > In fact it is from Latin.
>> >
>> > Origin & history:
>> >   Derived from in- + vocō ("I call").
>> >
>> > Verb:
>> >   I invoke
>> >   I call (by name)
>> >
>> > In fact that is pretty close to the same meaning as it is used in the Raku docs.
>> >
>> > It is the object that we are calling (aka invoking) a method on.
>>
>> Maybe we can meet Todd halfway?
>>
>> >
>> > On Sat, Aug 29, 2020 at 6:39 PM ToddAndMargo via perl6-users <perl6-users@perl.org <mailto:perl6-users@perl.org>> wrote:
>> >>
>> >> On 2020-08-28 23:51, Tobias Boege wrote:
>> >> > On Fri, 28 Aug 2020, ToddAndMargo via perl6-users wrote:
>> >> >> https://docs.raku.org/type/IO::Path#method_lines <https://docs.raku.org/type/IO::Path#method_lines>
>> >> >>
>> >> >>     (IO::Path) method lines
>> >> >>
>> >> >>     Defined as:
>> >> >>
>> >> >>     method lines(IO::Path:D: :$chomp = True, :$enc = 'utf8', :$nl-in = ["\x0A", "\r\n"], |c --> Seq:D)
>> >> >>
>> >> >>     Opens the invocant and returns its lines.
>>
>>
>> "Opens the invocant (i.e. the object being called) and returns its lines."
>>
>> [Add text in parentheses above only once per method, when the word
>> 'invocant' is first used].
>>
>> Comments?
>>
>> Best Regards, Bill.

Reply via email to