+
+ ;; (define (emit-scc scc env)
+ ;; ; acc is a pair of the env and list of touchups
+ ;; (define (emit-binding acc binding)
+ ;; (let ([binding-name (car binding)]
+ ;; [binding-body (cadr binding)]
+
+ ;; [other-bindings (filter
+ ;; (lambda (x) (not (eqv? binding-name x)))
+ ;; scc)]
+ ;; [mutually-recursives
+ ;; (filter
+ ;; (lambda (other-binding)
+ ;; (memv other-binding (references binding-body)))
+ ;; other-bindings)]
+
+ ;; [new-touchups (append touchups (cdr acc))])
+
+ ;; ; TODO: assert that the only mutually recursives are closures
+ ;; (for-each
+ ;; (lambda (binding)
+ ;; (when (not (eqv? (ast-type (cadr binding))
+
+ ;; (emit "asdf")
+ ;; (cons new-env new-touchups)
+ ;; ))
+
+ ;; (fold-left emit-binding (cons env '()) scc))))
+
+ (let* ([stack-offsets (map (lambda (name x) ; assoc map of binding name to offset