No subject
Thu Mar 26 00:47:06 EDT 2009
MzScheme's parameter feature. It provides the ability to set up
thread-specific parameters, so that you can provide something that works
like the procedures current-output-port etc., that gives a different answer
on different threads:
http://download.plt-scheme.org/doc/mzscheme/mzscheme-Z-H-7.html#%_sec_7.4
You should be able to set up a procedure like (calling-device-id) that gives
thread-specific answers (if your script server is already going to be
running scripts on multiple threads anyway). You would use the
'parameterize' form when invoking the script.
The other related docs to look at are those for MzScheme namespaces:
http://download.plt-scheme.org/doc/mzscheme/mzscheme-Z-H-8.html
If you're using 'eval' at all - e.g., if the clients are separate processes
that are communicating over the network, for example - then namespaces could
allow you to eval a script with a different global namespace (again using
'parameterize'), with global variables set to the appropriate values for
that script. This is closely related to the above solution, but I think the
above is better if you don't need to use 'eval'.
One of these should do what you need.
Anton
More information about the plt-scheme
mailing list