[plt-scheme] Calling scheme_loaded functions

From: Richard Cleis (rcleis at mac.com)
Date: Wed Mar 10 11:08:19 EST 2004

On Mar 10, 2004, at 8:34 AM, Matthew Flatt wrote:

> At Tue, 9 Mar 2004 23:14:57 -0700, Richard Cleis wrote:
>> [snip] If a function is scheme_loaded, can it be scheme_eval'd?  That 
>> would
>> imply that it could be scheme_compiled once, then scheme_eval_compiled
>> forever more.  If that is true, then is it possible to scheme_compile
>> an entire file?
>
> Calling scheme_eval_string() is essentially the same as typing an
> expression in a read-eval-print loop. The expression that you type is
> compiled, but not any functions that the expression might call (which
> were compiled once by scheme_load()). For example, typing
>
>> (f 1 2 3)
>
> compiles the function call "(f 1 2 3)", but it doesn't compile `f'
> itself.
>
> So, most likely, scheme_eval_string() is fine for your purposes.
>
> Matthew
>
Which is faster, scheme_eval_string( "(f 1 2 3)" ) or...
building an argument list with scheme_make_double and somehow using 
scheme_apply?

I am not sure I can ask the above question since chapter 6 reads:

"The functions scheme_eval_compiled, scheme_apply, etc. provide the 
same functionality without starting a new top-level evaluation; these 
functions should only be used within new primitive procedures."

By "new primitive procedure", it appears that only functions made with 
scheme_make_prim_etc can be used with scheme_apply.  Is this true?

rac




Posted on the users mailing list.