modules.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712
  1. /* Copyright (C) 1998,2000,2001 Free Software Foundation, Inc.
  2. *
  3. * This program is free software; you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation; either version 2, or (at your option)
  6. * any later version.
  7. *
  8. * This program 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
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this software; see the file COPYING. If not, write to
  15. * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16. * Boston, MA 02110-1301 USA
  17. *
  18. * As a special exception, the Free Software Foundation gives permission
  19. * for additional uses of the text contained in its release of GUILE.
  20. *
  21. * The exception is that, if you link the GUILE library with other files
  22. * to produce an executable, this does not by itself cause the
  23. * resulting executable to be covered by the GNU General Public License.
  24. * Your use of that executable is in no way restricted on account of
  25. * linking the GUILE library code into it.
  26. *
  27. * This exception does not however invalidate any other reasons why
  28. * the executable file might be covered by the GNU General Public License.
  29. *
  30. * This exception applies only to the code released by the
  31. * Free Software Foundation under the name GUILE. If you copy
  32. * code from other Free Software Foundation releases into a copy of
  33. * GUILE, as the General Public License permits, the exception does
  34. * not apply to the code that you add in this way. To avoid misleading
  35. * anyone as to the status of such modified files, you must delete
  36. * this exception notice from them.
  37. *
  38. * If you write modifications of your own for GUILE, it is your choice
  39. * whether to permit this exception to apply to your modifications.
  40. * If you do not wish that, delete this exception notice. */
  41. #include <stdarg.h>
  42. #include "libguile/_scm.h"
  43. #include "libguile/eval.h"
  44. #include "libguile/smob.h"
  45. #include "libguile/procprop.h"
  46. #include "libguile/vectors.h"
  47. #include "libguile/hashtab.h"
  48. #include "libguile/struct.h"
  49. #include "libguile/variable.h"
  50. #include "libguile/fluids.h"
  51. #include "libguile/deprecation.h"
  52. #include "libguile/modules.h"
  53. int scm_module_system_booted_p = 0;
  54. scm_t_bits scm_module_tag;
  55. static SCM the_module;
  56. SCM_DEFINE (scm_current_module, "current-module", 0, 0, 0,
  57. (),
  58. "Return the current module.")
  59. #define FUNC_NAME s_scm_current_module
  60. {
  61. return scm_fluid_ref (the_module);
  62. }
  63. #undef FUNC_NAME
  64. static void scm_post_boot_init_modules (void);
  65. SCM_DEFINE (scm_set_current_module, "set-current-module", 1, 0, 0,
  66. (SCM module),
  67. "Set the current module to @var{module} and return\n"
  68. "the previous current module.")
  69. #define FUNC_NAME s_scm_set_current_module
  70. {
  71. SCM old;
  72. if (!scm_module_system_booted_p)
  73. scm_post_boot_init_modules ();
  74. SCM_VALIDATE_MODULE (SCM_ARG1, module);
  75. old = scm_current_module ();
  76. scm_fluid_set_x (the_module, module);
  77. #if SCM_DEBUG_DEPRECATED == 0
  78. scm_fluid_set_x (SCM_VARIABLE_REF (scm_top_level_lookup_closure_var),
  79. scm_current_module_lookup_closure ());
  80. scm_fluid_set_x (SCM_VARIABLE_REF (scm_system_transformer),
  81. scm_current_module_transformer ());
  82. #endif
  83. return old;
  84. }
  85. #undef FUNC_NAME
  86. SCM_DEFINE (scm_interaction_environment, "interaction-environment", 0, 0, 0,
  87. (),
  88. "Return a specifier for the environment that contains\n"
  89. "implementation--defined bindings, typically a superset of those\n"
  90. "listed in the report. The intent is that this procedure will\n"
  91. "return the environment in which the implementation would\n"
  92. "evaluate expressions dynamically typed by the user.")
  93. #define FUNC_NAME s_scm_interaction_environment
  94. {
  95. return scm_current_module ();
  96. }
  97. #undef FUNC_NAME
  98. SCM
  99. scm_c_call_with_current_module (SCM module,
  100. SCM (*func)(void *), void *data)
  101. {
  102. return scm_c_with_fluid (the_module, module, func, data);
  103. }
  104. static SCM
  105. convert_module_name (const char *name)
  106. {
  107. SCM list = SCM_EOL;
  108. SCM *tail = &list;
  109. const char *ptr;
  110. while (*name)
  111. {
  112. while (*name == ' ')
  113. name++;
  114. ptr = name;
  115. while (*ptr && *ptr != ' ')
  116. ptr++;
  117. if (ptr > name)
  118. {
  119. *tail = scm_cons (scm_mem2symbol (name, ptr-name), SCM_EOL);
  120. tail = SCM_CDRLOC (*tail);
  121. }
  122. name = ptr;
  123. }
  124. return list;
  125. }
  126. static SCM process_define_module_var;
  127. static SCM process_use_modules_var;
  128. static SCM resolve_module_var;
  129. SCM
  130. scm_c_resolve_module (const char *name)
  131. {
  132. return scm_resolve_module (convert_module_name (name));
  133. }
  134. SCM
  135. scm_resolve_module (SCM name)
  136. {
  137. return scm_call_1 (SCM_VARIABLE_REF (resolve_module_var), name);
  138. }
  139. SCM
  140. scm_c_define_module (const char *name,
  141. void (*init)(void *), void *data)
  142. {
  143. SCM module = scm_call_1 (SCM_VARIABLE_REF (process_define_module_var),
  144. scm_list_1 (convert_module_name (name)));
  145. if (init)
  146. scm_c_call_with_current_module (module, (SCM (*)(void*))init, data);
  147. return module;
  148. }
  149. void
  150. scm_c_use_module (const char *name)
  151. {
  152. scm_call_1 (SCM_VARIABLE_REF (process_use_modules_var),
  153. scm_list_1 (scm_list_1 (convert_module_name (name))));
  154. }
  155. static SCM module_export_x_var;
  156. void
  157. scm_c_export (const char *name, ...)
  158. {
  159. if (name)
  160. {
  161. va_list ap;
  162. SCM names = scm_cons (scm_str2symbol (name), SCM_EOL);
  163. SCM *tail = SCM_CDRLOC (names);
  164. va_start (ap, name);
  165. while (1)
  166. {
  167. const char *n = va_arg (ap, const char *);
  168. if (n == NULL)
  169. break;
  170. *tail = scm_cons (scm_str2symbol (n), SCM_EOL);
  171. tail = SCM_CDRLOC (*tail);
  172. }
  173. va_end (ap);
  174. scm_call_2 (SCM_VARIABLE_REF (module_export_x_var),
  175. scm_current_module (), names);
  176. }
  177. }
  178. /* Environments */
  179. SCM
  180. scm_top_level_env (SCM thunk)
  181. {
  182. if (SCM_IMP (thunk))
  183. return SCM_EOL;
  184. else
  185. return scm_cons (thunk, SCM_EOL);
  186. }
  187. SCM
  188. scm_env_top_level (SCM env)
  189. {
  190. while (SCM_NIMP (env))
  191. {
  192. if (!SCM_CONSP (SCM_CAR (env))
  193. && SCM_NFALSEP (scm_procedure_p (SCM_CAR (env))))
  194. return SCM_CAR (env);
  195. env = SCM_CDR (env);
  196. }
  197. return SCM_BOOL_F;
  198. }
  199. SCM_SYMBOL (sym_module, "module");
  200. static SCM the_root_module_var;
  201. static SCM
  202. the_root_module ()
  203. {
  204. if (scm_module_system_booted_p)
  205. return SCM_VARIABLE_REF (the_root_module_var);
  206. else
  207. return SCM_BOOL_F;
  208. }
  209. SCM
  210. scm_lookup_closure_module (SCM proc)
  211. {
  212. if (SCM_FALSEP (proc))
  213. return the_root_module ();
  214. else if (SCM_EVAL_CLOSURE_P (proc))
  215. return SCM_PACK (SCM_SMOB_DATA (proc));
  216. else
  217. {
  218. SCM mod = scm_procedure_property (proc, sym_module);
  219. if (mod == SCM_BOOL_F)
  220. mod = the_root_module ();
  221. return mod;
  222. }
  223. }
  224. SCM_DEFINE (scm_env_module, "env-module", 1, 0, 0,
  225. (SCM env),
  226. "Return the module of @var{ENV}, a lexical environment.")
  227. #define FUNC_NAME s_scm_env_module
  228. {
  229. return scm_lookup_closure_module (scm_env_top_level (env));
  230. }
  231. #undef FUNC_NAME
  232. /*
  233. * C level implementation of the standard eval closure
  234. *
  235. * This increases loading speed substantially.
  236. * The code will be replaced by the low-level environments in next release.
  237. */
  238. static SCM module_make_local_var_x_var;
  239. static SCM
  240. module_variable (SCM module, SCM sym)
  241. {
  242. /* 1. Check module obarray */
  243. SCM b = scm_hashq_ref (SCM_MODULE_OBARRAY (module), sym, SCM_UNDEFINED);
  244. if (SCM_VARIABLEP (b))
  245. return b;
  246. {
  247. SCM binder = SCM_MODULE_BINDER (module);
  248. if (SCM_NFALSEP (binder))
  249. /* 2. Custom binder */
  250. {
  251. b = scm_call_3 (binder, module, sym, SCM_BOOL_F);
  252. if (SCM_NFALSEP (b))
  253. return b;
  254. }
  255. }
  256. {
  257. /* 3. Search the use list */
  258. SCM uses = SCM_MODULE_USES (module);
  259. while (SCM_CONSP (uses))
  260. {
  261. b = module_variable (SCM_CAR (uses), sym);
  262. if (SCM_NFALSEP (b))
  263. return b;
  264. uses = SCM_CDR (uses);
  265. }
  266. return SCM_BOOL_F;
  267. }
  268. }
  269. scm_t_bits scm_tc16_eval_closure;
  270. #define SCM_F_EVAL_CLOSURE_INTERFACE (1<<16)
  271. #define SCM_EVAL_CLOSURE_INTERFACE_P(e) \
  272. (SCM_CELL_WORD_0 (e) & SCM_F_EVAL_CLOSURE_INTERFACE)
  273. /* NOTE: This function may be called by a smob application
  274. or from another C function directly. */
  275. SCM
  276. scm_eval_closure_lookup (SCM eclo, SCM sym, SCM definep)
  277. {
  278. SCM module = SCM_PACK (SCM_SMOB_DATA (eclo));
  279. if (SCM_NFALSEP (definep))
  280. {
  281. if (SCM_EVAL_CLOSURE_INTERFACE_P (eclo))
  282. return SCM_BOOL_F;
  283. return scm_call_2 (SCM_VARIABLE_REF (module_make_local_var_x_var),
  284. module, sym);
  285. }
  286. else
  287. return module_variable (module, sym);
  288. }
  289. SCM_DEFINE (scm_standard_eval_closure, "standard-eval-closure", 1, 0, 0,
  290. (SCM module),
  291. "Return an eval closure for the module @var{module}.")
  292. #define FUNC_NAME s_scm_standard_eval_closure
  293. {
  294. SCM_RETURN_NEWSMOB (scm_tc16_eval_closure, SCM_UNPACK (module));
  295. }
  296. #undef FUNC_NAME
  297. SCM_DEFINE (scm_standard_interface_eval_closure,
  298. "standard-interface-eval-closure", 1, 0, 0,
  299. (SCM module),
  300. "Return a interface eval closure for the module @var{module}. "
  301. "Such a closure does not allow new bindings to be added.")
  302. #define FUNC_NAME s_scm_standard_interface_eval_closure
  303. {
  304. SCM_RETURN_NEWSMOB (scm_tc16_eval_closure | SCM_F_EVAL_CLOSURE_INTERFACE,
  305. SCM_UNPACK (module));
  306. }
  307. #undef FUNC_NAME
  308. SCM
  309. scm_module_lookup_closure (SCM module)
  310. {
  311. if (module == SCM_BOOL_F)
  312. return SCM_BOOL_F;
  313. else
  314. return SCM_MODULE_EVAL_CLOSURE (module);
  315. }
  316. SCM
  317. scm_current_module_lookup_closure ()
  318. {
  319. if (scm_module_system_booted_p)
  320. return scm_module_lookup_closure (scm_current_module ());
  321. else
  322. return SCM_BOOL_F;
  323. }
  324. SCM
  325. scm_module_transformer (SCM module)
  326. {
  327. if (module == SCM_BOOL_F)
  328. return SCM_BOOL_F;
  329. else
  330. return SCM_MODULE_TRANSFORMER (module);
  331. }
  332. SCM
  333. scm_current_module_transformer ()
  334. {
  335. if (scm_module_system_booted_p)
  336. return scm_module_transformer (scm_current_module ());
  337. else
  338. return SCM_BOOL_F;
  339. }
  340. /* scm_sym2var
  341. *
  342. * looks up the variable bound to SYM according to PROC. PROC should be
  343. * a `eval closure' of some module.
  344. *
  345. * When no binding exists, and DEFINEP is true, create a new binding
  346. * with a initial value of SCM_UNDEFINED. Return `#f' when DEFINEP as
  347. * false and no binding exists.
  348. *
  349. * When PROC is `#f', it is ignored and the binding is searched for in
  350. * the scm_pre_modules_obarray (a `eq' hash table).
  351. */
  352. SCM scm_pre_modules_obarray;
  353. SCM
  354. scm_sym2var (SCM sym, SCM proc, SCM definep)
  355. #define FUNC_NAME "scm_sym2var"
  356. {
  357. SCM var;
  358. if (SCM_NIMP (proc))
  359. {
  360. if (SCM_EVAL_CLOSURE_P (proc))
  361. {
  362. /* Bypass evaluator in the standard case. */
  363. var = scm_eval_closure_lookup (proc, sym, definep);
  364. }
  365. else
  366. var = scm_call_2 (proc, sym, definep);
  367. }
  368. else
  369. {
  370. SCM handle;
  371. if (definep == SCM_BOOL_F)
  372. var = scm_hashq_ref (scm_pre_modules_obarray, sym, SCM_BOOL_F);
  373. else
  374. {
  375. handle = scm_hashq_create_handle_x (scm_pre_modules_obarray,
  376. sym, SCM_BOOL_F);
  377. var = SCM_CDR (handle);
  378. if (var == SCM_BOOL_F)
  379. {
  380. var = scm_make_variable (SCM_UNDEFINED);
  381. #if SCM_ENABLE_VCELLS
  382. scm_variable_set_name_hint (var, sym);
  383. #endif
  384. SCM_SETCDR (handle, var);
  385. }
  386. }
  387. }
  388. if (var != SCM_BOOL_F && !SCM_VARIABLEP (var))
  389. SCM_MISC_ERROR ("~S is not bound to a variable", scm_list_1 (sym));
  390. return var;
  391. }
  392. #undef FUNC_NAME
  393. SCM
  394. scm_c_module_lookup (SCM module, const char *name)
  395. {
  396. return scm_module_lookup (module, scm_str2symbol (name));
  397. }
  398. SCM
  399. scm_module_lookup (SCM module, SCM sym)
  400. #define FUNC_NAME "module-lookup"
  401. {
  402. SCM var;
  403. SCM_VALIDATE_MODULE (1, module);
  404. var = scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_F);
  405. if (SCM_FALSEP (var))
  406. SCM_MISC_ERROR ("unbound variable: ~S", scm_list_1 (sym));
  407. return var;
  408. }
  409. #undef FUNC_NAME
  410. SCM
  411. scm_c_lookup (const char *name)
  412. {
  413. return scm_lookup (scm_str2symbol (name));
  414. }
  415. SCM
  416. scm_lookup (SCM sym)
  417. {
  418. SCM var =
  419. scm_sym2var (sym, scm_current_module_lookup_closure (), SCM_BOOL_F);
  420. if (SCM_FALSEP (var))
  421. scm_misc_error ("scm_lookup", "unbound variable: ~S", scm_list_1 (sym));
  422. return var;
  423. }
  424. SCM
  425. scm_c_module_define (SCM module, const char *name, SCM value)
  426. {
  427. return scm_module_define (module, scm_str2symbol (name), value);
  428. }
  429. SCM
  430. scm_module_define (SCM module, SCM sym, SCM value)
  431. #define FUNC_NAME "module-define"
  432. {
  433. SCM var;
  434. SCM_VALIDATE_MODULE (1, module);
  435. var = scm_sym2var (sym, scm_module_lookup_closure (module), SCM_BOOL_T);
  436. SCM_VARIABLE_SET (var, value);
  437. return var;
  438. }
  439. #undef FUNC_NAME
  440. SCM
  441. scm_c_define (const char *name, SCM value)
  442. {
  443. return scm_define (scm_str2symbol (name), value);
  444. }
  445. SCM
  446. scm_define (SCM sym, SCM value)
  447. {
  448. SCM var =
  449. scm_sym2var (sym, scm_current_module_lookup_closure (), SCM_BOOL_T);
  450. SCM_VARIABLE_SET (var, value);
  451. return var;
  452. }
  453. SCM
  454. scm_module_reverse_lookup (SCM module, SCM variable)
  455. #define FUNC_NAME "module-reverse-lookup"
  456. {
  457. SCM obarray;
  458. long i, n;
  459. if (module == SCM_BOOL_F)
  460. obarray = scm_pre_modules_obarray;
  461. else
  462. {
  463. SCM_VALIDATE_MODULE (1, module);
  464. obarray = SCM_MODULE_OBARRAY (module);
  465. }
  466. /* XXX - We do not use scm_hash_fold here to avoid searching the
  467. whole obarray. We should have a scm_hash_find procedure. */
  468. n = SCM_VECTOR_LENGTH (obarray);
  469. for (i = 0; i < n; ++i)
  470. {
  471. SCM ls = SCM_VELTS (obarray)[i], handle;
  472. while (!SCM_NULLP (ls))
  473. {
  474. handle = SCM_CAR (ls);
  475. if (SCM_CDR (handle) == variable)
  476. return SCM_CAR (handle);
  477. ls = SCM_CDR (ls);
  478. }
  479. }
  480. /* Try the `uses' list.
  481. */
  482. {
  483. SCM uses = SCM_MODULE_USES (module);
  484. while (SCM_CONSP (uses))
  485. {
  486. SCM sym = scm_module_reverse_lookup (SCM_CAR (uses), variable);
  487. if (sym != SCM_BOOL_F)
  488. return sym;
  489. uses = SCM_CDR (uses);
  490. }
  491. }
  492. return SCM_BOOL_F;
  493. }
  494. #undef FUNC_NAME
  495. SCM_DEFINE (scm_get_pre_modules_obarray, "%get-pre-modules-obarray", 0, 0, 0,
  496. (),
  497. "Return the obarray that is used for all new bindings before "
  498. "the module system is booted. The first call to "
  499. "@code{set-current-module} will boot the module system.")
  500. #define FUNC_NAME s_scm_get_pre_modules_obarray
  501. {
  502. return scm_pre_modules_obarray;
  503. }
  504. #undef FUNC_NAME
  505. #if SCM_DEBUG_DEPRECATED == 0
  506. static SCM root_module_lookup_closure;
  507. SCM_SYMBOL (scm_sym_app, "app");
  508. SCM_SYMBOL (scm_sym_modules, "modules");
  509. static SCM module_prefix;
  510. static SCM make_modules_in_var;
  511. static SCM beautify_user_module_x_var;
  512. static SCM try_module_autoload_var;
  513. #endif
  514. SCM_SYMBOL (scm_sym_system_module, "system-module");
  515. SCM
  516. scm_system_module_env_p (SCM env)
  517. {
  518. SCM proc = scm_env_top_level (env);
  519. if (SCM_FALSEP (proc))
  520. return SCM_BOOL_T;
  521. return ((SCM_NFALSEP (scm_procedure_property (proc,
  522. scm_sym_system_module)))
  523. ? SCM_BOOL_T
  524. : SCM_BOOL_F);
  525. }
  526. void
  527. scm_modules_prehistory ()
  528. {
  529. scm_pre_modules_obarray
  530. = scm_permanent_object (scm_c_make_hash_table (2001));
  531. }
  532. void
  533. scm_init_modules ()
  534. {
  535. #include "libguile/modules.x"
  536. module_make_local_var_x_var = scm_c_define ("module-make-local-var!",
  537. SCM_UNDEFINED);
  538. scm_tc16_eval_closure = scm_make_smob_type ("eval-closure", 0);
  539. scm_set_smob_mark (scm_tc16_eval_closure, scm_markcdr);
  540. scm_set_smob_apply (scm_tc16_eval_closure, scm_eval_closure_lookup, 2, 0, 0);
  541. the_module = scm_permanent_object (scm_make_fluid ());
  542. }
  543. static void
  544. scm_post_boot_init_modules ()
  545. {
  546. #define PERM(x) scm_permanent_object(x)
  547. SCM module_type = SCM_VARIABLE_REF (scm_c_lookup ("module-type"));
  548. scm_module_tag = (SCM_CELL_WORD_1 (module_type) + scm_tc3_cons_gloc);
  549. resolve_module_var = PERM (scm_c_lookup ("resolve-module"));
  550. process_define_module_var = PERM (scm_c_lookup ("process-define-module"));
  551. process_use_modules_var = PERM (scm_c_lookup ("process-use-modules"));
  552. module_export_x_var = PERM (scm_c_lookup ("module-export!"));
  553. the_root_module_var = PERM (scm_c_lookup ("the-root-module"));
  554. #if SCM_DEBUG_DEPRECATED == 0
  555. module_prefix = PERM (scm_list_2 (scm_sym_app, scm_sym_modules));
  556. make_modules_in_var = PERM (scm_c_lookup ("make-modules-in"));
  557. root_module_lookup_closure =
  558. PERM (scm_module_lookup_closure (SCM_VARIABLE_REF (the_root_module_var)));
  559. beautify_user_module_x_var = PERM (scm_c_lookup ("beautify-user-module!"));
  560. try_module_autoload_var = PERM (scm_c_lookup ("try-module-autoload"));
  561. #endif
  562. scm_module_system_booted_p = 1;
  563. }
  564. #if SCM_DEBUG_DEPRECATED == 0
  565. SCM
  566. scm_the_root_module ()
  567. {
  568. scm_c_issue_deprecation_warning ("`scm_the_root_module' is deprecated. "
  569. "Use `scm_c_resolve_module (\"guile\")' "
  570. "instead.");
  571. return the_root_module ();
  572. }
  573. static SCM
  574. scm_module_full_name (SCM name)
  575. {
  576. if (SCM_EQ_P (SCM_CAR (name), scm_sym_app))
  577. return name;
  578. else
  579. return scm_append (scm_list_2 (module_prefix, name));
  580. }
  581. SCM
  582. scm_make_module (SCM name)
  583. {
  584. scm_c_issue_deprecation_warning ("`scm_make_module' is deprecated. "
  585. "Use `scm_c_define_module instead.");
  586. return scm_call_2 (SCM_VARIABLE_REF (make_modules_in_var),
  587. scm_the_root_module (),
  588. scm_module_full_name (name));
  589. }
  590. SCM
  591. scm_ensure_user_module (SCM module)
  592. {
  593. scm_c_issue_deprecation_warning ("`scm_ensure_user_module' is deprecated. "
  594. "Use `scm_c_define_module instead.");
  595. scm_call_1 (SCM_VARIABLE_REF (beautify_user_module_x_var), module);
  596. return SCM_UNSPECIFIED;
  597. }
  598. SCM
  599. scm_load_scheme_module (SCM name)
  600. {
  601. scm_c_issue_deprecation_warning ("`scm_load_scheme_module' is deprecated. "
  602. "Use `scm_c_resolve_module instead.");
  603. return scm_call_1 (SCM_VARIABLE_REF (try_module_autoload_var), name);
  604. }
  605. #endif
  606. /*
  607. Local Variables:
  608. c-file-style: "gnu"
  609. End:
  610. */