[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More Compiled S-Expression Questions



The MzScheme source defines a C function (scheme_eval_string_all)
that will evaluate an arbitrary string.  It does so by converting
it to a string-based input port, and reading an expresson from it
(then compiling it, and evaluating the compiled object) until it
hits EOF.

Let's say we have a file like this:

(define (foo a) (+ a 1))

(foo 2)

... that I want to run as a script in my embedded web service.

Is it possible to create a single compiled representation of this
that could be stored and reloaded without going through the
overhead of re-parsing and evaluating?

Or must each s-expression be compiled individually?

Obviously I could fudge by doing something like:

(begin
	(define...
	(foo 2))

But I want to be able to create arbitrary compiled objects.

Is this possible?

Thanks,

-Brent