On Mon, Mar 26, 2001 at 10:50:09AM -0500, Uri Guttman wrote: > >>>>> "SC" == Simon Cozens <[EMAIL PROTECTED]> writes: > SC> Why can't Perl automagically do a Schwartzian when it sees a > SC> comparison with complicated operators or functions on each side of > SC> it? That is, @s = sort { f($a) <=> f($b) } @t would Do The Right > SC> Thing. > > because that would require the PSI::ESP module which isn't working > yet. Not at all. Simon's example looks like a simple case of memoization. The cache only needs to be maintained for the duration of the sort, and it alleviates the need for complicated map{} operations. > how would perl intuit exactly the relationship between the records > and the keys extraction and comparison? The key extraction is done with f(), and the comparison is done with cached values of f(). Z.
- Re: Schwartzian Transform Tad McClellan
- Re: Schwartzian Transform John Porter
- Re: Schwartzian Transform Simon Cozens
- Re: Schwartzian Transform indigo
- Re: Schwartzian Transform Russ Allbery
- Re: Schwartzian Transform Uri Guttman
- Re: Schwartzian Transform Russ Allbery
- Re: Schwartzian Transform Uri Guttman
- Re: Schwartzian Transform Russ Allbery
- Re: Schwartzian Transform Nick Ing-Simmons
- Re: Schwartzian Transform Adam Turoff
- Re: Schwartzian Transform Dan Sugalski
- Re: Schwartzian Transform James Mastros
- Re: Schwartzian Transform Dan Sugalski
- Re: Schwartzian Transform John Porter
- Re: Schwartzian Transform Dan Sugalski
- Re: Schwartzian Transform James Mastros
- Re: Schwartzian Transform Dan Sugalski
- Re: Schwartzian Transform Peter Buckingham
- Re: Schwartzian Transform Dan Sugalski
- Re: Schwartzian Transform Peter Buckingham