Larry Wall wrote:
my @array of Int;
is really short for
my @array is Array of Int;
How does 'is' relate to 'does'? I mean is the above @array
ready for operation? Whilst
my @array does Array of Int;
still needs a compatible object to be put into @array?
Like so:
class Blubber does Array of Int {...}
@array = Blubber.new; # or with := ?
BTW, does
my Int $value;
expand to
my $value is Ref of Int;
or the often mentioned
my $value is Scalar of Int;
and what is the difference between the two, if any?
What exactly does the 'is shape' syntax expand to?
I guess it is some parser gymnastics that somehow
puts more aguments into the Array class closure.
Which brings me to the question: how does this parameter
list look like?.
class Array[ ::ContentType, List of List $shape ] {...}
And yet another one: when is the resulting expansion of
such a class template or whatever it is performed? Or does
the implementor of the class have to revert to blessing in
the constructor? Wouldn't this prevent static type checking
unless the compiler would call the constructor in some
hypotheticality mode to produce type information.
Regards,
--
TSa (Thomas Sandlaß)