diff --git a/bin/comp.ml b/bin/comp.ml index 322f03c..faf82bc 100644 --- a/bin/comp.ml +++ b/bin/comp.ml @@ -20,7 +20,7 @@ and dbg_print_start = function let def = Parser.parse_str "(define (f) (let ((x 5)) - (if t (+ x 1)))) + (if t (set! x (+ x 1))))) (define (f) (define (g y) (* y 2)) (or (g 5) (g 6))) diff --git a/lib/compiler/syntactic_ast.ml b/lib/compiler/syntactic_ast.ml index bdec99b..07162a2 100644 --- a/lib/compiler/syntactic_ast.ml +++ b/lib/compiler/syntactic_ast.ml @@ -204,6 +204,7 @@ and builtin_if cons = exp (If (test, then_branch, else_branch)) and builtin_set cons = + let* cons = sexpr_cdr cons in let* sym = sexpr_car cons in let* sym = (match sym with | LSymbol s -> Ok s