More Array Behaviors (Take 2)

2003-01-28 Thread Michael Lazzaro
OK, here are the answers so far -- or more accurately, strawman interpretations of those answers that should be objected to if they're wrong. 1) Edge cases in array indexing: my int @a = (1,2,3); @a[0] # 1 @a[1] # 2 @a[2] # 3 @a[3] # undef

Re: More Array Behaviors (Take 2)

2003-01-28 Thread Dan Sugalski
At 10:13 AM -0800 1/28/03, Michael Lazzaro wrote: OK, here are the answers so far -- or more accurately, strawman interpretations of those answers that should be objected to if they're wrong. I think some of this is incorrect which, because Damian thinks otherwise, will need some hashing out

Re: More Array Behaviors (Take 2)

2003-01-28 Thread Michael Lazzaro
On Tuesday, January 28, 2003, at 10:20 AM, Dan Sugalski wrote: At 10:13 AM -0800 1/28/03, Michael Lazzaro wrote: 1) Edge cases in array indexing: my int @a = (1,2,3); @a[3] # undef (warning: index out-of-bounds) Or a real 0, since you said @a can only return integers.

Re: More Array Behaviors (Take 2)

2003-01-28 Thread John Williams
On Tue, 28 Jan 2003, Dan Sugalski wrote: At 10:13 AM -0800 1/28/03, Michael Lazzaro wrote: @a[ Inf ] # undef (warning: can't use Inf as array index) I'd throw an exception here. @a[-4]# undef (warning: index out-of-bounds) @a[-Inf] # undef (warning:

Re: More Array Behaviors (Take 2)

2003-01-28 Thread Damian Conway
Michael Lazzaro wrote: OK, here are the answers so far -- or more accurately, strawman interpretations of those answers that should be objected to if they're wrong. 1) Edge cases in array indexing: my int @a = (1,2,3); @a[0] # 1 @a[1] # 2 @a[2] # 3