[functional-tests/utils] inc!, dec!
This commit is contained in:
parent
c921233f3c
commit
80f9d082d5
16
functional-tests/utils.scm
Normal file
16
functional-tests/utils.scm
Normal file
@ -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)))))
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user