On 04/03/2012 11:16 PM, Patrick R. Michaud wrote:
> On Tue, Apr 03, 2012 at 09:22:11PM +0200, Moritz Lenz wrote:
>> On 04/03/2012 06:44 PM, Patrick R. Michaud via RT wrote:
>> > On Tue Apr 03 01:24:47 2012, moritz wrote:
>> >> 10:23 < timotimo> r: say "foo"[1..*]
>> >> 10:23 <+p6eval> rakudo 8ead1e: OUTPUT«Method 'gimme' not found for 
>> >> invocant of
>> >>                  class 'Str'␤  in method postcircumfix:<[ ]> at
>> >>                  src/gen/CORE.setting:1147␤  in block <anon> at
>> >>                  /tmp/1ZiRf7yMZW:1␤␤»
>> > 
>> > 
>> > Now fixed in 1bbf9eb, needs spectests to close ticket.
>> 
>> Now we have "foo"[2] fail(), but "foo"[2..*] returns the empty Parcel.
>> Is that the intended behavior?
> 
> Since "foo" acts like a list of one element,

My point is that it currently doesn't really.

Compare:

say "foo".list.[2]  # Nil

with

say "foo".[2] # Index out of range. Is: 2, should be in 0..0

which is why I'm complaining about inconsistencies.

> I suspect that .[2..*]
> should act the same as when used on an array of one element, which
> results in an empty Parcel:
> 
>     my @array = "foo";
>     say @array[2..*].elems;   # 0
>     say "foo"[2..*].elems;   # 0
> 
> If that's wrong, we need better spectests to get the correct
> behavior.

No, first we need agreement on what the right behavior is. Thinking
about spectests before we're positive on the right behavior is taking
things out of order.

Reply via email to