bind-data-getters   scheme


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

Implementation

(define (bind-data-getters n name constructors)
  (map (lambda (xs)
         (list 'bind-func
               (string->symbol
                (string-append (symbol->string n)
                               "_get_"
                               (symbol->string (car xs))
                               ":["
                               (local_gen_type_minimize n xs)
                               "*,"
                               (symbol->string name)
                               "*]*"))
               `(lambda (x) (cast (tref x 1)))))
       constructors))


Back to Index