Re: Change ($one, $two)= behavior for optimization? (was Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar))

2000-09-04 Thread Peter Scott
At 11:48 AM 9/3/00 +1100, Damian Conway wrote: Ever consider then having ($a, $b, $c) = FH; or @a[4,1,5] = FH; only read three lines? I think this is a superb idea, and look forward to someone's RFC'ing it. I like it too. Anyone working on the RFC? I

Re: Change ($one, $two)= behavior for optimization? (was Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar))

2000-09-04 Thread Nathan Torkington
Peter Scott writes: ($a, $b, $c) = FH; or @a[4,1,5] = FH; only read three lines? I think this is a superb idea, and look forward to someone's RFC'ing it. Should be part of the want() context. Permit operations to discover (as does split) how many elements

Re: Change ($one, $two)= behavior for optimization? (was Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar))

2000-09-04 Thread Peter Scott
At 10:52 AM 9/4/00 -0600, Nathan Torkington wrote: Peter Scott writes: ($a, $b, $c) = FH; or @a[4,1,5] = FH; only read three lines? I think this is a superb idea, and look forward to someone's RFC'ing it. Should be part of the want() context. It is. I

Re: Change ($one, $two)= behavior for optimization? (was Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar))

2000-09-04 Thread Jeremy Howard
Nathan Wiger wrote: Tom Christiansen wrote: Ever consider then having ($a, $b, $c) = FH; or @a[4,1,5] = FH; only read three lines? I mean, how many if any builtins would it make sense to make aware of this, and do something "different"? Personally, I think this would

Re: Change ($one, $two)= behavior for optimization? (was Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar))

2000-09-04 Thread Damian Conway
Should be part of the want() context. It is. I interpreted Damian's remark to mean that it would be good if readline() took advantage of it, and that should be RFC'ed. That's indeed precisely what I meant. In fact, all list-returning built-ins ought to be optimized this way.

Re: Change ($one, $two)= behavior for optimization? (was Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar))

2000-09-02 Thread Nathan Wiger
Tom Christiansen wrote: Well, it only does this if it's not something like 'split', then! Yes, it does "do it" with split. split is defined to do what it does, how it does it. *This* is the kind of senseless harping that annoys me, Nathan. H. I'm apparently not making myself clear

Re: Change ($one, $two)= behavior for optimization? (was Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar))

2000-09-02 Thread Tom Hughes
In message [EMAIL PROTECTED] Nathan Wiger [EMAIL PROTECTED] wrote: For example, in Perl you have for a long time been able to do this: ($one, $two) = grep /$pat/, @data; However, what currently happens is grep goes to completion, then discards possibly huge amounts of data

Re: Change ($one, $two)= behavior for optimization? (was Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar))

2000-09-02 Thread Damian Conway
Here is my suggestion: What if other functions were able to backtrace context and determine how many arguments to return just like split can? I have an RFC on that: RFC 21: Replace Cwantarray with a generic Cwant function Cwant takes a list of strings that describe

Re: Change ($one, $two)= behavior for optimization? (was Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar))

2000-09-02 Thread Damian Conway
Ever consider then having ($a, $b, $c) = FH; or @a[4,1,5] = FH; only read three lines? I think this is a superb idea, and look forward to someone's RFC'ing it. Damian

Re: Change ($one, $two)= behavior for optimization? (was Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar))

2000-09-01 Thread Nathan Wiger
Let me shift gears and instead ask whether anyone thinks this: $y = ($first, $second) = grep /$pat/, @data; Returning "5" has any value? If you're going to do this, it seems like you'd want the number that were really returned (since scalar grep will give you the total number found

Re: Change ($one, $two)= behavior for optimization? (was Re: RFC 175 (v1) Add Clist keyword to force list context (like Cscalar))

2000-09-01 Thread Tom Christiansen
Well, it only does this if it's not something like 'split', then! Yes, it does "do it" with split. split is defined to do what it does, how it does it. *This* is the kind of senseless harping that annoys me, Nathan. So it's not 100% consistent. Wrong: It's 100% consistent with the