impc:ti:set-check   scheme


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

Implementation

(define impc:ti:set-check
  (lambda (ast vars kts request?)
    ;; (println 'ast: ast 'vars: vars 'kts: kts 'request?: request?)
    (let* ((sym (impc:ti:get-var (cadr ast) vars))
           (a (impc:ti:type-check (caddr ast) vars kts (cdr sym))))
      (if *impc:ti:print-sub-checks* (println 'set!:> 'ast: ast 'a: a))
      ;; (println 'a: a 'sym: sym)
      (if (and (list? a)
               (= (length a) 1)
               (impc:ir:type? (car a)))
          (set! a (car a)))
      ;; if sym is not a global var then add return type to sym
      (if (and (assoc-strcmp (car sym) vars)
               (member a (cdr (assoc-strcmp (car sym) vars))))
          (impc:ti:force-var (car sym) vars '() a)
          (if (assoc-strcmp (car sym) vars)
              (impc:ti:update-var (car sym) vars kts a)))
      a)))


Back to Index

Similar Entries