Find a tacit expression that computes f y if y is greater than 1, otherwise just return y .

Solution:

f^:(1&<)

For example, the Fibonacci numbers can be computed as (-&2 +&$: -&1) ^: (1&<) 


Tacit if is also short circuit boolean operator and.



Contributed by RogerHui.

Puzzles/Tacit If (last edited 2008-12-08 10:45:34 by )