diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-06-03 06:21:36 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-06-03 06:21:36 -0700 |
commit | c66aa75d955df8eae0b5553a5a57601245ad65af (patch) | |
tree | f63352f1f7966a0d7dd2efd9bb855a8c16bc099e /eval.c | |
parent | e2437397f8f4430fd479cafe9495e5a19e970f86 (diff) | |
download | txr-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.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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) |