multi fib ($ where 0|1) {1} multi fib ($i) { fib($i-1) + fib($i-2) }
According to the relevant design docs I ought to be able to omit the `$ where ` bit but that bit of sugaring has not yet been implemented in Rakudo.
»ö« . o O ( "the celebrity tell-all of the Perl-6 cult?" )
In reply to Re^5: rough approximation to pattern matching using local (Multi Subs)
by raiph
in thread rough approximation to pattern matching using local
by gregory-nisbet
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |