Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Thoughts on new 'class' OO in upcoming perl

by Jenda (Abbot)
on Mar 17, 2023 at 20:52 UTC ( [id://11151038]=note: print w/replies, xml ) Need Help??


in reply to Re: Thoughts on new 'class' OO in upcoming perl
in thread Thoughts on new 'class' OO in upcoming perl

:common
Since version 0.62.

Marks that this method is a class-common method, instead of a regular instance method. A class-common method may be invoked on class names instead of instances. Within the method body there is a lexical $class available, rather than $self. Because it is not associated with a particular object instance, a class-common method cannot see instance fields.

Ah. You mean static. OK.

I mean ... these things are called either static methods or class methods. ":common" ... what are they even common for? Is there actually any language in which these would be called common methods?

Jenda
1984 was supposed to be a warning,
not a manual!

  • Comment on Re^2: Thoughts on new 'class' OO in upcoming perl

Replies are listed 'Best First'.
Re^3: Thoughts on new 'class' OO in upcoming perl
by jdporter (Paladin) on Mar 17, 2023 at 21:32 UTC
    Is there actually any language in which these would be called common methods?

    I agree with your point. It's just Perl being gratuitously different, yet again — like the ridiculous "invocant" vice the standard term "object" (or else "receiver"). Being gratuitously different is the main thing I hate so much about Python. Perl should be better than that. Really, stuff like this is what makes Perl look stupid. It makes it look like our best and brightest don't even know the standard terms of art. ("Invocant" is especially bad because it makes it clear that our people don't know the most basic Latin either.)

    Today's latest and greatest software contains tomorrow's zero day exploits.

      Calling the invocant an object would be misleading though, as it's often just a string class name.

      "Invocant" is being used as an English word, without necessarily the same meaning as in Latin. Consider how wildly the meaning of words like "genius" have been altered when borrowed into English. Altering the meaning is fine. I don't think many people are being confused by how the term differs from what they learnt in their Latin classes. The whole medical community is out there using words like "tonsillitis" (Latin word with a Greek suffix) and "dehydration" (Greek word with a Latin prefix and a Latin-derived suffix) and I don't think that the world perceives doctors as stupid as a result.

        "Invocant" is being used as an English word, without necessarily the same meaning as in Latin.

        I think you've missed my point, which is that the -ant suffix (for -are verbs) refers to the doer of the verb — that is, the subject, not the object. "Invocant" means "caller"; and referring to the object of the method as the sender of the message rather than its receiver is in direct and gross contradiction of all established OO language.

        If they really felt it necessary to choose a new word, they should have done better.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11151038]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2025-06-13 19:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.