http://www.perlmonks.org?node_id=697461


in reply to Re^2: What will scientific computing in Perl 6 look like?
in thread What will scientific computing in Perl 6 look like?

Complex numbers are special cased, in that they are explicitly specced. While numerics aren't a weak spot in Perl 6, they aren't exactly the most powerful area either (Larry keeps telling us on #perl6 that he doesn't do higher mathematics ;-)

But it's quite easy to define your own data types and the associated operations:

# suppose you inherit from List to implement your vector: class MyVector is List { sub infix:<+>(MyVector @self, MyVector @other) is export { return @self »+« @other; } # adding a scalar: sub infix:<+>(MyVector @self, Num $other) is export { return @self »+ $other } }

No more hassle of overloading literal constants in the source, since multi method dispatch takes care of it all.