Document #:prefix option in use-module clauses.
authorMark H Weaver <mhw@netris.org>
Sat, 20 Sep 2014 08:42:49 +0000 (04:42 -0400)
committerMark H Weaver <mhw@netris.org>
Sat, 20 Sep 2014 09:46:45 +0000 (05:46 -0400)
* doc/ref/api-modules.texi (Using Guile Modules): Document #:prefix
  option.

doc/ref/api-modules.texi

index 0f54e01..e9d7aec 100644 (file)
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
-@c Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 2008, 2009, 2010, 2011, 2012, 2013
+@c Copyright (C)  1996, 1997, 2000-2004, 2007-2014
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
 
@@ -126,6 +126,16 @@ them to suit the current module's needs.  For example:
               #:renamer (symbol-prefix-proc 'unixy:)))
 @end lisp
 
+@noindent
+or more simply:
+
+@cindex prefix
+@lisp
+(use-modules ((ice-9 popen)
+              #:select ((open-pipe . pipe-open) close-pipe)
+              #:prefix unixy:))
+@end lisp
+
 Here, the interface specification is more complex than before, and the
 result is that a custom interface with only two bindings is created and
 subsequently accessed by the current module.  The mapping of old to new
@@ -184,21 +194,24 @@ whose public interface is found and used.
 
 @cindex binding renamer
 @lisp
- (MODULE-NAME [#:select SELECTION] [#:renamer RENAMER])
+ (MODULE-NAME [#:select SELECTION]
+              [#:prefix PREFIX]
+              [#:renamer RENAMER])
 @end lisp
 
 in which case a custom interface is newly created and used.
 @var{module-name} is a list of symbols, as above; @var{selection} is a
-list of selection-specs; and @var{renamer} is a procedure that takes a
-symbol and returns its new name.  A selection-spec is either a symbol or
-a pair of symbols @code{(ORIG . SEEN)}, where @var{orig} is the name in
-the used module and @var{seen} is the name in the using module.  Note
-that @var{seen} is also passed through @var{renamer}.
-
-The @code{#:select} and @code{#:renamer} clauses are optional.  If both are
-omitted, the returned interface has no bindings.  If the @code{#:select}
-clause is omitted, @var{renamer} operates on the used module's public
-interface.
+list of selection-specs; @var{prefix} is a symbol that is prepended to
+imported names; and @var{renamer} is a procedure that takes a symbol and
+returns its new name.  A selection-spec is either a symbol or a pair of
+symbols @code{(ORIG . SEEN)}, where @var{orig} is the name in the used
+module and @var{seen} is the name in the using module.  Note that
+@var{seen} is also modified by @var{prefix} and @var{renamer}.
+
+The @code{#:select}, @code{#:prefix}, and @code{#:renamer} clauses are
+optional.  If all are omitted, the returned interface has no bindings.
+If the @code{#:select} clause is omitted, @var{prefix} and @var{renamer}
+operate on the used module's public interface.
 
 In addition to the above, @var{spec} can also include a @code{#:version} 
 clause, of the form: