Skip to content

Commit

Permalink
Merge pull request #3 from X-FRI/main
Browse files Browse the repository at this point in the history
  • Loading branch information
muqiuhan authored Jun 21, 2023
2 parents 55761a9 + c0ff557 commit e1b9b8f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
Binary file added .github/demo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

</div>

![./demo](.github/demo.png)

# Install

1. `opam install . --deps-only`
Expand Down
4 changes: 3 additions & 1 deletion lib/eval/eval.ml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ let rec eval_expr expr env =
and eval_apply fn_expr args env =
match fn_expr with
| Object.Primitive (_, fn) -> fn args
| Object.Closure (_, names, expr, clenv) ->
| Object.Closure (fn_name, names, expr, clenv) ->
(* Check if the closure exists *)
Object.lookup (fn_name, env) |> ignore;
eval_closure names expr args clenv env
| fn_expr ->
raise (Errors.Parse_error_exn (Apply_error (Object.string_object fn_expr)))
Expand Down
2 changes: 1 addition & 1 deletion test/end_normal_test.mlisp
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,4 @@

(letrec ((f (lambda (x) (g (+ x 1))))
(g (lambda (x) (+ x 3))))
(f 0))
(f 0))

0 comments on commit e1b9b8f

Please sign in to comment.