From c66aa75d955df8eae0b5553a5a57601245ad65af Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 3 Jun 2014 06:21:36 -0700 Subject: 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. --- eval.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'eval.c') 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) -- cgit v1.2.3