I suppose I've always thought of it as a variation on the ST: precalculating the sort keys using map, sorting based upon those keys, and finally, another map to extract the actual data again. I never realized that the ST specified explicitly creating anonymous arrays.
And I agree with you, but I'm not willing to fight for that belief being universal
(that the GRT is really just a specialization of the ST). I've got other issues to fight.
In case you were curious. {grin}
Another way to look at it is that I made "map-sort-map" popular in the Perl
community, by issuing one specific use of it which some have come to know
as the ST. The GRT gang came up with another use that is harder to generalize,
but can produce better results for a subrange of problems. I don't believe that
the GRT can be sufficiently generalized in any practical sense to cover all problems,
hence knowing both manifest map-sort-map strategies (and inventing others)
is probably the best meta-strategy.
-- Randal L. Schwartz, Perl hacker
-
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.
|