9.4 Serializable Closures
The defunctionalization process of the Web Language (see Web Language Servlets) requires an explicit representation of closures that is serializable. "private/closure.ss" is this representation. It provides:
| |||||||||||||||||||||
tag : syntax? | |||||||||||||||||||||
fvars : (listof identifier?) | |||||||||||||||||||||
proc : syntax? |
Outputs a syntax object that defines a serializable structure, with tag as the tag, that represents a closure over fvars, that acts a procedure and when invoked calls proc, which is assumed to be syntax of lambda or case-lambda.
c : closure? |
Extracts the unique tag of a closure c
These are difficult to use directly, so "private/define-closure.ss" defines a helper form:
(define-closure tag formals (free-vars ) body) |
Defines a closure, constructed with make-tag that accepts freevars , that when invoked with formals executes body.