Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 273 Bytes

97_y_combinator.md

File metadata and controls

22 lines (17 loc) · 273 Bytes
>>> def Y(f):
...     def a(x):
...         return f(x(x))
...     
...     return a(a)

>>> def my_fun(x):
...     return -1.0 / x

my_fun(4) -0.25

Y(my_fun) Traceback (most recent call last): ... RuntimeError: maximum recursion depth exceeded