(scm_is_eq): New.
[bpt/guile.git] / libguile / modules.c
CommitLineData
c35738c1 1/* Copyright (C) 1998,2000,2001,2002, 2003 Free Software Foundation, Inc.
1ffa265b 2 *
73be1d9e
MV
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
1ffa265b 7 *
73be1d9e
MV
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
1ffa265b 12 *
73be1d9e
MV
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
6e8d25a6 17
6e8d25a6 18
1ffa265b
MD
19\f
20
d02b98e9
MV
21#include <stdarg.h>
22
a0599745 23#include "libguile/_scm.h"
1ffa265b 24
a0599745 25#include "libguile/eval.h"
fb43bf74 26#include "libguile/smob.h"
a0599745 27#include "libguile/procprop.h"
152abe96
MD
28#include "libguile/vectors.h"
29#include "libguile/hashtab.h"
30#include "libguile/struct.h"
31#include "libguile/variable.h"
7f763132 32#include "libguile/fluids.h"
d02b98e9 33#include "libguile/deprecation.h"
1ffa265b 34
a0599745 35#include "libguile/modules.h"
1ffa265b 36
86d31dfe 37int scm_module_system_booted_p = 0;
e3365c07 38
92c2555f 39scm_t_bits scm_module_tag;
e3365c07 40
1ffa265b
MD
41static SCM the_module;
42
55000e5f
MV
43SCM_DEFINE (scm_current_module, "current-module", 0, 0, 0,
44 (),
45 "Return the current module.")
46#define FUNC_NAME s_scm_current_module
1ffa265b 47{
55000e5f 48 return scm_fluid_ref (the_module);
1ffa265b 49}
55000e5f 50#undef FUNC_NAME
1ffa265b 51
86d31dfe 52static void scm_post_boot_init_modules (void);
1ffa265b 53
55000e5f
MV
54SCM_DEFINE (scm_set_current_module, "set-current-module", 1, 0, 0,
55 (SCM module),
9401323e 56 "Set the current module to @var{module} and return\n"
55000e5f
MV
57 "the previous current module.")
58#define FUNC_NAME s_scm_set_current_module
1ffa265b 59{
55000e5f
MV
60 SCM old;
61
86d31dfe
MV
62 if (!scm_module_system_booted_p)
63 scm_post_boot_init_modules ();
64
65 SCM_VALIDATE_MODULE (SCM_ARG1, module);
55000e5f
MV
66
67 old = scm_current_module ();
68 scm_fluid_set_x (the_module, module);
69
1ffa265b
MD
70 return old;
71}
55000e5f 72#undef FUNC_NAME
1ffa265b 73
e3365c07
MD
74SCM_DEFINE (scm_interaction_environment, "interaction-environment", 0, 0, 0,
75 (),
1e6808ea
MG
76 "Return a specifier for the environment that contains\n"
77 "implementation--defined bindings, typically a superset of those\n"
78 "listed in the report. The intent is that this procedure will\n"
79 "return the environment in which the implementation would\n"
80 "evaluate expressions dynamically typed by the user.")
e3365c07
MD
81#define FUNC_NAME s_scm_interaction_environment
82{
aa767bc5 83 return scm_current_module ();
e3365c07
MD
84}
85#undef FUNC_NAME
86
1ffa265b 87SCM
d02b98e9
MV
88scm_c_call_with_current_module (SCM module,
89 SCM (*func)(void *), void *data)
1ffa265b 90{
d02b98e9 91 return scm_c_with_fluid (the_module, module, func, data);
1ffa265b
MD
92}
93
06e80f59
HWN
94
95/*
96 convert "A B C" to scheme list (A B C)
97 */
d02b98e9
MV
98static SCM
99convert_module_name (const char *name)
281004cc 100{
d02b98e9
MV
101 SCM list = SCM_EOL;
102 SCM *tail = &list;
281004cc 103
d02b98e9
MV
104 const char *ptr;
105 while (*name)
106 {
107 while (*name == ' ')
108 name++;
109 ptr = name;
110 while (*ptr && *ptr != ' ')
111 ptr++;
112 if (ptr > name)
113 {
114 *tail = scm_cons (scm_mem2symbol (name, ptr-name), SCM_EOL);
115 tail = SCM_CDRLOC (*tail);
116 }
117 name = ptr;
118 }
119
120 return list;
1ffa265b
MD
121}
122
d02b98e9
MV
123static SCM process_define_module_var;
124static SCM process_use_modules_var;
125static SCM resolve_module_var;
126
9e57344b 127SCM
d02b98e9 128scm_c_resolve_module (const char *name)
9e57344b 129{
d02b98e9 130 return scm_resolve_module (convert_module_name (name));
9e57344b
MV
131}
132
55000e5f 133SCM
d02b98e9 134scm_resolve_module (SCM name)
55000e5f 135{
fdc28395 136 return scm_call_1 (SCM_VARIABLE_REF (resolve_module_var), name);
55000e5f
MV
137}
138
139SCM
d02b98e9
MV
140scm_c_define_module (const char *name,
141 void (*init)(void *), void *data)
55000e5f 142{
fdc28395 143 SCM module = scm_call_1 (SCM_VARIABLE_REF (process_define_module_var),
1afff620 144 scm_list_1 (convert_module_name (name)));
d02b98e9
MV
145 if (init)
146 scm_c_call_with_current_module (module, (SCM (*)(void*))init, data);
147 return module;
55000e5f
MV
148}
149
d02b98e9
MV
150void
151scm_c_use_module (const char *name)
90184345 152{
fdc28395 153 scm_call_1 (SCM_VARIABLE_REF (process_use_modules_var),
b64f4200 154 scm_list_1 (scm_list_1 (convert_module_name (name))));
90184345
MD
155}
156
d02b98e9 157static SCM module_export_x_var;
281004cc 158
eb880cef 159
06e80f59
HWN
160/*
161 TODO: should export this function? --hwn.
162 */
163static SCM
164scm_export (SCM module, SCM namelist)
165{
8c330007
MD
166 return scm_call_2 (SCM_VARIABLE_REF (module_export_x_var),
167 module, namelist);
06e80f59
HWN
168}
169
eb880cef
MV
170
171/*
172 @code{scm_c_export}(@var{name-list})
173
174 @code{scm_c_export} exports the named bindings from the current
175 module, making them visible to users of the module. This function
176 takes a list of string arguments, terminated by NULL, e.g.
177
178 @example
179 scm_c_export ("add-double-record", "bamboozle-money", NULL);
180 @end example
181*/
d02b98e9
MV
182void
183scm_c_export (const char *name, ...)
281004cc 184{
eb880cef 185 if (name)
d02b98e9 186 {
eb880cef
MV
187 va_list ap;
188 SCM names = scm_cons (scm_str2symbol (name), SCM_EOL);
189 SCM *tail = SCM_CDRLOC (names);
190 va_start (ap, name);
191 while (1)
192 {
193 const char *n = va_arg (ap, const char *);
194 if (n == NULL)
195 break;
196 *tail = scm_cons (scm_str2symbol (n), SCM_EOL);
197 tail = SCM_CDRLOC (*tail);
198 }
199 va_end (ap);
06e80f59 200 scm_export (scm_current_module(), names);
d02b98e9 201 }
281004cc
MD
202}
203
06e80f59 204
e3365c07 205/* Environments */
d164a5af
MD
206
207SCM
6e8d25a6 208scm_top_level_env (SCM thunk)
d164a5af
MD
209{
210 if (SCM_IMP (thunk))
211 return SCM_EOL;
212 else
213 return scm_cons (thunk, SCM_EOL);
214}
215
216SCM
217scm_env_top_level (SCM env)
218{
c88b1456 219 while (SCM_CONSP (env))
d164a5af 220 {
c88b1456
DH
221 SCM car_env = SCM_CAR (env);
222 if (!SCM_CONSP (car_env) && !SCM_FALSEP (scm_procedure_p (car_env)))
223 return car_env;
d164a5af
MD
224 env = SCM_CDR (env);
225 }
226 return SCM_BOOL_F;
227}
228
86d31dfe
MV
229SCM_SYMBOL (sym_module, "module");
230
d02b98e9
MV
231static SCM the_root_module_var;
232
233static SCM
234the_root_module ()
235{
236 if (scm_module_system_booted_p)
237 return SCM_VARIABLE_REF (the_root_module_var);
238 else
239 return SCM_BOOL_F;
240}
241
86d31dfe
MV
242SCM
243scm_lookup_closure_module (SCM proc)
244{
245 if (SCM_FALSEP (proc))
d02b98e9 246 return the_root_module ();
86d31dfe
MV
247 else if (SCM_EVAL_CLOSURE_P (proc))
248 return SCM_PACK (SCM_SMOB_DATA (proc));
249 else
250 {
251 SCM mod = scm_procedure_property (proc, sym_module);
c88b1456 252 if (SCM_FALSEP (mod))
d02b98e9 253 mod = the_root_module ();
86d31dfe
MV
254 return mod;
255 }
256}
257
e24ca538
MV
258SCM_DEFINE (scm_env_module, "env-module", 1, 0, 0,
259 (SCM env),
260 "Return the module of @var{ENV}, a lexical environment.")
261#define FUNC_NAME s_scm_env_module
86d31dfe
MV
262{
263 return scm_lookup_closure_module (scm_env_top_level (env));
264}
e24ca538 265#undef FUNC_NAME
86d31dfe 266
152abe96
MD
267/*
268 * C level implementation of the standard eval closure
269 *
270 * This increases loading speed substantially.
271 * The code will be replaced by the low-level environments in next release.
272 */
273
86d31dfe 274static SCM module_make_local_var_x_var;
152abe96
MD
275
276static SCM
277module_variable (SCM module, SCM sym)
278{
dc187f33 279#define SCM_BOUND_THING_P(b) \
36245b66 280 (!SCM_FALSEP (b))
dc187f33 281
152abe96 282 /* 1. Check module obarray */
e3365c07 283 SCM b = scm_hashq_ref (SCM_MODULE_OBARRAY (module), sym, SCM_UNDEFINED);
dc187f33 284 if (SCM_BOUND_THING_P (b))
152abe96
MD
285 return b;
286 {
e3365c07 287 SCM binder = SCM_MODULE_BINDER (module);
c88b1456 288 if (!SCM_FALSEP (binder))
152abe96
MD
289 /* 2. Custom binder */
290 {
fdc28395 291 b = scm_call_3 (binder, module, sym, SCM_BOOL_F);
dc187f33 292 if (SCM_BOUND_THING_P (b))
152abe96
MD
293 return b;
294 }
295 }
296 {
297 /* 3. Search the use list */
e3365c07 298 SCM uses = SCM_MODULE_USES (module);
152abe96
MD
299 while (SCM_CONSP (uses))
300 {
301 b = module_variable (SCM_CAR (uses), sym);
dc187f33 302 if (SCM_BOUND_THING_P (b))
152abe96
MD
303 return b;
304 uses = SCM_CDR (uses);
305 }
306 return SCM_BOOL_F;
307 }
dc187f33 308#undef SCM_BOUND_THING_P
152abe96
MD
309}
310
92c2555f 311scm_t_bits scm_tc16_eval_closure;
152abe96 312
86d31dfe
MV
313#define SCM_F_EVAL_CLOSURE_INTERFACE (1<<16)
314#define SCM_EVAL_CLOSURE_INTERFACE_P(e) \
315 (SCM_CELL_WORD_0 (e) & SCM_F_EVAL_CLOSURE_INTERFACE)
316
fb43bf74
KN
317/* NOTE: This function may be called by a smob application
318 or from another C function directly. */
319SCM
320scm_eval_closure_lookup (SCM eclo, SCM sym, SCM definep)
152abe96 321{
fb43bf74 322 SCM module = SCM_PACK (SCM_SMOB_DATA (eclo));
c88b1456 323 if (!SCM_FALSEP (definep))
86d31dfe
MV
324 {
325 if (SCM_EVAL_CLOSURE_INTERFACE_P (eclo))
326 return SCM_BOOL_F;
fdc28395
KN
327 return scm_call_2 (SCM_VARIABLE_REF (module_make_local_var_x_var),
328 module, sym);
86d31dfe 329 }
152abe96
MD
330 else
331 return module_variable (module, sym);
332}
333
334SCM_DEFINE (scm_standard_eval_closure, "standard-eval-closure", 1, 0, 0,
335 (SCM module),
84526793 336 "Return an eval closure for the module @var{module}.")
152abe96
MD
337#define FUNC_NAME s_scm_standard_eval_closure
338{
e841c3e0 339 SCM_RETURN_NEWSMOB (scm_tc16_eval_closure, SCM_UNPACK (module));
152abe96
MD
340}
341#undef FUNC_NAME
342
86d31dfe
MV
343SCM_DEFINE (scm_standard_interface_eval_closure,
344 "standard-interface-eval-closure", 1, 0, 0,
345 (SCM module),
346 "Return a interface eval closure for the module @var{module}. "
347 "Such a closure does not allow new bindings to be added.")
348#define FUNC_NAME s_scm_standard_interface_eval_closure
349{
350 SCM_RETURN_NEWSMOB (scm_tc16_eval_closure | SCM_F_EVAL_CLOSURE_INTERFACE,
351 SCM_UNPACK (module));
352}
353#undef FUNC_NAME
354
d02b98e9
MV
355SCM
356scm_module_lookup_closure (SCM module)
357{
c88b1456 358 if (SCM_FALSEP (module))
d02b98e9
MV
359 return SCM_BOOL_F;
360 else
361 return SCM_MODULE_EVAL_CLOSURE (module);
362}
363
364SCM
365scm_current_module_lookup_closure ()
366{
367 if (scm_module_system_booted_p)
368 return scm_module_lookup_closure (scm_current_module ());
369 else
370 return SCM_BOOL_F;
371}
372
373SCM
374scm_module_transformer (SCM module)
375{
c88b1456 376 if (SCM_FALSEP (module))
d02b98e9
MV
377 return SCM_BOOL_F;
378 else
379 return SCM_MODULE_TRANSFORMER (module);
380}
381
382SCM
383scm_current_module_transformer ()
384{
385 if (scm_module_system_booted_p)
386 return scm_module_transformer (scm_current_module ());
387 else
388 return SCM_BOOL_F;
389}
390
109c2c9f
MD
391SCM_DEFINE (scm_module_import_interface, "module-import-interface", 2, 0, 0,
392 (SCM module, SCM sym),
393 "")
394#define FUNC_NAME s_scm_module_import_interface
395{
396#define SCM_BOUND_THING_P(b) (!SCM_FALSEP (b))
d583ce1a 397 SCM uses;
109c2c9f
MD
398 SCM_VALIDATE_MODULE (SCM_ARG1, module);
399 /* Search the use list */
d583ce1a 400 uses = SCM_MODULE_USES (module);
109c2c9f
MD
401 while (SCM_CONSP (uses))
402 {
2e945bcc 403 SCM _interface = SCM_CAR (uses);
109c2c9f 404 /* 1. Check module obarray */
2e945bcc 405 SCM b = scm_hashq_ref (SCM_MODULE_OBARRAY (_interface), sym, SCM_BOOL_F);
109c2c9f 406 if (SCM_BOUND_THING_P (b))
2e945bcc 407 return _interface;
109c2c9f 408 {
2e945bcc 409 SCM binder = SCM_MODULE_BINDER (_interface);
109c2c9f
MD
410 if (!SCM_FALSEP (binder))
411 /* 2. Custom binder */
412 {
2e945bcc 413 b = scm_call_3 (binder, _interface, sym, SCM_BOOL_F);
109c2c9f 414 if (SCM_BOUND_THING_P (b))
2e945bcc 415 return _interface;
109c2c9f
MD
416 }
417 }
418 /* 3. Search use list recursively. */
2e945bcc
SJ
419 _interface = scm_module_import_interface (_interface, sym);
420 if (!SCM_FALSEP (_interface))
421 return _interface;
109c2c9f
MD
422 uses = SCM_CDR (uses);
423 }
424 return SCM_BOOL_F;
425}
426#undef FUNC_NAME
427
86d31dfe
MV
428/* scm_sym2var
429 *
430 * looks up the variable bound to SYM according to PROC. PROC should be
431 * a `eval closure' of some module.
432 *
433 * When no binding exists, and DEFINEP is true, create a new binding
434 * with a initial value of SCM_UNDEFINED. Return `#f' when DEFINEP as
435 * false and no binding exists.
436 *
437 * When PROC is `#f', it is ignored and the binding is searched for in
438 * the scm_pre_modules_obarray (a `eq' hash table).
439 */
440
441SCM scm_pre_modules_obarray;
442
443SCM
444scm_sym2var (SCM sym, SCM proc, SCM definep)
445#define FUNC_NAME "scm_sym2var"
446{
447 SCM var;
448
449 if (SCM_NIMP (proc))
450 {
451 if (SCM_EVAL_CLOSURE_P (proc))
452 {
453 /* Bypass evaluator in the standard case. */
454 var = scm_eval_closure_lookup (proc, sym, definep);
455 }
456 else
fdc28395 457 var = scm_call_2 (proc, sym, definep);
86d31dfe
MV
458 }
459 else
460 {
461 SCM handle;
462
bcbd25b7 463 if (SCM_FALSEP (definep))
86d31dfe
MV
464 var = scm_hashq_ref (scm_pre_modules_obarray, sym, SCM_BOOL_F);
465 else
466 {
467 handle = scm_hashq_create_handle_x (scm_pre_modules_obarray,
468 sym, SCM_BOOL_F);
469 var = SCM_CDR (handle);
c88b1456 470 if (SCM_FALSEP (var))
86d31dfe
MV
471 {
472 var = scm_make_variable (SCM_UNDEFINED);
86d31dfe
MV
473 SCM_SETCDR (handle, var);
474 }
475 }
476 }
477
c88b1456 478 if (!SCM_FALSEP (var) && !SCM_VARIABLEP (var))
1afff620 479 SCM_MISC_ERROR ("~S is not bound to a variable", scm_list_1 (sym));
86d31dfe
MV
480
481 return var;
482}
483#undef FUNC_NAME
484
485SCM
486scm_c_module_lookup (SCM module, const char *name)
487{
488 return scm_module_lookup (module, scm_str2symbol (name));
489}
490
491SCM
492scm_module_lookup (SCM module, SCM sym)
493#define FUNC_NAME "module-lookup"
494{
495 SCM var;
496 SCM_VALIDATE_MODULE (1, module);
497
498 var = scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F);
499 if (SCM_FALSEP (var))
1afff620 500 SCM_MISC_ERROR ("unbound variable: ~S", scm_list_1 (sym));
86d31dfe
MV
501 return var;
502}
503#undef FUNC_NAME
504
505SCM
506scm_c_lookup (const char *name)
507{
508 return scm_lookup (scm_str2symbol (name));
509}
510
511SCM
512scm_lookup (SCM sym)
513{
514 SCM var =
515 scm_sym2var (sym, scm_current_module_lookup_closure (), SCM_BOOL_F);
516 if (SCM_FALSEP (var))
1afff620 517 scm_misc_error ("scm_lookup", "unbound variable: ~S", scm_list_1 (sym));
86d31dfe
MV
518 return var;
519}
520
521SCM
522scm_c_module_define (SCM module, const char *name, SCM value)
523{
524 return scm_module_define (module, scm_str2symbol (name), value);
525}
526
527SCM
528scm_module_define (SCM module, SCM sym, SCM value)
529#define FUNC_NAME "module-define"
530{
531 SCM var;
532 SCM_VALIDATE_MODULE (1, module);
533
534 var = scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_T);
535 SCM_VARIABLE_SET (var, value);
536 return var;
537}
538#undef FUNC_NAME
539
540SCM
541scm_c_define (const char *name, SCM value)
542{
543 return scm_define (scm_str2symbol (name), value);
544}
545
546SCM
547scm_define (SCM sym, SCM value)
548{
549 SCM var =
550 scm_sym2var (sym, scm_current_module_lookup_closure (), SCM_BOOL_T);
551 SCM_VARIABLE_SET (var, value);
552 return var;
553}
554
555SCM
556scm_module_reverse_lookup (SCM module, SCM variable)
557#define FUNC_NAME "module-reverse-lookup"
558{
559 SCM obarray;
c014a02e 560 long i, n;
86d31dfe 561
c88b1456 562 if (SCM_FALSEP (module))
86d31dfe
MV
563 obarray = scm_pre_modules_obarray;
564 else
565 {
566 SCM_VALIDATE_MODULE (1, module);
567 obarray = SCM_MODULE_OBARRAY (module);
568 }
569
6dc1cd1e
MV
570 if (!SCM_HASHTABLE_P (obarray))
571 return SCM_BOOL_F;
572
86d31dfe
MV
573 /* XXX - We do not use scm_hash_fold here to avoid searching the
574 whole obarray. We should have a scm_hash_find procedure. */
575
c35738c1 576 n = SCM_HASHTABLE_N_BUCKETS (obarray);
86d31dfe
MV
577 for (i = 0; i < n; ++i)
578 {
c35738c1 579 SCM ls = SCM_HASHTABLE_BUCKETS (obarray)[i], handle;
86d31dfe
MV
580 while (!SCM_NULLP (ls))
581 {
582 handle = SCM_CAR (ls);
583 if (SCM_CDR (handle) == variable)
584 return SCM_CAR (handle);
585 ls = SCM_CDR (ls);
586 }
587 }
588
589 /* Try the `uses' list.
590 */
591 {
592 SCM uses = SCM_MODULE_USES (module);
593 while (SCM_CONSP (uses))
594 {
595 SCM sym = scm_module_reverse_lookup (SCM_CAR (uses), variable);
c88b1456 596 if (!SCM_FALSEP (sym))
86d31dfe
MV
597 return sym;
598 uses = SCM_CDR (uses);
599 }
600 }
601
602 return SCM_BOOL_F;
603}
604#undef FUNC_NAME
605
606SCM_DEFINE (scm_get_pre_modules_obarray, "%get-pre-modules-obarray", 0, 0, 0,
607 (),
608 "Return the obarray that is used for all new bindings before "
609 "the module system is booted. The first call to "
610 "@code{set-current-module} will boot the module system.")
611#define FUNC_NAME s_scm_get_pre_modules_obarray
612{
613 return scm_pre_modules_obarray;
614}
615#undef FUNC_NAME
616
d02b98e9
MV
617SCM_SYMBOL (scm_sym_system_module, "system-module");
618
619SCM
620scm_system_module_env_p (SCM env)
621{
622 SCM proc = scm_env_top_level (env);
623 if (SCM_FALSEP (proc))
624 return SCM_BOOL_T;
c88b1456 625 return ((!SCM_FALSEP (scm_procedure_property (proc,
d02b98e9
MV
626 scm_sym_system_module)))
627 ? SCM_BOOL_T
628 : SCM_BOOL_F);
629}
630
86d31dfe
MV
631void
632scm_modules_prehistory ()
633{
634 scm_pre_modules_obarray
231a4ea8 635 = scm_permanent_object (scm_c_make_hash_table (1533));
86d31dfe
MV
636}
637
1ffa265b
MD
638void
639scm_init_modules ()
640{
a0599745 641#include "libguile/modules.x"
86d31dfe
MV
642 module_make_local_var_x_var = scm_c_define ("module-make-local-var!",
643 SCM_UNDEFINED);
e841c3e0
KN
644 scm_tc16_eval_closure = scm_make_smob_type ("eval-closure", 0);
645 scm_set_smob_mark (scm_tc16_eval_closure, scm_markcdr);
646 scm_set_smob_apply (scm_tc16_eval_closure, scm_eval_closure_lookup, 2, 0, 0);
55000e5f
MV
647
648 the_module = scm_permanent_object (scm_make_fluid ());
1ffa265b
MD
649}
650
86d31dfe 651static void
1ffa265b
MD
652scm_post_boot_init_modules ()
653{
86d31dfe
MV
654#define PERM(x) scm_permanent_object(x)
655
656 SCM module_type = SCM_VARIABLE_REF (scm_c_lookup ("module-type"));
904a077d 657 scm_module_tag = (SCM_CELL_WORD_1 (module_type) + scm_tc3_struct);
d02b98e9
MV
658
659 resolve_module_var = PERM (scm_c_lookup ("resolve-module"));
660 process_define_module_var = PERM (scm_c_lookup ("process-define-module"));
661 process_use_modules_var = PERM (scm_c_lookup ("process-use-modules"));
662 module_export_x_var = PERM (scm_c_lookup ("module-export!"));
663 the_root_module_var = PERM (scm_c_lookup ("the-root-module"));
664
e3365c07 665 scm_module_system_booted_p = 1;
1ffa265b 666}
89e00824
ML
667
668/*
669 Local Variables:
670 c-file-style: "gnu"
671 End:
672*/