On Sat, Sep 19, 2009 at 6:48 AM, Carl Mäsak <cma...@gmail.com> wrote: > David (>), Moritz (>>), Aaron (>>>): >>>> 2,3 constructs a list. 2..3 also constructs a list, unless it's in a >>>> given/when condition in which case it's just a range. >>> >>> No. 2..3 is always a range. It's just list context that turns it into a >>> list. >>> >>>> That seems confusing. >> >> It sounds like the split personality of Ranges strikes again. I still think >> it makes more sense to have one Series-only type and one Range-only type, >> rather than one Series type and one Range-plus-Series type. > > If for no other reason than to contribute a contrasting viewpoint, I'm > not sure I see the problem in this case. A range is an object in Perl > 6, in a much more palpable way than in Perl 5. This might be what > causes the mental mismatch for Perl5-ers. > > As far as I can see, the range object already is of your proposed > Range-plus-Series type, and when I apply list context to the range, I > get your proposed Series-only type (which happens to be an ordinary > list, but still).
The one thing that worries me about this is how :by fits into it all. rakudo: given 1.5 { when 1..2 { say 'between one and two' }; say 'not'; }; p6eval rakudo 4b141a: OUTPUT«between one and two» feels like it makes sense to me. But rakudo: given 1.5 { when Range.new(from => 1, to => 2, by => 1/3) { say 'between one and two' }; say 'not'; }; p6eval rakudo 4b141a: OUTPUT«between one and two» makes me very leery. I know :by isn't actually implemented yet, but what should it do here when it is? -- Solomon Foster: colo...@gmail.com HarmonyWare, Inc: http://www.harmonyware.com