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

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I agree that what's said can cause damage. I don't want to cause harm.

In the hope it helps me cause less confusion in future discussions of P6's sort builtin, please consider putting the +* snippet and ST aside for a moment and answering the following questions. Simple yes answers would be ideal. If your answer is no, then elaboration would be helpful.

  1. You posted something that can be seen as a simple coding challenge. That is, a solution either does or does not get the same results as your P5 code. Did you understand enough of the P6 code I posted to conclude it might get the same results?

  2. Did you catch the point that a key extractor closure (eg { ~days(.day-of-week) }), if not explicitly coupled with an arbitrary comparator closure, is automatically coupled with a generated { $^a cmp $^b } comparator closure?

  3. Did you see how { ~days(.day-of-week) }, { ~months(.month) } directly corresponds to substr(scalar localtime($_),0,3), substr(scalar localtime($_),+5,3)?

  4. Did you understand how having two key extractor closures leads to an equivalent of the || construct in your P5 comparator closure?

  5. Did you understand that ~days(*.day-of-week) is shorthand for { ~days(.day-of-week) }?

Thank you for helping me straighten this out.


In reply to Re^9: sort +*, @array by raiph
in thread sort +*, @array by raiph

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: (9)
As of 2024-04-18 07:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found