drscheme:eval:expand-program in DrScheme Tools Functions
input: (or/c port? drscheme:language:text/pos?)
init: (-> void?)
kill-termination: (-> void?)
iter: ((or/c eof-object? syntax? (cons/c string? any/c)) (-> any) . -> . any)
Use this function to expand the contents of the definitions window for use with external program processing tools.
This function uses
drscheme:eval:build-user-eventspace/custodianto build the user's environment. The arguments
kill-terminationare passed to
inputargument specifies the source of the program.
eval-compile-time-part?argument indicates if awscmexpand is called or if
expand-top-level-with-compile-time-evalsis called when the program is expanded. Roughly speaking, if your tool will evaluate each expression itself by calling
#f. Otherwise, if your tool just processes the expanded program, be sure to pass
This function calls
front-end/complete-programto expand the program.
The first argument to
iteris the expanded program (represented as syntax) or eof. The
iterargument is called for each expression in the expanded program and once more with eof, unless an error is raised during expansion. It is called from the user's thread. If an exception is raised during expansion of the user's program,
iteris not called. Consider setting the exception-handler during
initto handle this situation.
The second argument to
iteris a thunk that continues expanding the rest of the contents of the definitions window. If the first argument to
iterwas eof, this argument is just the primitive