(($ $cont sym ($ $kfun src meta self tail clause))
(sym ($kfun src meta self ,tail ,(and clause (visit-cont clause)))))))
-(define (convert-closures exp)
+(define (convert-closures fun)
"Convert free reference in @var{exp} to primcalls to @code{free-ref},
and allocate and initialize flat closures."
- (match exp
- (($ $fun () body)
- (with-fresh-name-state body
- (receive (body free) (cc body #f '())
- (unless (null? free)
- (error "Expected no free vars in toplevel thunk" exp body free))
- (convert-to-indices body free))))))
+ (with-fresh-name-state fun
+ (receive (body free) (cc fun #f '())
+ (unless (null? free)
+ (error "Expected no free vars in toplevel thunk" fun body free))
+ (convert-to-indices body free))))