impc:ti:tuple-ref-ptr-check   scheme


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

Implementation

(define impc:ti:tuple-ref-ptr-check
  (lambda (ast vars kts request?)
    ;; (caddr ast) must be an integer
    (if (not (integer? (caddr ast)))
        (impc:compiler:print-bad-type-error (caddr ast) "tuple-ref must use a literal integer index"))
    (let* (; a should be a tuple of some kind!
           (a (impc:ti:type-check (cadr ast) vars kts #f)) ;;(if (impc:ir:type? request?)
           ;;(impc:ir:tuple? request?)
           ;;request?
           ;;#f))) ;request?))
           ;; b should be fixed point -- llvm structs only support 32bit indexes
           (b (impc:ti:type-check (caddr ast) vars kts (list *impc:ir:si32*))))
      (if (and (not (null? a)) (or (atom? a) (impc:ir:type? a)))  (set! a (list a)))


Back to Index