aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2021-05-07 16:44:43 +0530
committerArun Isaac2021-05-07 17:04:50 +0530
commit80949873b409a54f7cb7e8defe9fe640670a1ae1 (patch)
treec9f3b2d8e79e39c5efb80b30a054d9c985b13608
parentc517ae401221da5b495fbd7b815bbafc0f087da9 (diff)
downloadnsmc-80949873b409a54f7cb7e8defe9fe640670a1ae1.tar.gz
nsmc-80949873b409a54f7cb7e8defe9fe640670a1ae1.tar.lz
nsmc-80949873b409a54f7cb7e8defe9fe640670a1ae1.zip
Define with-rng sc macro.
* src/macros/macros.sc (with-rng): New macro.
-rw-r--r--src/macros/macros.sc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/macros/macros.sc b/src/macros/macros.sc
index a921f75..cf6be15 100644
--- a/src/macros/macros.sc
+++ b/src/macros/macros.sc
@@ -48,3 +48,8 @@
(gsl-vector-alloc size)
gsl-vector-free
body ...))
+
+(sc-define-syntax (with-rng var body ...)
+ (with-alloc var gsl-rng*
+ (gsl-rng-alloc gsl-rng-default) gsl-rng-free
+ body ...))