Created
May 5, 2016 23:57
-
-
Save doublec/61f80997f784039e17174023a5022865 to your computer and use it in GitHub Desktop.
Calling a lambda functoin recursively in Pony
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actor Main | |
new create(env:Env) => | |
let fac = lambda (n:U32): U32 => if n == 0 then 1 else n * this(n - 1) end end | |
env.out.print("fac 5 = " + fac(5).string()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment