Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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 could say do many things now if you are ready and set and prepared ...

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

... but I often prefer how the code syntax looks if I reverse the English above and instead state, "if you are ready and set and prepared, do many things now."

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

Indirect object method invocation is almost Yoda-like, in the way the green Jedi might say "go_to_the_lake, Sally does"

go_to_the_lake $Sally;
.. but as above, I think I prefer "Sally, go to the lake", this time both in terms of English appeal and the code implications:

$Sally->go_to_the_lake();

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!


In reply to Re^3: "Indirect" object syntax? by Apero
in thread "Indirect" object syntax? by muba

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-03-28 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found