constructor-name-and-type   scheme


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

Implementation

(define (constructor-name-and-type n type constructor)
  (let* ((name (symbol->string (car constructor)))
         (types (string-join (map (lambda (x) (symbol->string x)) (cdr constructor)) ",")))
    ;; (println 'name name 'types types)
    (string->symbol (string-append name ":[" (symbol->string type)
                                   (if (string=? types "") "*" "*,")
                                   types "]*"))))


Back to Index

Similar Entries