Michele Dondi wrote:
On Thu, 2 Sep 2004, Larry Wall wrote:


To declare a multidimensional array, you add a shape parameter:

   my num @nums is shape(3);   # one dimension, @nums[0..2]
   my int @ints is shape(4;2); # two dimensions, @ints[0..3; 0..1]


Just a random thought, and probably a minor point: I know that there already so many keywords, but if not already taken, could C<has> be introduced as a synonim for C<is> to be freely used where it would "fit" better? Especially in constructs like

my num @data is Stuff has shape(4;2);

C<has> is already used to give classes attributes...

class Thing {
  has @.fingers;
  has $.mysteriousness;
}

I wouldn't be surprised if it does run-time attribute addition to objects as well, but I can't recall seeing that anywhere and haven't got time to look right now. Even if it doesn't, it would, I think, be a mistake to overload it in this way.



Reply via email to