impc:ti:genericfunc-exists?   scheme


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

Implementation

;; with an optional arity check
(define impc:ti:genericfunc-exists?
  (lambda (name . arity)
    (if (string? name) (set! name (string->symbol name)))
    (if (null? arity)
        (let ((res (assoc-strcmp name *impc:ti:genericfunc-cache*)))
          (if res #t #f))
        (let* ((res (assoc-strcmp-all name *impc:ti:genericfunc-cache*))
               (results (map (lambda (r) (cadr r)) res)))
          (if (and (not (null? results)) (member (car arity) results)) #t #f)))))


Back to Index