register-ext-val   macro


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

Implementation

(define-macro (register-ext-val 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))))
      ; (llvm:compile-ir
      ;   (string-append "@" ,(symbol->string symname) " = external global " (impc:ir:get-type-str type-list)))
      (impc:ti:register-new-globalvar ,(symbol->string symname) type-list ds)
      (impc:aot:insert-ext-globalvar-binding-details ,(symbol->string symname) ,(symbol->string type) ds)
      (impc:compiler:print-binding-details-to-log "register-ext-val:" ,(symbol->string symname) ,(symbol->string type))))


Back to Index