summaryrefslogtreecommitdiff
path: root/doc/ref/api-modules.texi
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2014-09-20 04:42:49 -0400
committerMark H Weaver <mhw@netris.org>2014-09-20 05:46:45 -0400
commit0fce815b1b50bc80092acfea44d03e4739140478 (patch)
tree14db2656b49414d7fe2f593a1e8a86818c711cf4 /doc/ref/api-modules.texi
parent8f230e3341c344afe891cc45d0370c42a7813ace (diff)
downloadguile-0fce815b1b50bc80092acfea44d03e4739140478.tar.gz
Document #:prefix option in use-module clauses.
* doc/ref/api-modules.texi (Using Guile Modules): Document #:prefix option.
Diffstat (limited to 'doc/ref/api-modules.texi')
-rw-r--r--doc/ref/api-modules.texi37
1 files changed, 25 insertions, 12 deletions
diff --git a/doc/ref/api-modules.texi b/doc/ref/api-modules.texi
index 0f54e01ab..e9d7aecf3 100644
--- a/doc/ref/api-modules.texi
+++ b/doc/ref/api-modules.texi
@@ -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: