mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
scm_c_define_module uses define-module*
* libguile/modules.c (scm_c_define_module): * module/ice-9/boot-9.scm: Update to have the C function call define-module*.
This commit is contained in:
parent
f7f62d3ac5
commit
57ced5b97a
2 changed files with 8 additions and 8 deletions
|
@ -49,7 +49,7 @@ static SCM the_module;
|
||||||
boot-9 are needed to provide the Scheme interface. */
|
boot-9 are needed to provide the Scheme interface. */
|
||||||
static SCM the_root_module_var;
|
static SCM the_root_module_var;
|
||||||
static SCM module_make_local_var_x_var;
|
static SCM module_make_local_var_x_var;
|
||||||
static SCM process_define_module_var;
|
static SCM define_module_star_var;
|
||||||
static SCM process_use_modules_var;
|
static SCM process_use_modules_var;
|
||||||
static SCM resolve_module_var;
|
static SCM resolve_module_var;
|
||||||
static SCM module_public_interface_var;
|
static SCM module_public_interface_var;
|
||||||
|
@ -176,8 +176,8 @@ SCM
|
||||||
scm_c_define_module (const char *name,
|
scm_c_define_module (const char *name,
|
||||||
void (*init)(void *), void *data)
|
void (*init)(void *), void *data)
|
||||||
{
|
{
|
||||||
SCM module = scm_call_1 (SCM_VARIABLE_REF (process_define_module_var),
|
SCM module = scm_call_1 (SCM_VARIABLE_REF (define_module_star_var),
|
||||||
scm_list_1 (convert_module_name (name)));
|
convert_module_name (name));
|
||||||
if (init)
|
if (init)
|
||||||
scm_c_call_with_current_module (module, (SCM (*)(void*))init, data);
|
scm_c_call_with_current_module (module, (SCM (*)(void*))init, data);
|
||||||
return module;
|
return module;
|
||||||
|
@ -894,7 +894,7 @@ scm_post_boot_init_modules ()
|
||||||
scm_module_tag = (SCM_CELL_WORD_1 (module_type) + scm_tc3_struct);
|
scm_module_tag = (SCM_CELL_WORD_1 (module_type) + scm_tc3_struct);
|
||||||
|
|
||||||
resolve_module_var = scm_c_lookup ("resolve-module");
|
resolve_module_var = scm_c_lookup ("resolve-module");
|
||||||
process_define_module_var = scm_c_lookup ("process-define-module");
|
define_module_star_var = scm_c_lookup ("define-module*");
|
||||||
process_use_modules_var = scm_c_lookup ("process-use-modules");
|
process_use_modules_var = scm_c_lookup ("process-use-modules");
|
||||||
module_export_x_var = scm_c_lookup ("module-export!");
|
module_export_x_var = scm_c_lookup ("module-export!");
|
||||||
the_root_module_var = scm_c_lookup ("the-root-module");
|
the_root_module_var = scm_c_lookup ("the-root-module");
|
||||||
|
|
|
@ -2137,7 +2137,7 @@ If there is no handler at all, Guile prints an error and then exits."
|
||||||
;; Cheat. These bindings are needed by modules.c, but we don't want
|
;; Cheat. These bindings are needed by modules.c, but we don't want
|
||||||
;; to move their real definition here because that would be unnatural.
|
;; to move their real definition here because that would be unnatural.
|
||||||
;;
|
;;
|
||||||
(define process-define-module #f)
|
(define define-module* #f)
|
||||||
(define process-use-modules #f)
|
(define process-use-modules #f)
|
||||||
(define module-export! #f)
|
(define module-export! #f)
|
||||||
(define default-duplicate-binding-procedures #f)
|
(define default-duplicate-binding-procedures #f)
|
||||||
|
@ -2357,6 +2357,9 @@ If there is no handler at all, Guile prints an error and then exits."
|
||||||
(lambda (symbol)
|
(lambda (symbol)
|
||||||
(symbol-append prefix symbol)))
|
(symbol-append prefix symbol)))
|
||||||
|
|
||||||
|
;; This function is called from "modules.c". If you change it, be
|
||||||
|
;; sure to update "modules.c" as well.
|
||||||
|
|
||||||
(define* (define-module* name
|
(define* (define-module* name
|
||||||
#:key filename pure version (duplicates '())
|
#:key filename pure version (duplicates '())
|
||||||
(imports '()) (exports '()) (replacements '())
|
(imports '()) (exports '()) (replacements '())
|
||||||
|
@ -2432,9 +2435,6 @@ If there is no handler at all, Guile prints an error and then exits."
|
||||||
(run-hook module-defined-hook module)
|
(run-hook module-defined-hook module)
|
||||||
module))
|
module))
|
||||||
|
|
||||||
;; This function is called from "modules.c". If you change it, be
|
|
||||||
;; sure to update "modules.c" as well.
|
|
||||||
|
|
||||||
(define (process-define-module args)
|
(define (process-define-module args)
|
||||||
(define (missing kw)
|
(define (missing kw)
|
||||||
(error "missing argument to define-module keyword" kw))
|
(error "missing argument to define-module keyword" kw))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue