From cd506874cbd25801b90ba4ce8a3dff1041865e8a Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 7 May 2021 16:43:57 +0530 Subject: Define for-i-step sc macro. * src/macros/macros.sc (for-i-step): New macro. --- src/macros/macros.sc | 6 ++++++ 1 file changed, 6 insertions(+) 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 ... -- cgit v1.2.3