src : path-string?
dest : path-string? =
(let-values ([(base name dir?) (split-path src)]) (build-path base "compiled" (path-add-suffix name #".zo"))) filter : (any/c . -> . any/c) = values
If the filter procedure is provided, it is applied to each source expression, and the result is compiled.
The compile-file procedure is designed for compiling modules files, in that each expression in src is compiled independently. If src does not contain a single module expression, then earlier expressions can affect the compilation of later expressions when src is loaded directly. An appropriate filter can make compilation behave like evaluation, but the problem is also solved (as much as possible) by the compile-zos procedure.
See also managed-compile-zo.