Discussion:
ideal way to load modules / set up evaluation environments at runtime.
Roderic Morris
2012-10-22 00:40:50 UTC
Permalink
Hey guys, I'm trying to load module definitions, and set up evaluation environments outside of the context of the command processor. The apis to do that seem to be lightly documented if at all though. I was wondering if any of you had some insight into the best way to do that.

For instance, I'd like to :
- load a set of files containing module definitions
- create a new package with a subset of those modules opened, as well as standard modules included with scheme48
- evaluate code in that package

Any help would be appreciated. I need this to replace the module set up directives in scsh, since the api the last version used have changed substantially. It would also be useful in countless other contexts, of course.

-Roderic
Michael Sperber
2012-10-22 18:33:44 UTC
Permalink
Post by Roderic Morris
Hey guys, I'm trying to load module definitions, and set up evaluation environments outside of the context of the command processor. The apis to do that seem to be lightly documented if at all though. I was wondering if any of you had some insight into the best way to do that.
- load a set of files containing module definitions
- create a new package with a subset of those modules opened, as well as standard modules included with scheme48
- evaluate code in that package
Sunterlib has stuff in s48/module-system that does this. Should still work.
--
Regards,
Mike
Roderic Morris
2012-10-23 04:23:56 UTC
Permalink
Ah, cool! Thanks for the ref. Unfortunately, it seems that library doesn't work for the same reason the code I have no doesn't: the config-package function from the package-commands-internal-interface module is a "user-context-accessor", and it seems user-context doesn't exist outside of the command processor. Calling load-config-file from that library gives the following error:

error: unhandled upcall [propogate-upcall]
#{upcall-token user-session}


I'm not sure what the right way to deal with this is. Is there a canonical config-package outside of the command processor?

-Roderic
Post by Roderic Morris
Hey guys, I'm trying to load module definitions, and set up evaluation environments outside of the context of the command processor. The apis to do that seem to be lightly documented if at all though. I was wondering if any of you had some insight into the best way to do that.
- load a set of files containing module definitions
- create a new package with a subset of those modules opened, as well as standard modules included with scheme48
- evaluate code in that package
Sunterlib has stuff in s48/module-system that does this. Should still work.
--
Regards,
Mike
Michael Sperber
2012-10-24 15:55:21 UTC
Permalink
Post by Roderic Morris
Ah, cool! Thanks for the ref. Unfortunately, it seems that library
doesn't work for the same reason the code I have no doesn't: the
config-package function from the package-commands-internal-interface
module is a "user-context-accessor", and it seems user-context doesn't
exist outside of the command processor. Calling load-config-file from
error: unhandled upcall [propogate-upcall]
#{upcall-token user-session}
I'm not sure what the right way to deal with this is. Is there a
canonical config-package outside of the command processor?
I'm a bit confused: The "default" config package is indeed something
associated with the user session: There's no concept of "canonical
config package" outside of that. What you can always do is construct or
pass around a config package explicitly. Could you elaborate on what
you're trying to do?
--
Regards,
Mike
Roderic Morris
2012-10-25 03:34:56 UTC
Permalink
Post by Michael Sperber
I'm a bit confused: The "default" config package is indeed something
associated with the user session: There's no concept of "canonical
config package" outside of that. What you can always do is construct or
pass around a config package explicitly. Could you elaborate on what
you're trying to do?
I basically just want to do what I stated in my first email, from a function given as an argument to ,build. There is no user context when those functions eventually run, so the functions I need in that library fail.

You're right though, I can just keep a reference to the config-package I have in the command processor as I'm building the image. I'm going to do essentially the same thing the functions in the module-system library do, except with the config package as a parameter. I think I have what I need now, thanks everyone!

-Roderic

Loading...