- SCM tab= scm_c_make_hash_table (2);
- /* UGH. */
- SCM_STRUCT_DATA (ly_car (s))[scm_module_index_obarray]
- = (long unsigned int) tab;
+ /* Look up (evaluate) Scheme make-module function and call it */
+
+ mod = Guile_user::make_module ();
+ /*
+ Look up and call Guile module-export-all! or, when using
+ Guile V1.8, the compatible shim defined in lily.scm.
+ */
+#if GUILEV2
+ Guile_user::module_export_all_x (mod);
+#else
+ Lily::module_export_all_x (mod);
+#endif
+
+ /*
+ Evaluate Guile module "the-root-module",
+ and ensure we inherit definitions from it and the "lily" module
+ N.B. this used to be "the-scm-module" and is deprecated in
+ Guile V1.9/2.0
+ */
+
+ ly_use_module (mod, Guile_user::the_root_module);
+ ly_use_module (mod, Lily::module);
+ }
+ else
+ {
+ /* Evaluate and call make-safe-lilypond-module */
+ mod = Lily::make_safe_lilypond_module ();