aboutsummaryrefslogtreecommitdiff
path: root/src/macros/macros.sc
blob: 78e38dc5723788227ca10194921a86b5c249a7da (plain)
1
2
3
4
5
6
7
8
9
10
(sc-define-syntax (for-i index limit body ...)
  (for ((define index int 0)
        (< index limit)
        (set+ index 1))
    body ...))

(sc-define-syntax (with-alloc var type allocate free body ...)
  (let* ((var type allocate))
    body ...
    (free var)))