1
0
mirror of https://github.com/arendst/Tasmota.git synced 2025-04-30 01:37:16 +00:00
2021-12-14 15:10:03 +01:00

9 lines
236 B
Plaintext

# simple lambda example
print((/a b c-> a * b + c)(2, 3, 4))
# Y-Combinator and factorial functions
Y = /f-> (/x-> f(/n-> x(x)(n)))(/x-> f(/n-> x(x)(n)))
F = /f-> /x-> x ? f(x - 1) * x : 1
fact = Y(F)
print('fact(10) == ' .. fact(10))