diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2011-12-14 19:33:55 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2011-12-14 19:33:55 -0800 |
commit | 89baf71c475f494c139df7c7f29a593b5a0f7d61 (patch) | |
tree | 58aa92761daf62600ec53d3dc147476eca511d98 /lib.c | |
parent | 93e4c50d09dcc20d7b244b66987f869143d45dd0 (diff) | |
download | txr-89baf71c475f494c139df7c7f29a593b5a0f7d61.tar.gz txr-89baf71c475f494c139df7c7f29a593b5a0f7d61.tar.bz2 txr-89baf71c475f494c139df7c7f29a593b5a0f7d61.zip |
* lib.c (car, cdr): Set the lazy cons function to nil
after calling it.
(rplacd): Do not set the lazy cons function to nil
in.
* txr.1: Documented a bunch of functions.
Diffstat (limited to 'lib.c')
-rw-r--r-- | lib.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -184,6 +184,7 @@ val car(val cons) return cons->lc.car; } else { funcall1(cons->lc.func, cons); + cons->lc.func = nil; return cons->lc.car; } default: @@ -203,6 +204,7 @@ val cdr(val cons) return cons->lc.cdr; } else { funcall1(cons->lc.func, cons); + cons->lc.func = nil; return cons->lc.cdr; } default: @@ -229,7 +231,6 @@ val rplacd(val cons, val new_cdr) case CONS: return cons->c.cdr = new_cdr; case LCONS: - cons->lc.func = nil; return cons->lc.cdr = new_cdr; default: type_mismatch(lit("~s is not a cons"), cons, nao); |