From 80949873b409a54f7cb7e8defe9fe640670a1ae1 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 7 May 2021 16:44:43 +0530 Subject: Define with-rng sc macro. * src/macros/macros.sc (with-rng): New macro. --- src/macros/macros.sc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/macros/macros.sc') 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 ...)) -- cgit v1.2.3