mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-22 07:09:18 +02:00
(current-module-path) can take an optional arg to set the path.
This commit is contained in:
parent
4596856d77
commit
dee8eb95fb
3 changed files with 7 additions and 3 deletions
6
eval.c
6
eval.c
|
@ -2108,7 +2108,11 @@ sexp sexp_load_module_file (sexp ctx, const char *file, sexp env) {
|
|||
}
|
||||
|
||||
#if SEXP_USE_MODULES
|
||||
sexp sexp_current_module_path_op (sexp ctx, sexp self, sexp_sint_t n) {
|
||||
sexp sexp_current_module_path_op (sexp ctx, sexp self, sexp_sint_t n, sexp x) {
|
||||
if (sexp_pairp(x) && sexp_stringp(sexp_car(x))) {
|
||||
sexp_global(ctx, SEXP_G_MODULE_PATH) = sexp_reverse(ctx, x);
|
||||
sexp_global(ctx, SEXP_G_MODULE_PATH) = sexp_reverse(ctx, sexp_global(ctx, SEXP_G_MODULE_PATH));
|
||||
}
|
||||
return sexp_global(ctx, SEXP_G_MODULE_PATH);
|
||||
}
|
||||
sexp sexp_find_module_file_op (sexp ctx, sexp self, sexp_sint_t n, sexp file) {
|
||||
|
|
|
@ -96,7 +96,7 @@ SEXP_API sexp sexp_load_standard_ports (sexp context, sexp env, FILE* in, FILE*
|
|||
SEXP_API sexp sexp_load_standard_env (sexp context, sexp env, sexp version);
|
||||
SEXP_API sexp sexp_find_module_file (sexp ctx, const char *file);
|
||||
SEXP_API sexp sexp_load_module_file (sexp ctx, const char *file, sexp env);
|
||||
SEXP_API sexp sexp_current_module_path_op (sexp ctx, sexp self, sexp_sint_t n);
|
||||
SEXP_API sexp sexp_current_module_path_op (sexp ctx, sexp self, sexp_sint_t n, sexp x);
|
||||
SEXP_API sexp sexp_find_module_file_op (sexp ctx, sexp self, sexp_sint_t n, sexp file);
|
||||
SEXP_API sexp sexp_load_module_file_op (sexp ctx, sexp self, sexp_sint_t n, sexp file, sexp env);
|
||||
SEXP_API sexp sexp_add_module_directory_op (sexp ctx, sexp self, sexp_sint_t n, sexp dir, sexp appendp);
|
||||
|
|
|
@ -249,7 +249,7 @@ _FN0(_I(SEXP_ENV), "current-environment", 0, sexp_current_environment),
|
|||
_FN1(_I(SEXP_ENV), _I(SEXP_ENV), "set-current-environment!", 0, sexp_set_current_environment),
|
||||
_FN0(_I(SEXP_ENV), "%meta-env", 0, sexp_meta_environment),
|
||||
_FN1(SEXP_NULL, _I(SEXP_ENV), "env-exports", 0, sexp_env_exports_op),
|
||||
_FN0(_I(SEXP_PAIR), "current-module-path", 0, sexp_current_module_path_op),
|
||||
_FN1OPT(_I(SEXP_PAIR), _I(SEXP_PAIR), "current-module-path", SEXP_FALSE, sexp_current_module_path_op),
|
||||
_FN1(_I(SEXP_STRING), _I(SEXP_STRING), "find-module-file", 0, sexp_find_module_file_op),
|
||||
_FN2(SEXP_VOID, _I(SEXP_STRING), _I(SEXP_ENV), "load-module-file", 0, sexp_load_module_file_op),
|
||||
_FN2(SEXP_VOID, _I(SEXP_STRING), _I(SEXP_BOOLEAN), "add-module-directory", 0, sexp_add_module_directory_op),
|
||||
|
|
Loading…
Add table
Reference in a new issue