This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

reading scheme variables into C code



what is the best way to achieve the following: 
one wants , in a C-written module for guile, to assign a value to a C variable.
The value can be taken from either an environment variable, or a scheme 
variable that is bound before the module gets dynamically loaded, or a built-
in default. This should happen according to the following priorities:
 
a) if the scheme variable is bound  and provides an admissible value for the
   C variable, , it's value is used.
b) if a) fails, and the environment variable is set to an admissible value , 
   the env.v. is used.
c) if both a) and b) fail, the built-in default is used.

The GNU emacs customization for many variables seems to work in a similar way,
so it should be a classic concept.

I want to use that customization approach for the initialization of a gsl lib
random generator, while wrapping the random distributions of gsl for guile.

     Klaus Schilling