Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: "Indirect" object syntax?

by muba (Priest)
on Nov 24, 2015 at 00:55 UTC ( [id://1148460]=note: print w/replies, xml ) Need Help??


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

Apero, although I do thank you for chiming in and demonstrating why using the thing called "indirect object syntax" isn't a good idea, my question wasn't about that. I am (almost) fully aware of the drawbacks of the syntax. My question was more about whether —from a linguistical point of view— the name "indirect object" was the most accurate.

Again, I'd like to use the kick $ball; # i.e. $ball->kick example, where $ball obviously is a direct object and not an indirect object.

But Athanasius nicely quoted the friendly manual and made me realize that, although Perl does resemble English, Perl simply isn't English.

Replies are listed 'Best First'.
Re^3: "Indirect" object syntax?
by Apero (Scribe) on Nov 24, 2015 at 01:35 UTC

    My question was more about whether —from a linguistical point of view— the name "indirect object" was the most accurate.

    I figured, although backing up my alternative naming convention (which I'll hardly claim as the "best", or even better than indirect) with reasoning might help another reader realize what's going on behind the scenes when making Perl English readable; that's not always a useful metric as you noted.

    The discussion is interesting since many of Perl's constructs can be read in an English-like way (even promoted as options at times, as in use English. On the other hand, I frequently find lines, especially long unbroken ones, hard to read.

    Some more musing (or rambling, depending on your opinion) on subject/verb ordering in Perl follows..

    I didn't mean to take away from your linguistic pondering too much (although hopefully another reader can benefit from that.) In any event, thanks for the discussion!

      Ah, well then. I must've misunderstood the intention behind your post. My bad.

      do('many', 'things', 'now') if ( $ready and $set and $prepared );

      could be made even more English-like (Englishy? Englishesque?) if we ignore for a moment that do is a built-in function ;)

      do 'many', 'things', 'now' if $ready and $set and $prepared;

      And even you prefer the if-this-then-than notation over the that-if-this syntax, there are neat ways:

      $ready and $set and $prepared and do 'many', 'things', 'now'; $ready and $set and $prepared? do 'many', 'things', 'now' :() ;

      What's funny about that last one is that it's... well... rather Englishy indeed:

      (Are you) ready and set and prepared? Do many things now <shocked emoticon>;

      Coincidentally (or maybe not, as it's neatly linked to on my homenode), I've asked about the various ways to write conditionals before.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-18 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found