in reply to Re^8: sort +*, @array
in thread sort +*, @array
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.
- 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?
- 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?
- Did you see how { ~days(.day-of-week) }, { ~months(.month) } directly corresponds to substr(scalar localtime($_),0,3), substr(scalar localtime($_),+5,3)?
- Did you understand how having two key extractor closures leads to an equivalent of the || construct in your P5 comparator closure?
- Did you understand that ~days(*.day-of-week) is shorthand for { ~days(.day-of-week) }?
Thank you for helping me straighten this out.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^10: sort +*, @array
by BrowserUk (Patriarch) on Dec 15, 2013 at 00:04 UTC | |
by raiph (Deacon) on Dec 15, 2013 at 04:47 UTC | |
by BrowserUk (Patriarch) on Dec 15, 2013 at 08:07 UTC |
In Section
Meditations