- or download this
package TypedArray;
use Moose;
...
push @{$self->elems}, @_;
}
... more methods and operator overloads ...
- or download this
TypedArray->new(type => Int, elems => [4, 8, -7])
- or download this
TypedArray->new(Int, 4, 8, -7)
- or download this
typedArray Int, 4, 8, -7
- or download this
subtype TypedArrayOf
as Parameterizable['TypedArray', 'Moose::Meta::TypeConstraint'
+],
...
my ($typed_array, $type) = @_;
return "expected TypedArrayOf[$type], found TypedArrayOf[@
+{[$typed_array->type]}]"
};
- or download this
TypedArray[Int]