register-lib-val   macro


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

Implementation

(define-macro (register-lib-val library symname type . docstring)
  `(let* ((type-str ,(if (impc:ti:typealias-exists? (symbol->string type))
                         (impc:ti:get-typealias-ground-type-pretty (symbol->string type))
                         (symbol->string type)))
          (type-list (impc:ir:get-type-from-pretty-str type-str))
          (ds ,(if (null? docstring) "" (car docstring))))
      (begin
           (impc:ti:register-new-globalvar ,(symbol->string symname)
                                           type-list
                                           ds)
           (impc:aot:insert-globalvar-binding-details ,(symbol->string library)
                                                      ,(symbol->string symname)
                                                      ,(symbol->string type)
                                                      ds)
           (impc:compiler:print-binding-details-to-log "Lib Registered:"
                                                       ,(symbol->string symname)
                                                       ,(symbol->string type)))))


Back to Index