impc:ir:type?   scheme

Defined in:


(define impc:ir:type?
  (lambda (type)
    (if (string? type)
        (if (and (char=? (string-ref type 0) #\%)
                      (substring (impc:ir:get-base-type type) 1
                                 (string-length (impc:ir:get-base-type type)))))
            (impc:ir:type? (impc:ir:get-type-from-str type)))
        (cond ((null? type) #f)
              ((and (number? type)
                    ;; (or (< type 0) (< (modulo type *impc:ir:pointer*) *impc:ir:closure*)) ;; this should be true but is actually more trouble than it's worth at this stage
                    (< type 1001))
              ((and (list? type)
                    (number? (car type))
                    (or (impc:ir:closure? type)
                        (impc:ir:tuple? type))
                    (cl:every (lambda (x) x)
                              (map (lambda (a) (impc:ir:type? a)) (cdr type))))
              ((and (list? type)
                    (number? (car type))
                    (or (impc:ir:array? type)
                        (impc:ir:vector? type))
                    (impc:ir:type? (caddr type)))
              (else #f)))))

Back to Index

Similar Entries

  • impc:ir:complex-type?    scheme
  • impc:ti:bang-type?    scheme
  • impc:ti:complex-type?    scheme
  • impc:ti:spec-new-type?    scheme
  • t:notype?    scheme