(define impc:ir:compiler:closure-set
(lambda (ast types)
;; arg 1 must be a closure
;; arg 2 must be a string
;; arg 3 must be a string
;; arg 4 must be of type!
(let* ((os (make-string 0))
(closure-str (if (and (symbol? (cadr ast))
(impc:ti:closure-exists? (symbol->string (cadr ast))))
(impc:ir:compiler:closure-from-getter (symbol->string (cadr ast)))
(impc:ir:compiler (cadr ast) types)))
(closure (impc:ir:gname))
;; (name-str (impc:ir:compiler (caddr ast) types))
;; (name (impc:ir:gname))
(type-str (impc:ir:compiler (cadddr ast) types))
(type (impc:ir:gname))
(val-str (impc:ir:compiler (car (cddddr ast)) types (impc:ir:get-type-from-str (cadddr ast))))
(val (impc:ir:gname)))
(emit "\n; closure set! \n" os)
(emit closure-str os)
;; (emit name-str os)
(emit type-str os)
(emit val-str os)