(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)))))