diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-04-28 06:47:22 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-04-28 06:47:22 -0700 |
commit | 0c18458bd242489babcd9a1aee30ba9fd0620e25 (patch) | |
tree | 51958c2205ee15fc7fd978c877f97b7c79566c61 /lib.c | |
parent | 2e0639abc56dcad0ce4b5933604d0c8657ac094b (diff) | |
download | txr-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 */ |