in reply to Re^4: rough approximation to pattern matching using local (Multi Subs)
in thread rough approximation to pattern matching using local

The following works in current Rakudo:

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.

  • Comment on Re^5: rough approximation to pattern matching using local (Multi Subs)
  • Download Code

Replies are listed 'Best First'.
Re^6: rough approximation to pattern matching using local (Multi Subs)
by LanX (Saint) on Jan 29, 2015 at 08:33 UTC