mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-28 07:50:20 +02:00
Fixup some module-related references.
This commit is contained in:
parent
0281752f6a
commit
c71375c94b
3 changed files with 24 additions and 22 deletions
|
@ -1,4 +1,4 @@
|
|||
@c $Id: intro.texi,v 1.7 2001-05-06 01:49:56 ttn Exp $
|
||||
@c $Id: intro.texi,v 1.8 2001-05-13 19:14:41 ttn Exp $
|
||||
|
||||
@page
|
||||
@node What is Guile?
|
||||
|
@ -695,18 +695,21 @@ Guile has support for dividing a program into @dfn{modules}. By using
|
|||
modules, you can group related code together and manage the
|
||||
composition of complete programs from largely independent parts.
|
||||
|
||||
(The module system is in flux, and will likely look very different in
|
||||
the future. Feel free to use the existing system anyway. Guile will
|
||||
provide reasonable backwards compatability.)
|
||||
(Although the module system implementation is in flux, feel free to use it
|
||||
anyway. Guile will provide reasonable backwards compatability.)
|
||||
|
||||
Details on the module system beyond this introductory material can be found in
|
||||
@xref{Modules}.
|
||||
|
||||
|
||||
@menu
|
||||
* Using Guile Modules::
|
||||
* Writing New Modules::
|
||||
* Modules and Extensions::
|
||||
* Intro to Using Guile Modules::
|
||||
* Intro to Writing New Modules::
|
||||
* Intro to Modules and Extensions::
|
||||
@end menu
|
||||
|
||||
@node Using Guile Modules
|
||||
@subsection Using Existing Modules
|
||||
@node Intro to Using Guile Modules
|
||||
@subsection Intro to Using Existing Modules
|
||||
|
||||
Guile comes with a lot of useful modules, for example for string
|
||||
processing or command line parsing. Additionally, there exist many
|
||||
|
@ -747,11 +750,9 @@ one line at a time.
|
|||
"drwxr-sr-x 2 mgrabmue mgrabmue 1024 Mar 29 19:57 CVS"
|
||||
@end lisp
|
||||
|
||||
More details of module usage can be found in (REFFIXME).
|
||||
|
||||
|
||||
@node Writing New Modules
|
||||
@subsection Writing New Modules
|
||||
@node Intro to Writing New Modules
|
||||
@subsection Intro to Writing New Modules
|
||||
|
||||
Of course it is possible to write modules yourself. Using modules for
|
||||
structuring your programs makes them more readable and lets you
|
||||
|
@ -805,8 +806,8 @@ After exporting, other modules can access the exported items simply by
|
|||
using @code{use-modules} to load the module @code{(foo bar)}.
|
||||
|
||||
|
||||
@node Modules and Extensions
|
||||
@subsection Modules and Extensions
|
||||
@node Intro to Modules and Extensions
|
||||
@subsection Intro to Modules and Extensions
|
||||
|
||||
In addition to Scheme code you can also put new procedures and other
|
||||
named features that are provided by an extension into a module.
|
||||
|
@ -829,6 +830,7 @@ write a Scheme file with this contents
|
|||
The file should of course be saved in the right place for autoloading,
|
||||
for example as @file{/usr/local/share/guile/math/bessel.scm}.
|
||||
|
||||
|
||||
@page
|
||||
@node Reporting Bugs
|
||||
@chapter Reporting Bugs
|
||||
|
|
|
@ -144,7 +144,7 @@ address these eventually.
|
|||
@subsection Using Guile Modules
|
||||
|
||||
To use a Guile module is to access either its public interface or a
|
||||
custom interface (@pxref{General Information About Modules}). Both
|
||||
custom interface (@pxref{General Information about Modules}). Both
|
||||
types of access are handled by the syntactic form @code{use-modules},
|
||||
which accepts one or more interface specifications and, upon evaluation,
|
||||
arranges for those interfaces to be available to the current module.
|
||||
|
|
|
@ -189,10 +189,10 @@ For quick reference, here is the syntax of the formal argument list for
|
|||
|
||||
@example
|
||||
ext-param-list ::= [identifier]* [#:optional [ext-var-decl]+]?
|
||||
[#:key [ext-var-decl]+ [#:allow-other-keys]?]?
|
||||
[#:key [ext-var-decl]+ [#:allow-other-keys]?]?
|
||||
[[#:rest identifier]|[. identifier]]?
|
||||
|
||||
ext-var-decl ::= identifier | ( identifier expression )
|
||||
ext-var-decl ::= identifier | ( identifier expression )
|
||||
@end example
|
||||
|
||||
The characters `*', `+' and `?' are not to be taken literally; they mean
|
||||
|
@ -231,7 +231,7 @@ two-item list in place of an optional argument, for example in:
|
|||
|
||||
@lisp
|
||||
(lambda* (foo #:optional (bar 42) #:key (baz 73))
|
||||
(list foo bar baz))
|
||||
(list foo bar baz))
|
||||
@end lisp
|
||||
|
||||
@var{foo} is a fixed argument, @var{bar} is an optional argument with
|
||||
|
@ -446,7 +446,7 @@ Let @code{f} be a variable containing such a @code{foo} data
|
|||
structure.@footnote{Working definitions would be:
|
||||
@lisp
|
||||
(define foo-ref vector-ref)
|
||||
(define foo-set! vector-set!)
|
||||
(define foo-set! vector-set!)
|
||||
(define f (make-vector 2 #f))
|
||||
@end lisp
|
||||
}
|
||||
|
@ -477,7 +477,7 @@ Let us call this new procedure @code{foo}.
|
|||
structure stored in @code{f}, or to write into the structure.
|
||||
|
||||
@lisp
|
||||
(set! (foo f 0) 'dum)
|
||||
(set! (foo f 0) 'dum)
|
||||
(foo f 0) @result{} dum
|
||||
@end lisp
|
||||
|
||||
|
@ -613,7 +613,7 @@ example of the previous section looks like this:
|
|||
In Guile, the @code{syntax-rules} system is provided by the @code{(ice-9
|
||||
syncase)} module. To make these facilities available in your code,
|
||||
include the expression @code{(use-modules (ice-9 syncase))} or
|
||||
@code{(use-syntax (ice-9 syncase))} (@pxref{Loading Guile Modules})
|
||||
@code{(use-syntax (ice-9 syncase))} (@pxref{Using Guile Modules})
|
||||
before the first usage of @code{define-syntax} etc. If you are writing
|
||||
a Scheme module, you can alternatively use one of the keywords
|
||||
@code{#:use-module} and @code{#:use-syntax} in your @code{define-module}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue