Personally, I prefer a python, or matlab implementation:

array1 = array2[ start : stop ].

Of course, In perl we have the .. operator.  This method has just always
seemed intuitive to me.  Granted an explicit function call (or gasp, another
reg-ex like call), aids the newbies eyes.  The trick in perl is, of course,
that we are marred with demangling variables.  For what-ever reason,
$array[ $a .. $b ] is interpreted in scalar context, and so we had to resort
to the @array[ list ] nature.  This actually works out well for @hash[
list ], since $hash[ 'a', 'b' ] becomes that odd-ball multi-dimentional
hash.  I'd rather do away with that multi hash thing ( I have no idea what
it's value is ), and make convert all array / hash accesses into slices
(with optimizations for single indexes ).

I think this would resolve your concerns about ambiguity.

-Michael

Reply via email to