At 03:23 PM 3/26/2001 -0500, Adam Turoff wrote:
>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.
The only issue there is whether memoization is appropriate. It could be
argued that it isn't (it certainly isn't with perl 5) though I for one
wouldn't mind being able to more aggressively assume that data was
semi-constant... (Imagine returning tied data from a function loaded in via
do(). Imagine the optimizer. Imagine Dan's brain popping out of his head
and hiding behind the bookcase)
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk