if-random   macro


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

Implementation

;
;; http://download.plt-scheme.org/doc/372/html/t-y-scheme/t-y-scheme-Z-H-10.html#node_chap_8
;; ----------------------
;; (if-random .6 (print 'ciao) (print 'baby))
(define-macro (if-random x args . elseargs)
   `(if (> (random) ,x)
        ,args 
        ,@elseargs))


Back to Index