Signatures (I)
- At a basic level, not terribly impressive
- Elegantly fills a major hole in Perl 5.
-
sub fact($n) { [*] 1..$n; }
- Allows type checking:
-
sub fact(Int $n)
- and fancier checking:
-
sub fact(Int $n where { $n > 0 })
« first
< prev
(11 / 41)
next >
last »