mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-28 05:50:30 +02:00
a number of doc fixes
* doc/ref/api-control.texi (Handling Errors): Update docs for display-error. * libguile/backtrace.h (scm_i_display_error): Change prototype to s/stack/frame/. * libguile/throw.c (handler_message): Change invocation of scm_i_display_error to pass a frame. * doc/ref/api-deprecated.texi (Deprecation): Update wording. * doc/ref/api-evaluation.texi (Local Evaluation): Remove section on local-eval. * doc/ref/api-macros.texi: Fix a couple typos. * doc/ref/api-memory.texi (Objects): Remove terrible section. * doc/ref/api-procedures.texi (Procedure Properties): Remove docs for closure?. (Compiled Procedures): Update wording. * doc/ref/guile.texi (API Reference): Remove reference to "Objects".
This commit is contained in:
parent
46088b2629
commit
7545ddd42a
9 changed files with 29 additions and 89 deletions
|
@ -1402,10 +1402,10 @@ be @code{#f} if no additional objects are required.
|
||||||
In addition to @code{catch} and @code{throw}, the following Scheme
|
In addition to @code{catch} and @code{throw}, the following Scheme
|
||||||
facilities are available:
|
facilities are available:
|
||||||
|
|
||||||
@deffn {Scheme Procedure} display-error stack port subr message args rest
|
@deffn {Scheme Procedure} display-error frame port subr message args rest
|
||||||
@deffnx {C Function} scm_display_error (stack, port, subr, message, args, rest)
|
@deffnx {C Function} scm_display_error (frame, port, subr, message, args, rest)
|
||||||
Display an error message to the output port @var{port}.
|
Display an error message to the output port @var{port}.
|
||||||
@var{stack} is the saved stack for the error, @var{subr} is
|
@var{frame} is the frame in which the error occurred, @var{subr} is
|
||||||
the name of the procedure in which the error occurred and
|
the name of the procedure in which the error occurred and
|
||||||
@var{message} is the actual error message, which may contain
|
@var{message} is the actual error message, which may contain
|
||||||
formatting instructions. These will format the arguments in
|
formatting instructions. These will format the arguments in
|
||||||
|
|
|
@ -11,21 +11,19 @@ From time to time functions and other features of Guile become obsolete.
|
||||||
Guile's @dfn{deprecation} is a mechanism that can help you cope with
|
Guile's @dfn{deprecation} is a mechanism that can help you cope with
|
||||||
this.
|
this.
|
||||||
|
|
||||||
When you use a feature that is deprecated, you will likely get a
|
When you use a feature that is deprecated, you will likely get a warning
|
||||||
warning message at run-time. Also, deprecated features are not ready
|
message at run-time. Also, if you have a new enough toolchain, using a
|
||||||
for production use: they might be very slow.
|
deprecated function from @code{libguile} will cause a link-time warning.
|
||||||
|
|
||||||
Additionally, if you have a new enough toolchain, using a deprecated
|
The primary source for information about just what interfaces are
|
||||||
function from @code{libguile} will cause a link-time warning.
|
deprecated in a given release is the file @file{NEWS}. That file also
|
||||||
|
documents what you should use instead of the obsoleted things.
|
||||||
The primary source for information about just what things are deprecated
|
|
||||||
in a given release is the file @file{NEWS}. That file also documents
|
|
||||||
what you should use instead of the obsoleted things.
|
|
||||||
|
|
||||||
The file @file{README} contains instructions on how to control the
|
The file @file{README} contains instructions on how to control the
|
||||||
inclusion or removal of the deprecated features from the public API of
|
inclusion or removal of the deprecated features from the public API of
|
||||||
Guile, and how to control the deprecation warning messages.
|
Guile, and how to control the deprecation warning messages.
|
||||||
|
|
||||||
The idea behind those mechanisms is that normally all deprecated are
|
The idea behind this mechanism is that normally all deprecated
|
||||||
available, but you get feedback when compiling and running code that
|
interfaces are available, but you get feedback when compiling and
|
||||||
uses them, so that you can migrate to the newer APIs at your leisure.
|
running code that uses them, so that you can migrate to the newer APIs
|
||||||
|
at your leisure.
|
||||||
|
|
|
@ -18,7 +18,6 @@ loading, evaluating, and compiling Scheme code at run time.
|
||||||
* Loading:: Loading Scheme code from file.
|
* Loading:: Loading Scheme code from file.
|
||||||
* Character Encoding of Source Files:: Loading non-ASCII Scheme code from file.
|
* Character Encoding of Source Files:: Loading non-ASCII Scheme code from file.
|
||||||
* Delayed Evaluation:: Postponing evaluation until it is needed.
|
* Delayed Evaluation:: Postponing evaluation until it is needed.
|
||||||
* Local Evaluation:: Evaluation in a local environment.
|
|
||||||
* Evaluator Behaviour:: Modifying Guile's evaluator.
|
* Evaluator Behaviour:: Modifying Guile's evaluator.
|
||||||
* VM Behaviour:: Modifying Guile's virtual machine.
|
* VM Behaviour:: Modifying Guile's virtual machine.
|
||||||
@end menu
|
@end menu
|
||||||
|
@ -790,20 +789,6 @@ value.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
|
|
||||||
@node Local Evaluation
|
|
||||||
@subsection Local Evaluation
|
|
||||||
|
|
||||||
[the-environment]
|
|
||||||
|
|
||||||
@deffn {Scheme Procedure} local-eval exp [env]
|
|
||||||
@deffnx {C Function} scm_local_eval (exp, env)
|
|
||||||
Evaluate @var{exp} in its environment. If @var{env} is supplied,
|
|
||||||
it is the environment in which to evaluate @var{exp}. Otherwise,
|
|
||||||
@var{exp} must be a memoized code object (in which case, its environment
|
|
||||||
is implicit).
|
|
||||||
@end deffn
|
|
||||||
|
|
||||||
|
|
||||||
@node Evaluator Behaviour
|
@node Evaluator Behaviour
|
||||||
@subsection Evaluator Behaviour
|
@subsection Evaluator Behaviour
|
||||||
|
|
||||||
|
|
|
@ -447,12 +447,12 @@ output from a @code{syntax-case} expression.
|
||||||
It is not strictly necessary for a @code{syntax-case} expression to return a
|
It is not strictly necessary for a @code{syntax-case} expression to return a
|
||||||
syntax object, because @code{syntax-case} expressions can be used in helper
|
syntax object, because @code{syntax-case} expressions can be used in helper
|
||||||
functions, or otherwise used outside of syntax expansion itself. However a
|
functions, or otherwise used outside of syntax expansion itself. However a
|
||||||
syntax transformer procedure must return a syntax object, so most uses of
|
syntax transformer procedure must return a syntax object, so most uses of
|
||||||
@code{syntax-case} do end up returning syntax objects.
|
@code{syntax-case} do end up returning syntax objects.
|
||||||
|
|
||||||
Here in this case, the form that built the return value was @code{(syntax (+ exp
|
Here in this case, the form that built the return value was @code{(syntax (+ exp
|
||||||
1))}. The interesting thing about this is that within a @code{syntax}
|
1))}. The interesting thing about this is that within a @code{syntax}
|
||||||
expression, any appearance of a pattern variable is substitued into the
|
expression, any appearance of a pattern variable is substituted into the
|
||||||
resulting syntax object, carrying with it all relevant metadata from the source
|
resulting syntax object, carrying with it all relevant metadata from the source
|
||||||
expression, such as lexical identity and source location.
|
expression, such as lexical identity and source location.
|
||||||
|
|
||||||
|
@ -498,6 +498,7 @@ Returns @code{#t} iff @var{syntax-object} is an identifier.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@example
|
@example
|
||||||
|
;; relying on previous add1 definition
|
||||||
(define-syntax add1!
|
(define-syntax add1!
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(syntax-case x ()
|
(syntax-case x ()
|
||||||
|
@ -785,7 +786,7 @@ left-hand side of a @code{set!} expression, as in the following:
|
||||||
|
|
||||||
As the example notes, the transformer procedure must be explicitly
|
As the example notes, the transformer procedure must be explicitly
|
||||||
marked as being a ``variable transformer'', as most macros aren't
|
marked as being a ``variable transformer'', as most macros aren't
|
||||||
written to discriminate on the form in the operand position.
|
written to discriminate on the form in the operator position.
|
||||||
|
|
||||||
@deffn {Scheme Procedure} make-variable-transformer transformer
|
@deffn {Scheme Procedure} make-variable-transformer transformer
|
||||||
Mark the @var{transformer} procedure as being a ``variable
|
Mark the @var{transformer} procedure as being a ``variable
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
@c -*-texinfo-*-
|
@c -*-texinfo-*-
|
||||||
@c This is part of the GNU Guile Reference Manual.
|
@c This is part of the GNU Guile Reference Manual.
|
||||||
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009
|
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 2010
|
||||||
@c Free Software Foundation, Inc.
|
@c Free Software Foundation, Inc.
|
||||||
@c See the file guile.texi for copying conditions.
|
@c See the file guile.texi for copying conditions.
|
||||||
|
|
||||||
|
@ -478,38 +478,6 @@ to the value, it is eligible to be returned from a guardian.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
|
|
||||||
@node Objects
|
|
||||||
@section Objects
|
|
||||||
|
|
||||||
@deffn {Scheme Procedure} entity? obj
|
|
||||||
@deffnx {C Function} scm_entity_p (obj)
|
|
||||||
Return @code{#t} if @var{obj} is an entity.
|
|
||||||
@end deffn
|
|
||||||
|
|
||||||
@deffn {Scheme Procedure} operator? obj
|
|
||||||
@deffnx {C Function} scm_operator_p (obj)
|
|
||||||
Return @code{#t} if @var{obj} is an operator.
|
|
||||||
@end deffn
|
|
||||||
|
|
||||||
@deffn {Scheme Procedure} set-object-procedure! obj proc
|
|
||||||
@deffnx {C Function} scm_set_object_procedure_x (obj, proc)
|
|
||||||
Set the object procedure of @var{obj} to @var{proc}.
|
|
||||||
@var{obj} must be either an entity or an operator.
|
|
||||||
@end deffn
|
|
||||||
|
|
||||||
@deffn {Scheme Procedure} make-class-object metaclass layout
|
|
||||||
@deffnx {C Function} scm_make_class_object (metaclass, layout)
|
|
||||||
Create a new class object of class @var{metaclass}, with the
|
|
||||||
slot layout specified by @var{layout}.
|
|
||||||
@end deffn
|
|
||||||
|
|
||||||
@deffn {Scheme Procedure} make-subclass-object class layout
|
|
||||||
@deffnx {C Function} scm_make_subclass_object (class, layout)
|
|
||||||
Create a subclass object of @var{class}, with the slot layout
|
|
||||||
specified by @var{layout}.
|
|
||||||
@end deffn
|
|
||||||
|
|
||||||
|
|
||||||
@c Local Variables:
|
@c Local Variables:
|
||||||
@c TeX-master: "guile.texi"
|
@c TeX-master: "guile.texi"
|
||||||
@c End:
|
@c End:
|
||||||
|
|
|
@ -121,22 +121,18 @@ same way as @code{scm_c_make_gsubr}, which is usually not further
|
||||||
required.
|
required.
|
||||||
@end deftypefun
|
@end deftypefun
|
||||||
|
|
||||||
@code{scm_c_make_gsubr} and @code{scm_c_define_gsubr} automatically
|
|
||||||
use @code{scm_c_make_subr} and also @code{scm_makcclo} if necessary.
|
|
||||||
It is advisable to use the gsubr variants since they provide a
|
|
||||||
slightly higher-level abstraction of the Guile implementation.
|
|
||||||
|
|
||||||
@node Compiled Procedures
|
@node Compiled Procedures
|
||||||
@subsection Compiled Procedures
|
@subsection Compiled Procedures
|
||||||
|
|
||||||
In Guile, procedures can be executed by directly interpreting their
|
The evaluation strategy given in @ref{Lambda} describes how procedures
|
||||||
source code. Scheme source code is a set of nested lists, after all,
|
are @dfn{interpreted}. Interpretation operates directly on expanded
|
||||||
with each list representing a procedure call.
|
Scheme source code, recursively calling the evaluator to obtain the
|
||||||
|
value of nested expressions.
|
||||||
|
|
||||||
Most procedures are compiled, however. This means that Guile has done
|
Most procedures are compiled, however. This means that Guile has done
|
||||||
some pre-computation on the procedure, to determine what it will need
|
some pre-computation on the procedure, to determine what it will need to
|
||||||
to do each time the procedure runs. Compiled procedures run faster
|
do each time the procedure runs. Compiled procedures run faster than
|
||||||
than interpreted procedures.
|
interpreted procedures.
|
||||||
|
|
||||||
Loading files is the normal way that compiled procedures come to
|
Loading files is the normal way that compiled procedures come to
|
||||||
being. If Guile sees that a file is uncompiled, or that its compiled
|
being. If Guile sees that a file is uncompiled, or that its compiled
|
||||||
|
@ -599,15 +595,6 @@ returns @code{#t} for procedures which do not accept any arguments.
|
||||||
Return @code{#t} if @var{obj} is a procedure.
|
Return @code{#t} if @var{obj} is a procedure.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
@deffn {Scheme Procedure} closure? obj
|
|
||||||
@deffnx {C Function} scm_closure_p (obj)
|
|
||||||
Return @code{#t} if @var{obj} is a closure. This category somewhat
|
|
||||||
misnamed, actually, as it applies only to interpreted procedures, not
|
|
||||||
compiled procedures. But since it has historically been used more to
|
|
||||||
select on implementation details than on essence (closure or not), we
|
|
||||||
keep it here for compatibility. Don't use it in new code, though.
|
|
||||||
@end deffn
|
|
||||||
|
|
||||||
@deffn {Scheme Procedure} thunk? obj
|
@deffn {Scheme Procedure} thunk? obj
|
||||||
@deffnx {C Function} scm_thunk_p (obj)
|
@deffnx {C Function} scm_thunk_p (obj)
|
||||||
Return @code{#t} if @var{obj} is a thunk.
|
Return @code{#t} if @var{obj} is a thunk.
|
||||||
|
|
|
@ -304,7 +304,6 @@ available through both Scheme and C interfaces.
|
||||||
* LALR(1) Parsing:: Generating LALR(1) parsers.
|
* LALR(1) Parsing:: Generating LALR(1) parsers.
|
||||||
* Read/Load/Eval/Compile:: Reading and evaluating Scheme code.
|
* Read/Load/Eval/Compile:: Reading and evaluating Scheme code.
|
||||||
* Memory Management:: Memory management and garbage collection.
|
* Memory Management:: Memory management and garbage collection.
|
||||||
* Objects:: Low level object orientation support.
|
|
||||||
* Modules:: Designing reusable code libraries.
|
* Modules:: Designing reusable code libraries.
|
||||||
* Foreign Function Interface:: Interacting with C procedures and data.
|
* Foreign Function Interface:: Interacting with C procedures and data.
|
||||||
* Scheduling:: Threads, mutexes, asyncs and dynamic roots.
|
* Scheduling:: Threads, mutexes, asyncs and dynamic roots.
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include "libguile/__scm.h"
|
#include "libguile/__scm.h"
|
||||||
|
|
||||||
SCM_API void scm_display_error_message (SCM message, SCM args, SCM port);
|
SCM_API void scm_display_error_message (SCM message, SCM args, SCM port);
|
||||||
SCM_INTERNAL void scm_i_display_error (SCM stack, SCM port, SCM subr,
|
SCM_INTERNAL void scm_i_display_error (SCM frame, SCM port, SCM subr,
|
||||||
SCM message, SCM args, SCM rest);
|
SCM message, SCM args, SCM rest);
|
||||||
SCM_API SCM scm_display_error (SCM frame, SCM port, SCM subr, SCM message, SCM args, SCM rest);
|
SCM_API SCM scm_display_error (SCM frame, SCM port, SCM subr, SCM message, SCM args, SCM rest);
|
||||||
SCM_API SCM scm_display_application (SCM frame, SCM port, SCM indent);
|
SCM_API SCM scm_display_application (SCM frame, SCM port, SCM indent);
|
||||||
|
|
|
@ -365,7 +365,9 @@ handler_message (void *handler_data, SCM tag, SCM args)
|
||||||
highlights);
|
highlights);
|
||||||
scm_newline (p);
|
scm_newline (p);
|
||||||
}
|
}
|
||||||
scm_i_display_error (stack, p, subr, message, parts, rest);
|
scm_i_display_error (scm_is_true (stack)
|
||||||
|
? scm_stack_ref (stack, SCM_INUM0) : SCM_BOOL_F,
|
||||||
|
p, subr, message, parts, rest);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue