--- doc/ref/api-modules.texi.1.8.3 2007-07-10 18:27:30.000000000 -0400 +++ doc/ref/api-modules.texi 2008-01-25 20:48:50.000000000 -0500 @@ -33,7 +33,7 @@ another module with different names. More advanced module systems have become a common feature in recently -designed languages: ML, Python, Perl, and Modula 3 all allow the +designed languages: ML, Python, Perl, Ruby, and Modula 3 all allow the @emph{renaming} of objects from a foreign module, so they will not clutter the global name space. @cindex name space - private @@ -472,7 +472,15 @@ SRFI-19, on the other hand, exports its own version of @code{current-time} (@pxref{SRFI-19 Time}) which is not compatible with the core @code{current-time} function (@pxref{Time}). Therefore, -SRFI-19 does not use @code{#:replace}. +SRFI-19 does not use @code{#:replace}. You can use @xref{Module System Reflection} to tell it to use @code{#:replace} anyway: address@hidden +(module-replace! (resolve-module '(srfi srfi-19)) '(current-time)) +(use-modules ((srfi srfi-19))) address@hidden smalllisp +but you may be better off rewriting your code using a special prefix: address@hidden +(use-modules ((srfi srfi-19) #:renamer (symbol-prefix-proc 'srfi-19:))) address@hidden smalllisp The @code{#:replace} option can also be used by a module which is intentionally producing a new special kind of environment and should @@ -545,6 +553,9 @@ (replace warn-override-core warn last) @end smalllisp +The declared set of duplicate binding handlers for a given module can +be found with using @xref{Module Reflection}. + @item #:no-backtrace @cindex no backtrace Tell Guile not to record information for procedure backtraces when @@ -632,6 +643,95 @@ likely be a module returned by @code{resolve-interface}. @end deffn address@hidden {Scheme Procedure} module-define! module name value +Define the @var{name} in @var{module} to mean @var{value}, adding it +to the module if necessary. The return value is unspecified. address@hidden deffn + address@hidden {Scheme Procedure} module-name module +Return the name of the module object @var{module} as a list of symbols. address@hidden deffn + address@hidden {Scheme Procedure} module-defined? module name +Return #t iff @var{name} is defined in @var{module} (or in a module +that @var{module} uses). address@hidden deffn + address@hidden {Scheme Procedure} module-ref module symbol [default] +Return the value of @var{symbol} in @var{module} or in any of its used +modules. If there is no such variable, then if @var{default} is +present, it is returned; otherwise an error is signaled. See also address@hidden address@hidden deffn + address@hidden FIXME: Ludovic, please review carefully? address@hidden {Scheme Procedure} module-variable module variable address@hidden {C Function} module_reverse_lookup module scm_variable +Return the local variable associated with the symbol @var{variable} in +the module @var{module}, or in any of the modules it uses. This +differs from module-ref in that it returns the variable object itself, +rather than the value of the variable: See @xref{Variables}. address@hidden deffn + address@hidden {Scheme Procedure} module-set! module symbol value +Set the value of @var{symbol} in @var{module} to @var{value}. If +there is no such variable, an error is signaled. The return value is +unspecified. See also @xref{Variables} address@hidden deffn + address@hidden {Scheme Procedure} module-map proc module +Call @var{proc} on each symbol in @var{module} with arguments of address@hidden(symbol variable)}, returning a list of the results. address@hidden deffn + address@hidden {Scheme Procedure} module-for-each proc module +Call @var{proc} on each symbol in @var{module} with arguments of address@hidden(symbol variable)} for side effects, with an unspecified return +value. address@hidden deffn + address@hidden {Scheme Procedure} module-export! module exports-list +Add the module-defined symbols in @var{exports-list} to the public +interface for @var{module}. This must be called before (use-modules address@hidden) to have any effect. The return value is unspecified. address@hidden deffn + address@hidden {Scheme Procedure} module-replace! module replacements +Add the the module-defined symbols in @var{replacements} to the public +interface for @var{module}, so that they will silently override any +pre-existing conflicting symbols in the importing environment, +provided users of @var{module} use the @code{replace} duplicate +binding handler (@pxref{Creating Guile Modules, the @code{#:replace} +option}). address@hidden deffn + address@hidden {Scheme Procedure} module-re-export! module re-exports-list +Add the module-imported symbols in @var{re-exports-list} to the public +interface for @var{module}. This must be called before (use-modules address@hidden) to have any effect. The return value is unspecified. address@hidden deffn + address@hidden {Scheme Procedure} module-remove! module symbol +Make sure that @var{symbol} is undefined in the local namespace of @var{module} address@hidden deffn + address@hidden {Scheme Procedure} module-public-interface module +Return the module object which is the public interface for address@hidden For more about the relationships between the public +interface for a module and its custom interfaces created on the fly, +see @xref{General Information about Modules}. address@hidden deffn + address@hidden {Scheme Procedure} module-duplicates-handlers module +The declared sequence of duplicate-binding-handlers used for this +module. The default is given by address@hidden(default-duplicate-binding-handler)} and the declared list can +be modified using @code{(set-module-duplicates-handlers! module +list)}. Detailed information on how to write your own duplicate +handler is available in maintainer comments. address@hidden deffn + + @node Module System Quirks @subsubsection Module System Quirks