Next: Defining new Scheme procedures in C, Previous: Error messages, Up: GH
Once you have an interpreter running, you can ask it to evaluate Scheme code. There are two calls that implement this:
This asks the interpreter to evaluate a single string of Scheme code, and returns the result of the last expression evaluated.
Note that the line of code in scheme_code must be a well formed Scheme expression. If you have many lines of code before you balance parentheses, you must either concatenate them into one string, or use
gh_eval_file.
Read and evaluate scheme_code, throwing to handler if necessary.
The next two functions use the standard handler, which writes a short
message to stderr [not to current-error-port, sounds like a bug –ttn],
and the catch tag to the current-output-port.
Read and evaluate scheme_code, catching exceptions using the standard handler.
Read and evaluate scheme_code, saving the stack in case of exception.
gh_eval_fileis completely analogous togh_eval_str, except that a whole file is evaluated instead of a string.gh_eval_filereturnsSCM_UNSPECIFIED.
gh_loadis identical togh_eval_file(it's a macro that callsgh_eval_fileon its argument). It is provided to start making thegh_interface match the R5RS Scheme procedures closely.