Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
If I created $*OUT as an object, then yes, I would prefer to call the method on it.

That's fair enough. You can of course do it that way. However some people do like the indirect syntax. I'm not such a person myself, but I can understand those who do like it. It can make slotting objects into a more procedural style of coding easier.

I don't want to have to remember that I need a colon after it an object reference just because the Perl6 parser needs it to disambiguate between a multimethod and a multisub.

Isn't it the difference between a subroutine call and a method call, rather than multimethod vs. multisub - the colon is just an indicator that the method (multi or otherwise) is being called in an indirect style?

I admit I have only skimmed A12 so I may be getting the wrong end of the stick.

Personally, I always felt that print() (and friends) has a difficult syntax to work with, given that it is different than every other other CORE function.

But it's not just print. Is close $fh a subroutine call or a method call? I think that forcing the dot syntax for method invocation everywhere would result in something unperlish.

Frankly, if that syntax is important enough to you, you could just do something like (in Perl5 syntax):

Yes you could, but why should you if it can be well supported by the core? The indirect calling style has many problems in Perl 5, but in Perl 6 we have Class objects and an explicit colon syntax to disambiguate the nasty cases - so I don't really see the problem?


In reply to Re^3: Get rid of the Indirect Syntax, please! by adrianh
in thread On the Improvement of Exegesis 12 by Anonymous Monk

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 rifling through the Monastery: (6)
As of 2024-04-23 09:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found