impc:ti:construct-generic-type-if-valid   scheme


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

Implementation

(define impc:ti:construct-generic-type-if-valid
  (lambda (t)
    ;; named type might need to be constructed!
    (if (and (string? t)
             (char=? (string-ref t 0) #\%)
             (regex:match? t "_poly_"))
        (if (impc:ti:namedtype-exists? t)
            #t ;; if 't' exists don't do anything else
            (let* ((p (regex:split t "_poly_"))
                   (n (substring (car p) 1 (string-length (car p)))))
              (if (not (impc:ti:get-generictype-candidate-types n))
                  #f  ;; if not a generic type then bad :(
                  (begin
                    #t))))
        #t)))


Back to Index