summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-02-14 17:42:08 -0800
committerKaz Kylheku <kaz@kylheku.com>2014-02-14 17:42:08 -0800
commit6b4e2804f2da87aa3d15d407acc9b774a01d1555 (patch)
tree82d5a1768cb57c743f53a398cb141b3fded30fda /eval.c
parenta4b872687408e7624ccb500fbce8467ae3f821e6 (diff)
downloadtxr-6b4e2804f2da87aa3d15d407acc9b774a01d1555.tar.gz
txr-6b4e2804f2da87aa3d15d407acc9b774a01d1555.tar.bz2
txr-6b4e2804f2da87aa3d15d407acc9b774a01d1555.zip
Replacing acons_new_l and aconsq_new_l interfaces with ones
that return the new or old cons cell rather than a pointer to its cdr field. * eval.c (transform_op): use of acons_new_l replaced with acons_new_c. * hash.c (struct hash): acons_new_l_fun member replaced with acons_new_c_fun. (make_hash, make_similar_hash): initialize acons_new_l_fun member using either acons_new_c or aconsql_new_c. (gethash_l): function becomes an inline in hash.h. (gethash_c): new function, based on gethash_l. (inhash, gethash_n): updated w.r.t struct hash change. * hash.h (gethash_c): declared. (gethash_l): becomes an inline wrapper for gethash_c. * lib.c (acons_new_l, aconsql_new_l): functions removed. (acons_new_c, aconsql_new_c): new functions. (obj_init): use gethash_c and rplacd instead of gethash_l and set. * lib.h (acons_new_l, aconsql_new_l): declarations removed. (acons_new_c, aconsql_new_c): declared.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/eval.c b/eval.c
index bb2365bf..a79be121 100644
--- a/eval.c
+++ b/eval.c
@@ -1597,8 +1597,9 @@ static val transform_op(val forms, val syms, val rg)
if (integerp(vararg)) {
val newsyms = syms;
val new_p;
- val *place = acons_new_l(vararg, &new_p, &newsyms);
- val sym = if3(new_p, set(*place, gensym(format_op_arg(vararg))), *place);
+ val cell = acons_new_c(vararg, &new_p, &newsyms);
+ val sym = if3(new_p, rplacd(cell, gensym(format_op_arg(vararg))),
+ cdr(cell));
cons_bind (outsyms, outforms, transform_op(re, newsyms, rg));
return cons(outsyms, rlcp(cons(sym, outforms), outforms));
} else if (eq(vararg, rest_s)) {