Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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.


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?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2021-04-22 11:45 GMT
Find Nodes?
    Voting Booth?

    No recent polls found