Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on All Programming Philosophies Are About State. Parent comment
SSA, no recursion, no reduce ;)
def factorial(X: int) -> int: encode = lambda n: ((lambda N: lambda g: lambda f: lambda x: x if N == 0 else f(g(N-1)(g)(f)(x)))(n) (lambda N: lambda g: lambda f: lambda x: x if N == 0 else f(g(N-1)(g)(f)(x)))) decode = lambda f: f(lambda x: x + 1)(0) fact = (lambda f: lambda n: cond(vaut0(n))(lambda _: un)(lambda _: mult(n)(f(f)(pred(n)))))( (lambda f: lambda n: cond(vaut0(n))(lambda _: un)(lambda _: mult(n)(f(f)(pred(n))))))(n) return decode(fact(encode(X)))
Full form for those interested : https://termbin.com/cd3q
This snippet was clearly functional .
SSA, no recursion, no reduce ;)
Of course, I'm joking, as the Y combinator is clearly visible here.Full form for those interested : https://termbin.com/cd3q