guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Modules: first steps.


From: Han-Wen Nienhuys
Subject: Modules: first steps.
Date: Mon, 16 Sep 2002 01:42:03 +0200

As an ouverture to the Grand Hacking  Branch of LilyPond, I'm
converting some of the internal variable systems in Lily to Scheme
anonymous modules.

Some questions:

 * Why set-current-module ?   I'd expect set-current-module!

 * How can I get a list of all the variables in a module (ok, I can
   figure that out by myself, but why is there no API entry for this?)

 * It would be nice if the C smob example also touched on module use.

 * I have in my code:

        void
        ly_init_guile ()
        {
          SCM last_mod = scm_current_module ();
          scm_set_current_module (scm_c_resolve_module ("lily"));

          scm_c_use_module ("guile");

          for (int i=scm_init_funcs_->size () ; i--;)
            (scm_init_funcs_->elem (i)) ();

          if (verbose_global_b)
            progress_indication ("\n");


          scm_primitive_load_path (scm_makfrom0str ("lily.scm"));

          scm_set_current_module (last_mod);
        }

   The lily.scm file has 

      (use-modules (ice-9 regex))

   at the top.

   I get

        blauw:~/usr/src/savannah/lily/lilypond$ lilypond
        lstat(/home/hanwen/bin/usr) failed ...
        /home/hanwen/bin/usr: Onbekend bestand of map
        GNU LilyPond 1.7.0ERROR: no code for module (guile)

    How do I make the module that defines use-module available to the
    .scm file?

  * extern void scm_c_use_module (const char *name);.

    Why is there no scm_use_module (SCM)? For anonymous modules, the
    storing the name just to use it with scm_c_use_module seems silly,
    in particular if that function  has to recover the SCM module
    object from the name again.



-- 

Han-Wen Nienhuys   |   address@hidden   |   http://www.cs.uu.nl/~hanwen 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]