ipc:bind-func   scheme


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

Implementation

(define ipc:bind-func
  (lambda (procname symname)
    (if (regex:match? (symbol->string symname) "_adhoc_")
        (ipc:call procname 'bind-func-ipc symname)
        (let* ((polyname (symbol->string symname))
               (polytypes (impc:ti:get-polyfunc-candidate-list polyname)))
          (if (and (list? polytypes)
                   (= (length polytypes) 1))
              (begin (ipc:call procname 'bind-func-ipc
                               (string->symbol (vector-ref (car polytypes) 0)))
                     (ipc:define procname symname (eval symname)))
              (log-error "Not a monomorphic xtlang function:" symname))))))


Back to Index

Similar Entries