aboutsummaryrefslogtreecommitdiff
path: root/lib.rkt
diff options
context:
space:
mode:
authorJJ2024-06-17 00:22:38 +0000
committerJJ2024-06-17 00:22:38 +0000
commit745f45355bd65ddeebcef8d353e8c66fcabde516 (patch)
tree93d26ba5776e8f26d3df8a6751fcfcbbf48e6468 /lib.rkt
parent3a4704b8fce33f3d86897ff857d59462b93a6755 (diff)
implement the simply-typed lambda calculus with general recursion (fix)
Diffstat (limited to 'lib.rkt')
-rw-r--r--lib.rkt3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib.rkt b/lib.rkt
index 9b65256..b35ea21 100644
--- a/lib.rkt
+++ b/lib.rkt
@@ -86,6 +86,9 @@
[`(let ,id (: ,t) ,e ,in)
(desugar `((λ ,id (: ,t) ,in) ,e))]
+ [`(letrec ,x (: ,t) ,e ,in)
+ (desugar `(let ,x (: ,t) (fix (λ ,x (: ,t) ,e)) ,in))]
+
[`(λ ,x (: ,t) ,e) `(λ ,x (: ,t) ,(desugar e))]
[`(,e1 ,e2 ,e3) `(,(desugar e1) ,(desugar e2) ,(desugar e3))]
[`(,e1 ,e2) `(,(desugar e1) ,(desugar e2))]