3 ms·
While Perl5 is not a typed language, it does have addon type checking modules such as Type::Tiny that play really nice with addon (ahem) object systems like Moo
by petre 10y ago
While Perl5 is not a typed language, it does have addon type checking modules such as Type::Tiny that play really nice with addon (ahem) object systems like Moo. It doesn't look pretty but it works. Perl6 fixes that and also makes it pretty as you can declare variables as typed and the interpreter will happily complain when you do something like:
my Int $a = '3';
Type check failed in assignment to $a; expected Int but got
Str ("3") in block <unit> at <unknown file> line 1
It's a bit mode detailed here:
http://blogs.perl.org/users/zoffix_znet/2016/04/perl-6-types-made-for-humans.html http://blogs.perl.org/users/zoffix_znet/2016/04/perl-6-types...
Doesn't Python have any type checking system available s a module?
- LeonidasXIV 10y agoAdd-on type systems have the disadvantage of being add-on, that means that the vast majority of code will not have any type information associated therefore reasoning what code accepts or returns is just as it is without the added type system. I was thinking of using Typed Clojure, but the advantages would unfortunately not translate to the libraries that I use.