Skip to content

Instantly share code, notes, and snippets.

@Capital-EX
Last active December 8, 2017 20:28
Show Gist options
  • Save Capital-EX/049f6923d1f7dce86164f80cb12bac5e to your computer and use it in GitHub Desktop.
Save Capital-EX/049f6923d1f7dce86164f80cb12bac5e to your computer and use it in GitHub Desktop.
Program written in Lua made to emulate Unlamdba's S K I operators.
s =
(function(x)
return function(y)
return function(z)
return x(z)(y(z))
end
end
end)
k =
(function(x)
return function(y)
return x
end
end)
i =
(function(x)
return x
end)
p = --Do to the way . in unlambda works, I had to curry the print value.
(function(x)
return function(y)
io.write(x)
return y
end
end)
r = p"\n"
--Warning: This programming will run forever unless terminated.
s(s(s(i)(i))(k(i)))(k(p"*"))(s(s(k(s))(s(k(s(k(s))))(s(s(k(s))(s(k(s(k(r))))(s(k(s(i)))(k))))(k))))(k(s(k(s))(k))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment