H.Merijn Brand writes: : On Wed, 2 May 2001 08:05:29 -0700 (PDT), Larry Wall <[EMAIL PROTECTED]> wrote: : > Michael G Schwern writes: : > : (grep {...} @stuff)[0] will work, but its inelegant. : > : > It's inelegant only because the slice doesn't know how to tell the : > iterator it only needs one value. If it did know, you'd call it : > elegant. :-) : : IIRC, that optimization is not even considered for reasons of many people Whoever it is that is not considering it does not include me. :-) : wanting the side effects of grep/map finishing over all elements (which could : of course be from a tied array or database connection) If we do that kind of optimization, then we would certainly provide some kind of easy syntax to defeat it. But I'd say that, by and large, it's precisely when you're dealing with a slow database connection that you could use all the clever optimization you can get, because the unintended work gets magnified along with the intended, and the stakes are higher. Larry
- Re: Please make "last" work in "grep"... Graham Barr
- Re: Please make "last" work in "grep"... Uri Guttman
- Re: Please make "last" work in "grep"... Graham Barr
- Re: Please make "last" work in "grep... David L. Nicol
- Re: Please make "last" work in "grep"... H . Merijn Brand
- Re: Please make "last" work in "grep"... Michael G Schwern
- Re: Please make "last" work in "grep... John Porter
- Re: Please make "last" work in "grep"... Bart Lateur
- Re: Please make "last" work in "grep... Larry Wall
- Re: Please make "last" work in "grep... Damian Conway
- Re: Please make "last" work in "grep"... Larry Wall
- Re: Please make "last" work in "grep"... Graham Barr
- Re: Please make "last" work in "grep"... Jarkko Hietaniemi
- Re: Please make "last" work in "grep... Bart Lateur
- Re: Please make "last" work in "grep"... Dan Sugalski
- Re: Please make "last" work in "grep"... Larry Wall
- Re: Please make "last" work in "grep... Dan Sugalski
- Re: Please make "last" work in "grep"... Damian Conway
- Re: Please make "last" work in "grep... Dan Sugalski
- Re: Please make "last" work in "grep... Larry Wall
- Re: Please make "last" work in "grep"... Ariel Scolnicov