bind-data-type   scheme


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

Implementation

(define (bind-data-type n name)
  (let* ((types (regex:type-split (symbol->string name) "{"))
         (dtypes (if (null? (cdr types)) "" (cadr types)))
         (tstr (if (null? (cdr types))
                   ""
                   (substring dtypes 0 (- (string-length dtypes) 1)))))
    `(bind-type ,n
       ,(string->symbol (string-append "<i64,i8*"
                                       (if (> (string-length tstr) 0)
                                           "," "")
                                       tstr ">"))
       (printer? . #f)
       (constructor? . #f))))


Back to Index

Similar Entries