Specifically, it sets these parameters:
Returns a list of all of the snipclasses in the current eventspace.
Use this function to expand the contents of the definitions
window for use with external program processing tools.
This function uses
to build the user’s environment.
The arguments language-settings, init,
kill-termination, and gui-modules? are passed to
The input argument specifies the source of the program.
The eval-compile-time-part? argument indicates if
is called or if
is called when the program is expanded.
Roughly speaking, if your tool will evaluate each expression
itself by calling
then pass #f. Otherwise, if your tool
just processes the expanded program, be sure to pass
This function calls
to expand the program. Unlike when the Run is clicked,
however, it does not call
The first argument to iter is the expanded program
(represented as syntax) or eof.
The iter argument 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, iter is not called.
Consider setting the exception-handler during init to
handle this situation.
The second argument to iter is a thunk that
continues expanding the rest of the contents of the
definitions window. If the first argument to iter was
eof, this argument is just the primitive
This function is similar to
The only difference is that it does not
expand the program in the editor; instead
the processing function can decide how to
expand the program.
This function is just like
except that it is curried and the second application
can be used multiple times.
Use this function if you want to initialize the user’s
thread (and namespace, etc) once but have program text
that comes from multiple sources.
The extra boolean argument to the result function
This function creates a custodian and an eventspace (on the
new custodian) to expand the user’s program. It does not
kill this custodian, but it can safely be shutdown (with
) after the
expansion is finished.
It initializes the
user’s eventspace’s main thread with several parameters:
The language-settings argument is the current
language and its settings. See
for details on that structure.
If the program is associated with a DrRacket
frame, get the frame’s language settings from the
drracket:unit:definitions-text<%>. Also, the most recently chosen language in
the language dialog is saved via the framework’s
for that language-settings.
The init argument is called after the user’s parameters
are all set, but before the program is run. It is called on
the user’s thread. The
parameters are not set, so if there are appropriate directories,
the init argument is a good place to set them.
The kill-termination argument is called when the main thread of
the eventspace terminates, no matter if the custodian was
shutdown, or the thread was killed. This procedure is also
called when the thread terminates normally. This procedure is
called from a new, dedicated thread (i. e., not the thread
created to do the expansion, nor the thread that
drracket:eval:build-user-eventspace/custodian was called from.)