Last active
July 11, 2016 02:57
-
-
Save katlogic/7aa734f815500c05226575fd090d4c3f to your computer and use it in GitHub Desktop.
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
| -- print((function(f) return (function(x) return f(function(...) return x(x)(...) end) end)(function(x) return f(function(...) return x(x)(...) end) end) end)(function(f) return function(n) if n==0 then return 1 else return n*f(n-1) end end end)(10)) | |
| local function fix(f) | |
| return (function(x) | |
| return f(function(...) | |
| return x(x)(...) | |
| end) | |
| end)(function(x) | |
| return f(function(...) | |
| return x(x)(...) | |
| end) | |
| end) | |
| end | |
| local function fact(self,n) if n==0 then return 1 else return n*self(n-1) end end | |
| print(fix(function(f) return function(n) return fact(f, n) end end)(5)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment