bind-data-types   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/base/adt.xtm

Implementation

(define (bind-data-types name constructors)
  (map (lambda (xs)
         (list 'bind-type
               (string->symbol
                (string-append (symbol->string name)
                               "_data_"
                               (symbol->string (car xs))))
               (string->symbol
                (string-append "<"
                               (if (null? (cdr xs))
                                   "i64"
                                   (string-join
                                    (map (lambda (x)
                                           (symbol->string x))
                                         (cdr xs))
                                    ","))
                               ">"))
               `(printer? . #f)))
       constructors))


Back to Index