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

Re^5: Understanding the Schwartzian transform.

by Laurent_R (Canon)
on Jul 22, 2013 at 15:54 UTC ( [id://1045685]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Understanding the Schwartzian transform.
in thread Understanding the Schwartzian transform.

Sorry, but except that I did not detail what goes into the code blocks (as this has been detailed well enough the the previous posts), I do not see any difference between your version of the Schwartzian Transform and mine.

Replies are listed 'Best First'.
Re^6: Understanding the Schwartzian transform.
by choroba (Cardinal) on Jul 22, 2013 at 16:05 UTC
    Because in GRT, you just change the data so they can be sorted lexicographically as strings, while in Schwartzian transform, you create a structure. You can simplify both to map {} sort {} map {} list (in GRT, sort block can be omitted), their difference can be seen only if you give more details.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

      Agreed, but: 1. the OP did not ask for the difference between Guttman-Rosler and Schwartzian transforms, but only if MJD's code he had was a canonical ST. And this example is a canonical ST, which it what I said. The fact that I somewhat summarized for brevity (and because it could be other code for a different probklem and still be a ST) does not invalidate my point and certainly does not make the OP's initial code nor the summary that I made a GR transform. As you said, a GR transform would have omitted the sort block. I reallyt think that the OP question was whether the standard ST consists of the map-sort-map construct.

        Agreed ... OPs question

        Yes, the original is canonical ST, there is no disputing that (you answered correctly)

        But your shortening (somewhat summarized for brevity ) to  @out = map {} sort {} map {} @in is definitely not the canonical Schwartzian Transform

        because the essence of ST is not the pipeline, pipeline is regular usage of map/grep, its even present in GRT. The essence of ST, the trick of it, the rule of it , [ is the caching ] .

        If you replace the essence with  {BLOCK} its unrecognizable, might as well call it  transform / sort / transform -- nothing Schwartzian about it :) and not very descriptive, unlike decorate-sort-undecorate which describes both ST and GRT

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1045685]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2024-03-19 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found