| CPAN Ratings Variable-Strongly-Typed reviews | |
| Home | Search | About | Bitcard Account | Login |
RSS | Module Info | Add a review of Variable-Strongly-Typed
Unlike Attribute::Types, you can assign types to subroutines.
But the name is inappropriate: it checks the type of the return value of the subroutine, rather than wanted value. "Strongly typed" implies compile-time checks and a degree of type safety, so it would disallow things like
$len = @list;
I tried to show a nice counterexample,
sub foo :TYPE('ARRAY') {
return (1..10);
}
$bar = foo();
Well, this doesn't work, but not for the reason you would expect. Type 'ARRAY' is an array reference, not an array. It's documented, but it's not intuitive.
It would be nice to differentiate between arrays/lists and references to them.
Robert Rothenberg - 2006-05-04T04:41:43
|
Perl.org sites
: bugs
| dev
| history
| jobs
| learn
| lists
| use
Site Information and Contacts |
|