summaryrefslogtreecommitdiffstats
path: root/rand.h
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 /rand.h
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 'rand.h')
-rw-r--r--rand.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/rand.h b/rand.h
index 97dc4bc7..62d726cb 100644
--- a/rand.h
+++ b/rand.h
@@ -26,7 +26,7 @@
#define random_state (deref(lookup_var_l(nil, random_state_var_s)))
extern val random_state_s, random_state_var_s;
-val make_random_state(val seed);
+val make_random_state(val seed, val warmup);
val random_state_get_vec(val state);
val random_state_p(val obj);
val random_fixnum(val state);