choose   macro


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/instruments-scm.xtm

Implementation

(define-macro (choose prob a . args)
  (if (null? args)
      `(if (< (random) ,prob)
           ,a)
      `(if (< (random) ,prob)
           ,a ,(car args))))


Back to Index