Variable-Strongly-Typed reviews

cpanratings
 

RSS | Module Info | Add a review of Variable-Strongly-Typed

Variable-Strongly-Typed (v1.1.0) ***

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 (permalink)

4 out of 4 found this review helpful. Was this review helpful to you?  Yes No