aboutsummaryrefslogtreecommitdiff
path: root/src/macros
diff options
context:
space:
mode:
authorArun Isaac2021-05-07 16:43:57 +0530
committerArun Isaac2021-05-07 16:43:57 +0530
commitcd506874cbd25801b90ba4ce8a3dff1041865e8a (patch)
treec37490c35fe746970e3544818655f18e3fa35443 /src/macros
parent319dea49745c0f1b7c95fe8e3078794407c4c7c6 (diff)
downloadnsmc-cd506874cbd25801b90ba4ce8a3dff1041865e8a.tar.gz
nsmc-cd506874cbd25801b90ba4ce8a3dff1041865e8a.tar.lz
nsmc-cd506874cbd25801b90ba4ce8a3dff1041865e8a.zip
Define for-i-step sc macro.
* src/macros/macros.sc (for-i-step): New macro.
Diffstat (limited to 'src/macros')
-rw-r--r--src/macros/macros.sc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/macros/macros.sc b/src/macros/macros.sc
index 5ba9e1f..5c0d578 100644
--- a/src/macros/macros.sc
+++ b/src/macros/macros.sc
@@ -32,6 +32,12 @@
(set+ index 1))
body ...))
+(sc-define-syntax (for-i-step index start max step body ...)
+ (for ((define index int start)
+ (<= index max)
+ (set+ index step))
+ body ...))
+
(sc-define-syntax (with-alloc var type allocate free body ...)
(let* ((var type allocate))
body ...