This commit is contained in:
Dale Mellor 2020-06-07 16:03:17 +01:00
commit ef8e4ade14
22 changed files with 576 additions and 343 deletions

View file

@ -678,8 +678,8 @@ Evaluate @var{expr} in a prompt, optionally specifying a tag and a
handler. If no tag is given, the default prompt tag is used.
If no handler is given, a default handler is installed. The default
handler accepts a procedure of one argument, which will called on the
captured continuation, within a prompt.
handler accepts a procedure of one argument, which will be called on
the captured continuation, within a prompt.
Sometimes it's easier just to show code, as in this case:

View file

@ -1,6 +1,6 @@
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000-2004, 2007-2014, 2019
@c Copyright (C) 1996, 1997, 2000-2004, 2007-2014, 2019, 2020
@c Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
@ -295,17 +295,15 @@ example,
(set! foo (delete-duplicates ...)))
@end example
When a module is autoloaded, all its bindings become available.
@var{symbol-list} is just those that will first trigger the load.
When a module is autoloaded, only the bindings in @var{symbol-list}
become available@footnote{In Guile 2.2 and earlier, @emph{all} the
module bindings would become available; @var{symbol-list} was just the
list of bindings that will first trigger the load.}.
An autoload is a good way to put off loading a big module until it's
really needed, for instance for faster startup or if it will only be
needed in certain circumstances.
@code{@@} can do a similar thing (@pxref{Using Guile Modules}), but in
that case an @code{@@} form must be written every time a binding from
the module is used.
@item #:export @var{list}
@cindex export
Export all identifiers in @var{list} which must be a list of symbols

View file

@ -143,9 +143,11 @@ loaded, and save the result to disk. Procedures can be compiled at
runtime as well. @xref{Read/Load/Eval/Compile}, for more information
on runtime compilation.
Compiled procedures, also known as @dfn{programs}, respond all
procedures that operate on procedures. In addition, there are a few
more accessors for low-level details on programs.
Compiled procedures, also known as @dfn{programs}, respond to all
procedures that operate on procedures: you can pass a program to
@code{procedure?}, @code{procedure-name}, and so on (@pxref{Procedure
Properties}). In addition, there are a few more accessors for low-level
details on programs.
Most people won't need to use the routines described in this section,
but it's good to have them documented. You'll have to include the
@ -728,8 +730,8 @@ Return @code{#t} if @var{obj} is a procedure.
@deffn {Scheme Procedure} thunk? obj
@deffnx {C Function} scm_thunk_p (obj)
Return @code{#t} if @var{obj} is a thunk---a procedure that does
not accept arguments.
Return @code{#t} if @var{obj} is a procedure that can be called with
zero arguments.
@end deffn
@cindex procedure properties

View file

@ -228,6 +228,7 @@ on that make up Guile's application programming interface (API), see
* Using Guile in Emacs:: Guile and Emacs.
* Using Guile Tools:: A guild of scheming wizards.
* Installing Site Packages:: Installing Scheme code.
* Distributing Guile Code:: Building and distributing your code.
@end menu
@include scheme-intro.texi

View file

@ -1173,7 +1173,7 @@ evaluates to @code{baz}.
@deffn {Scheme Procedure} raise obj
Equivalent to core Guile @code{(raise-exception @var{obj})}.
@xref{Raising and Handling Exceptions}. p(Unfortunately, @code{raise}
@xref{Raising and Handling Exceptions}. (Unfortunately, @code{raise}
is already bound to a different function in core Guile.
@xref{Signals}.)
@end deffn

View file

@ -804,6 +804,32 @@ installed on your system in @code{/usr/}, then the extensions dir will
be @code{/usr/lib/guile/@value{EFFECTIVE-VERSION}/extensions}.
@node Distributing Guile Code
@section Distributing Guile Code
@cindex distribution, of Guile projects
There's a tool that doesn't come bundled with Guile and yet can be very
useful in your day to day experience with it. This tool is
@uref{https://gitlab.com/a-sassmannshausen/guile-hall, Hall}.
Hall helps you create, manage, and package your Guile projects through a
simple command-line interface. When you start a new project, Hall
creates a folder containing a scaffold of your new project. It contains
a directory for your tests, for your libraries, for your scripts and for
your documentation. This means you immediately know where to put the
files you are hacking on.
@cindex build system, for Guile code
In addition, the scaffold will include your basic ``Autotools'' setup,
so you don't have to take care of that yourself (@pxref{The GNU Build
System,,, autoconf, Autoconf: Creating Automatic Configuration Scripts},
for more information on the GNU ``Autotools''). Having Autotools set up
with your project means you can immediately start hacking on your
project without worrying about whether your code will work on other
people's computers. Hall can also generate package definitions for the
GNU@tie{}Guix package manager, making it easy for Guix users to install
it.
@c Local Variables:
@c TeX-master: "guile.texi"
@c End:

View file

@ -230,7 +230,7 @@ SAX parsers were created to give the programmer more control on the
parsing process. A programmer gives the SAX parser a number of
``callbacks'': functions that will be called on various features of the
XML stream as they are encountered. SAX parsers are more efficient, but
much harder to user, as users typically have to manually maintain a
much harder to use, as users typically have to manually maintain a
stack of open elements.
Kiselyov realized that the SAX programming model could be made much

View file

@ -1375,7 +1375,7 @@ as a @code{scm} value directly.
@deftypefn Instruction {} make-non-immediate s24:@var{dst} n32:@var{offset}
Load a pointer to statically allocated memory into @var{dst}. The
object's memory is will be found @var{offset} 32-bit words away from the
object's memory will be found @var{offset} 32-bit words away from the
current instruction pointer. Whether the object is mutable or immutable
depends on where it was allocated by the compiler, and loaded by the
loader.
@ -1384,7 +1384,7 @@ loader.
Sometimes you need to load up a code pointer into a register; for this,
use @code{load-label}.
@deftypefn Instruction {} make-non-immediate s24:@var{dst} l32:@var{offset}
@deftypefn Instruction {} load-label s24:@var{dst} l32:@var{offset}
Load a label @var{offset} words away from the current @code{ip} and
write it to @var{dst}. @var{offset} is a signed 32-bit integer.
@end deftypefn
@ -1422,7 +1422,7 @@ pointer. @var{offset} is a signed value.
Fields of non-immediates may need to be fixed up at load time, because
we do not know in advance at what address they will be loaded. This is
the case, for example, for a pair containing a non-immediate in one of
its fields. @code{static-ref} and @code{static-patch!} are used in
its fields. @code{static-set!} and @code{static-patch!} are used in
these situations.
@deftypefn Instruction {} static-set! s24:@var{src} lo32:@var{offset}