Skip to content

Commit

Permalink
dont use more memory than necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-johnson-4 committed Jan 3, 2024
1 parent 609e872 commit 2d7a8e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion stdlib/helpers.lm
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
\t mov $__cons_counter, %r8 \n # %r8 now points to cons counter
\t mov 0(%r8), %r10 \n # %r10 now hold value of cons counter
\t add %r10, %rsi \n # %rsi now points to top cons
\t add $128, %r10 \n # increment cons counter
\t add $32, %r10 \n # increment cons counter
\t mov %r10, 0(%r8) \n # overwrite new cons counter
\t mov %r12, 0(%rsi) \n # set top.atom
\t mov %r13, 8(%rsi) \n # set top.head
Expand Down
6 changes: 3 additions & 3 deletions tests/c_e.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn test_eval() {

#[test]
fn test_ctx_eval() {
assert_eq!( ctx_eval_soft(&kv(&[(variable("a"),literal("b"))]),&parse_expression("b")).to_string(), "(variable . b)" );
assert_eq!( ctx_eval_soft(&kv(&[(variable("a"),literal("b"))]),&parse_expression("a")).to_string(), "(literal . b)" );
assert_eq!( ctx_eval_soft(&kv(&[(variable("a"),literal("b"))]),&parse_expression("(λx.a) z")).to_string(), "(literal . b)" );
assert_eq!( ctx_eval_soft(&kv(&[(s_atom("a"),literal("b"))]),&parse_expression("b")).to_string(), "(variable . b)" );
assert_eq!( ctx_eval_soft(&kv(&[(s_atom("a"),literal("b"))]),&parse_expression("a")).to_string(), "(literal . b)" );
assert_eq!( ctx_eval_soft(&kv(&[(s_atom("a"),literal("b"))]),&parse_expression("(λx.a) z")).to_string(), "(literal . b)" );
}

0 comments on commit 2d7a8e6

Please sign in to comment.