http://qs1969.pair.com?node_id=506229


in reply to Old sorting paper holds the key to unlocking the secrets of the Schwartzian Transform

The transform is question is a basic technique and hardly deserves to be credited to the man with the name *sigh*.

I wish there was a better name for it, something along the lines of keying records for the purpose of sorting.. it certainly is not some amazing special technique that could be one-day patented!

  • Comment on Re: Old sorting paper holds the key to unlocking the secrets of the Schwartzian Transform

Replies are listed 'Best First'.
Re^2: Old sorting paper holds the key to unlocking the secrets of the Schwartzian Transform
by gaal (Parson) on Nov 07, 2005 at 05:44 UTC
    I believe it is called "decorate-sort-undecorate" in the Python world (where it is being considered for entry into the core sort builtin).
      DSU (for short) is in list.sort() and the sorted() builtin as of 2.4 - eg: "mylist.sort(key=len)" will sort by length.

      Last I checked, Perl6 was also supposed to support decoupling the key comparison from the extraction of keys from list elements. In Perl5, key extraction is conflated with comparison in a single sub, which means the key extraction code for $a is often copypasted for $b. Given that key extraction is decoupled from comparison, you’d also often need simple forms of comparison only, so there were ideas being bandied about for a more declarative comparison syntax for those forms.

      Now the motivation for all this was to reduce duplication and make the trivial cases simpler, but such syntax would neatly allow the runtime to do ST sorting internally, without the programmer having to do anything explicit about it.

      I don’t know what came of it, but I’d be surprised if it hasn’t made it into the current form of Perl6 in some shape. I should go look into this.

      Makeshifts last the longest.

Re^2: Old sorting paper holds the key to unlocking the secrets of the Schwartzian Transform
by aufflick (Deacon) on Nov 07, 2005 at 05:48 UTC
    Now that what it is is clearer to me, the amazing thing about it is actually Perl. The fact that you can chain the three stages together like that without the rigidity of traditional list based languages is really nice.

    On a related note, I know that you can chain the word "and" 5 times in a row in a gramatically correct English sentance - what's the most number of "is"s that people can chain together? I can do 3.

    Yes I know it's not really related, but I can never write a sentance with "is is" without then wondering :)

      5 times for and?

      Would the sentence, "I put dashes between Fish and And and And and Chips in my Fish And Chips sign" be clearer if I put commas between Fish and and, and and and And, and And and and, and and and Chips?

      As for is, it is kind of cheating, but, "Is is is?" is "Is is is?"

      However the real record holder is buffalo. Buffalo can mean the city, the animal, or "to bewilder and confuse". Between those three meanings you can always find a correct gramatical parse for the word Buffalo, repeated any number of times. For instance, Buffalo buffalo buffalo buffalo buffalo Buffalo buffalo! means "Buffalo buffalo bewilder and confuse buffalo that bewilder and confuse Buffalo buffalo."

        but, "Is is is?" is "Is is is?"

        Didn't Clinton base his whole defense on that? :-)


        I'm not really a human, but I play one on earth. flash japh
        There is a very nice discussion of this in The Language Instinct. My office mates and I sometimes mutter this at each other when the discussion has gotten overly abstract :)

        Another one I like from there is "Bulldogs bulldogs bulldogs fight fight fight!" The yale cheer (and also a grammatical sentence). Theoretically this can be embedded as many times as you want and still be grammatical, but the human grammar processor is typically incapable of more than three levels of embedding.

      Howdy!

      James, while John had had "had" had had "had had". "Had had" had had a better effect on the teacher.

      That's seven hads in a sentence, with eleven across a sentence break.

      yours,
      Michael
        The original I heard was "John where Jim had had had had had had had."

        Then, there was the proposal that a second John and Jim had been given this sentence to punctuate, and the second John had given up in disgust:

        John, where Jim had had, "John, where Jim had had 'had', had had 'had had'", had had "John where Jim had had had had had had had".
        It's probably time to let sleeping hads lie at this point.
      How can you gramatically chain the word "and" more than once in a valid English sentence? I know you can do "that that" but "and and" escapes me..

        Update:The contents of this post are a work of fiction, for amusement purposes only.

        Any correspondence between concepts and constructs it contains and any real literary entities of similar name or form are purely coincidental, as the author hasn't got a clue!


        That that is one of the words that can be grammatically correctly abutted within a sentence is no surprise, as just demonstrated.

        And and can also be so abutted.

        In these usages of that that, and and and, the first repetition is referring directly to the second.

        But that that that and and and, are not the end to these linguistic anomalies.

        He said the matter was closed, and that that should be an end to it.

        In this usage, the first that is not referring to the second that.

        Once the sentence itself starts both using this phenomena and referring to it, the 'that that', that that 'that that' is referring to can itself become self-referential, with the consequence that that, that that, that that, that that refers to, tends to become obscured.

        However, is it a matter of speculation whether is, is another word that can be so abutted?

        Apparently not :)


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
A reply falls below the community's threshold of quality. You may see it by logging in.