# 打印列表 [1, 2, 3, 4] 的长度
print(
(lambda f: f(f))
(lambda f:
(lambda lenth:
lambda lst:
0 if lst == [] else 1 + lenth(lst[1:]))
(lambda x: (f(f))(x)))
([1, 2, 3, 4]))
# Out: 4
参考资料: The Little Scheme
# 打印列表 [1, 2, 3, 4] 的长度
print(
(lambda f: f(f))
(lambda f:
(lambda lenth:
lambda lst:
0 if lst == [] else 1 + lenth(lst[1:]))
(lambda x: (f(f))(x)))
([1, 2, 3, 4]))
# Out: 4
参考资料: The Little Scheme