http://www.perlmonks.org?node_id=1067162


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.

  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.

Replies are listed 'Best First'.
Re^10: sort +*, @array
by BrowserUk (Patriarch) on Dec 15, 2013 at 00:04 UTC
    In the hope it helps me cause less confusion in future discussions of P6's sort built-in, please consider putting the +* snippet and ST aside for a moment and answering the following questions.

    First. There was no confusion. +* does not constitute an ST.

    Second. The "simple coding challenge" was purposed (solely) to demonstrate that +* could not be "a direct equivalent which retains the ST's generality and efficiency and substantially improves on its elegance.". Any and all discussion of some other syntax that might be able to meet that challenge is irrelevant to that purpose.

    Third. You appear to be angling to make the case that any exposure is good exposure. It's not.

    If your knowledge does not allow you to discern good claims from bad in your promotion of P6; run them by someone who has that experience before you go public.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
        You are attributing to me things I have not said.

        I attributed nothing to you. Only tried to divine what game you are playing.


        With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.