Sort is lazy?!? (as in Haskell)

2002-03-03 Thread Peter Makholm
Trying to do completly stupid stuff with perl I tried to do the following: xyzzy% perl -le 'sort {print a:$a\tb:$b; $a cmp $b} qw(5 2 3 4 1)' xyzzy% Somehow the print statement isn't evaled. Playing a little more around I tried the following: xyzzy% perl -le '(sort {print a:$a\tb:$b; $a cmp

Re: Sort is lazy?!? (as in Haskell)

2002-03-03 Thread Peter Makholm
Peter Makholm [EMAIL PROTECTED] writes: I have yet to find a usefull purpose for having side effects in the sort statement but that is not the point here. Having sort changing algorithm when the length of the array exceeds 7 probally makes it a lot harder to exploit. Now I really want to

Re: Sort is lazy?!? (as in Haskell)

2002-03-03 Thread Michael G Schwern
On Sun, Mar 03, 2002 at 03:27:57PM +0100, Peter Makholm wrote: Trying to do completly stupid stuff with perl I tried to do the following: xyzzy% perl -le 'sort {print a:$a\tb:$b; $a cmp $b} qw(5 2 3 4 1)' xyzzy% $ perl -wle 'sort {print a:$a\tb:$b; $a cmp $b} qw(5 2 3 4 1)' Useless use of

Re: Sort is lazy?!? (as in Haskell)

2002-03-03 Thread Michael G Schwern
PS With a truly lazy sort you'd be able to do... ($first) = sort { $a wibble $b } @big_list; # in O(n) time. -- Michael G. Schwern [EMAIL PROTECTED]http://www.pobox.com/~schwern/ Perl Quality Assurance [EMAIL PROTECTED] Kwalitee Is Job One Some like elmers glue but it

Re: TPR(0,1) scores

2002-03-03 Thread Andrew . Savige
On Sat, 2 Mar 2002, Yanick wrote: Ah, the things one is ready to do to keep his mind away from a big fat score of 65 that doesn't seem to want to shrink of a single stroke Stephen Turner schreef op 3 marchi 2002: If only there were a POSIX::secretnumber() I checked that too; we

Re: TPR(0,1) scores

2002-03-03 Thread Keith C. Ivey
[EMAIL PROTECTED] wrote: Unfortunately, I have been reduced to hanging on to Keith and Stephen like a leech. :-( Looks like the leech has detached itself. You've shot up to second place, 5 strokes ahead of me. I don't seem to be getting the epiphany yet, so I guess I've got a few days of

Re: TPR(0,1) scores

2002-03-03 Thread Andrew . Savige
[EMAIL PROTECTED] wrote: Unfortunately, I have been reduced to hanging on to Keith and Stephen like a leech. :-( Keith C. Ivey schreef op 4 Marchi 2002: Looks like the leech has detached itself. You've shot up to second place, 5 strokes ahead of me. I don't seem to be getting the