From 80f9d082d5aa108b5ce3538e2d545e92f15d0b87 Mon Sep 17 00:00:00 2001 From: Joe Thornber Date: Mon, 21 Aug 2017 09:59:45 +0100 Subject: [PATCH] [functional-tests/utils] inc!, dec! --- functional-tests/utils.scm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 functional-tests/utils.scm diff --git a/functional-tests/utils.scm b/functional-tests/utils.scm new file mode 100644 index 0000000..a019a12 --- /dev/null +++ b/functional-tests/utils.scm @@ -0,0 +1,16 @@ +(library + (utils) + (export inc! + dec!) + (import (rnrs)) + + (define-syntax inc! + (syntax-rules () + ((_ v) (set! v (+ 1 v))) + ((_ v n) (set! v (+ n v))))) + + (define-syntax dec! + (syntax-rules () + ((_ v) (set! v (- v 1))) + ((_ v n) (set! v (- v n))))) + )