summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-04-28 06:47:22 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-04-28 06:47:22 -0700
commit0c18458bd242489babcd9a1aee30ba9fd0620e25 (patch)
tree51958c2205ee15fc7fd978c877f97b7c79566c61 /lib.c
parent2e0639abc56dcad0ce4b5933604d0c8657ac094b (diff)
downloadtxr-0c18458bd242489babcd9a1aee30ba9fd0620e25.tar.gz
txr-0c18458bd242489babcd9a1aee30ba9fd0620e25.tar.bz2
txr-0c18458bd242489babcd9a1aee30ba9fd0620e25.zip
Clean-up rand code; implement configurable warmup.
* lib.c (copy): Pass new second argument to make_random_state. * rand.c (random_warmup): New macro. (random_warmup_s): New symbol variable. (make_random_state): New warmup argument. Code restructured to avoid copy flag. Fill code and initialization of r->cur made common. (rand_compat_fixup): Pass second argument to make_random_state. (rand_init): Pass second argument to make_random_state. Initialize random_warmup_s with interned symbol. Register *random-warmup* special variable. Fix registration of make-random-state to two-argument function type. * rand.h (make_random_state): Declaration updated. * txr.1: Document *random-warmup* variable and warup argument of make-random-state.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index 1256314f..1d41ea6b 100644
--- a/lib.c
+++ b/lib.c
@@ -7979,7 +7979,7 @@ val copy(val seq)
if (seq->co.cls == hash_s)
return copy_hash(seq);
if (seq->co.cls == random_state_s)
- return make_random_state(seq);
+ return make_random_state(seq, nil);
if (structp(seq))
return copy_struct(seq);
/* fallthrough */