everyelse   macro


Defined in:  https://github.com/lambdamusic/extempore-extensions/blob/main/init/init_beats.xtm

Implementation

;
;
;; EVERYELSE N loops, do X, ELSE Y - BOTH X and Y required
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Requires `lc` symbol to be in scope and incremented at each iteration
;
; (let ((lc 4))
;   (everyelse 2 (list 4 5) 'no)
;   )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(impc:aot:do-or-emit
    (define-macro (everyelse . args)
    ;;(println args)
    `(if (= (modulo lc ,(car args)) 0)
            ,(cadr args)
            ,(caddr args)))
)


Back to Index