Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: "Indirect" object syntax?

by jdporter (Canon)
on Nov 23, 2015 at 15:14 UTC ( #1148399=note: print w/replies, xml ) Need Help??


in reply to Re: "Indirect" object syntax?
in thread "Indirect" object syntax?

In Perl, print STDOUT "$foo\n"; can be understood as "verb indirect-object object", where STDOUT is the recipient of the print action, and "$foo" is the object being printed.

Except that that's wrong. "$foo" is not an object -- direct or otherwise.

Properly,

method $object @args;
is "indirect object syntax", in Perl lingo, and
$object->method( @args );
is "direct object syntax". Same object; only the syntax is different. And English grammar terminology doesn't really apply well.

And the fact that @larry decided in their infinite (ly mistaken) "wisdom" to coin a completely unnecessary and superfluous alternative term for object, namely "invocant", manifests their misunderstanding of what an object is, in object-oriented programming. For "invocant" means, quite simply, "caller". But in print $fh or $fh->print, $fh is not the caller, it is the receiver. It is the object, not the subject, of the action.

I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2019-11-11 22:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (63 votes). Check out past polls.

    Notices?