unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Modules: first steps.
@ 2002-09-15 23:42 Han-Wen Nienhuys
  2002-09-18 20:41 ` Marius Vollmer
  0 siblings, 1 reply; 11+ messages in thread
From: Han-Wen Nienhuys @ 2002-09-15 23:42 UTC (permalink / raw)
  Cc: jantien


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   |   hanwen@cs.uu.nl   |   http://www.cs.uu.nl/~hanwen 


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2002-09-21 21:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-15 23:42 Modules: first steps Han-Wen Nienhuys
2002-09-18 20:41 ` Marius Vollmer
2002-09-18 21:11   ` Tom Lord
2002-09-19  0:18   ` Han-Wen Nienhuys
2002-09-21 21:02     ` Marius Vollmer
2002-09-19 20:31   ` Han-Wen Nienhuys
2002-09-19 20:33     ` Rob Browning
2002-09-20 14:21     ` Martin Grabmueller
2002-09-20 22:40       ` Han-Wen Nienhuys
2002-09-19 20:38   ` Han-Wen Nienhuys
2002-09-21 21:07     ` Marius Vollmer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).