summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-06-03 06:21:36 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-06-03 06:21:36 -0700
commitc66aa75d955df8eae0b5553a5a57601245ad65af (patch)
treef63352f1f7966a0d7dd2efd9bb855a8c16bc099e /eval.c
parente2437397f8f4430fd479cafe9495e5a19e970f86 (diff)
downloadtxr-c66aa75d955df8eae0b5553a5a57601245ad65af.tar.gz
txr-c66aa75d955df8eae0b5553a5a57601245ad65af.tar.bz2
txr-c66aa75d955df8eae0b5553a5a57601245ad65af.zip
Documenting the return value of rplaca and rplacd, and changing
it to be the cell, rather than the new value. * eval.c (transform_op): Fix use of rplacd that uses return value. (force): Likewise. * lib.c (rplaca, rplacd): Return cons. (rem_lazy_rec, obj_init): Fix use of rplacd that uses return value. * txr.1: Documented.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/eval.c b/eval.c
index de1180ed..bbd76c2d 100644
--- a/eval.c
+++ b/eval.c
@@ -2284,8 +2284,9 @@ static val transform_op(val forms, val syms, val rg)
val newsyms = syms;
val new_p;
val cell = acons_new_c(vararg, mkcloc(new_p), mkcloc(newsyms));
- val sym = if3(new_p, rplacd(cell, gensym(format_op_arg(vararg))),
- cdr(cell));
+ val sym = cdr(if3(new_p,
+ rplacd(cell, gensym(format_op_arg(vararg))),
+ cell));
cons_bind (outsyms, outforms, transform_op(re, newsyms, rg));
return cons(outsyms, rlcp(cons(sym, outforms), outforms));
} else if (vararg == rest_s) {
@@ -2933,7 +2934,7 @@ static val force(val promise)
return cdr(promise);
rplaca(promise, nil);
- return rplacd(promise, funcall(cdr(promise)));
+ return cdr(rplacd(promise, funcall(cdr(promise))));
}
static val errno_wrap(val newval)