bind-lib-type   macro


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/llvmti.xtm

Implementation

(define-macro (bind-lib-type library name type docstring)
  (let* ((a (impc:ir:get-pretty-tuple-arg-strings (symbol->string type)))
         (namestr (symbol->string name))
         (typestr (symbol->string type)))
    `(begin
       (if (llvm:compile-ir ,(string-append "%" namestr " = type " (impc:ir:get-type-str (impc:ir:get-type-from-pretty-str typestr namestr))))
           (impc:ti:register-new-namedtype ,namestr
                                           ',(impc:ir:get-type-from-pretty-str typestr namestr)
                                           ,docstring)
           (impc:compiler:print-compiler-error "bind-lib-type failed" ,name)))))


Back to Index