On Tue, Mar 20, 2001 at 11:15:51PM -0500, John Porter wrote:
> So you think
>
> @s =
> map { $_->[0] }
> sort { $a->[1] <=> $b->[1] }
> map { [ $_, /num:(\d+)/ ] }
> @t;
>
> would be more clearly written as
>
> @s = schwartzian(
> {
> second_map => sub { $_->[0] },
> the_sort => sub { $a->[1] <=> $b->[1] },
> first_map => sub { [ $_, /num:(\d+)/ ] },
> },
> @t );
Why can't Perl automagically do a Schwartzian when it sees a comparison with
complicated operators or functions on each side of it?
That is, @s = sort { f($a) <=> f($b) } @t would Do The Right Thing.
--
What happens if a big asteroid hits the Earth? Judging from realistic
simulations involving a sledge hammer and a common laboratory frog, we
can assume it will be pretty bad. - Dave Barry
- Re: Schwartzian Transform Brent Dax
- Re: Schwartzian Transform Randal L. Schwartz
- Re: Schwartzian Transform Dan Brian
- Re: Schwartzian Transform Randal L. Schwartz
- Re: Schwartzian Transform Uri Guttman
- Re: Schwartzian Transform Dan Brian
- RE: Schwartzian Transform Brent Dax
- Re: Schwartzian Transform John Porter
- Re: Schwartzian Transform James Mastros
- Re: Schwartzian Transform Mark Koopman
- Re: Schwartzian Transform Simon Cozens
- Re: Schwartzian Transform Uri Guttman
- Re: Schwartzian Transform Peter Scott
- Re: Schwartzian Transform Uri Guttman
- Re: Schwartzian Transform Adam Turoff
- Re: Schwartzian Transform Simon Cozens
- Re: Schwartzian Transform Nick Ing-Simmons
- Re: Schwartzian Transform Adam Turoff
- Re: Schwartzian Transform Dan Sugalski
- Re: Schwartzian Transform James Mastros
- Re: Schwartzian Transform John Porter
