Q: index(Hello, , 999)

2005-03-16 Thread Markus Laire
What should index(Hello, , 999) return in perl6? In perl5 that returns 5, but IMHO -1 would be right result. -- Markus Laire Jam. 1:5-6

Re: Q: index(Hello, , 999)

2005-03-16 Thread Aaron Sherman
On Wed, 2005-03-16 at 10:31, Markus Laire wrote: What should index(Hello, , 999) return in perl6? In perl5 that returns 5, but IMHO -1 would be right result. Urk... exception? Seriously, if you give index a position that is off the end of the string, your options should be: a. Extend the

Re: Q: index(Hello, , 999)

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 05:31:17PM +0200, Markus Laire wrote: : What should index(Hello, , 999) return in perl6? : : In perl5 that returns 5, but IMHO -1 would be right result. Well, neither of those is the right result, since index is probably not going to be returning integers in Perl 6, but

Re: Q: index(Hello, , 999)

2005-03-16 Thread Thomas Sandlaß
Markus Laire wrote: What should index(Hello, , 999) return in perl6? Since the first thing that needs definition is how does the empty string match, it could be e.g. any(0..Hello.elems). As described in A12 string positions are much more these days than simple ints. There is a class StrPosition or

Re: Q: index(Hello, , 999)

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 06:44:47PM +0100, Thomas Sandlaß wrote: : Markus Laire wrote: : What should index(Hello, , 999) return in perl6? : : Since the first thing that needs definition is how does : the empty string match, it could be e.g. any(0..Hello.elems). If the position of the first