Skip to content

Commit 61896ca

Browse files
committed
update a few stray letrec examples
1 parent 5487efc commit 61896ca

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

doc/dialects/lispython.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def factorial(n):
4646
assert factorial(4) == 24
4747
factorial(5000) # no crash
4848

49-
t = letrec[((evenp, lambda x: (x == 0) or oddp(x - 1)),
50-
(oddp, lambda x: (x != 0) and evenp(x - 1))) in
49+
t = letrec[[evenp << (lambda x: (x == 0) or oddp(x - 1)),
50+
oddp << (lambda x: (x != 0) and evenp(x - 1))] in
5151
evenp(10000)]
5252
assert t is True
5353

unpythonic/dialects/tests/test_lispython.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ def f(k, acc):
101101
#
102102
# With `mcpyrate` this shouldn't matter, but we're keeping the example.
103103
with testset("autonamed letrec lambdas, multiple-expression let body"):
104-
t = letrec[((evenp, lambda x: (x == 0) or oddp(x - 1)), # noqa: F821
105-
(oddp, lambda x:(x != 0) and evenp(x - 1))) in # noqa: F821
104+
t = letrec[[evenp << (lambda x: (x == 0) or oddp(x - 1)), # noqa: F821
105+
oddp << (lambda x:(x != 0) and evenp(x - 1))] in # noqa: F821
106106
[local[x << evenp(100)], # noqa: F821, multi-expression let body is a do[] environment
107107
(x, evenp.__name__, oddp.__name__)]] # noqa: F821
108108
test[t == (True, "evenp", "oddp")]

0 commit comments

Comments
 (0)