1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

document make-unbound-fluid et al

* doc/ref/api-scheduling.texi (Fluids and Dynamic States): Document the
  new fluid routines.

* NEWS: Update.
This commit is contained in:
Andy Wingo 2010-12-17 13:14:13 +01:00
parent e01163b5f1
commit d09c07fb10
2 changed files with 21 additions and 5 deletions

6
NEWS
View file

@ -94,10 +94,8 @@ See FIXME in the manual, for more information.
** Add support for unbound fluids ** Add support for unbound fluids
FIXME: needs documentation See `make-unbound-fluid', `fluid-unset!', and `fluid-bound?' in the
manual.
See `make-undefined-fluid' (FIXME: should be make-unbound-fluid),
`fluid-unset!', and `fluid-bound?' in the manual.
** Add variable-unset! ** Add variable-unset!

View file

@ -691,6 +691,12 @@ inherits the values from its parent. Because each thread normally executes
with its own dynamic state, you can use fluids for thread local storage. with its own dynamic state, you can use fluids for thread local storage.
@end deffn @end deffn
@deffn {Scheme Procedure} make-unbound-fluid
@deffnx {C Function} scm_make_unbound_fluid ()
Return a new fluid that is initially unbound (instead of being
implicitly bound to @code{#f}.
@end deffn
@deffn {Scheme Procedure} fluid? obj @deffn {Scheme Procedure} fluid? obj
@deffnx {C Function} scm_fluid_p (obj) @deffnx {C Function} scm_fluid_p (obj)
Return @code{#t} iff @var{obj} is a fluid; otherwise, return Return @code{#t} iff @var{obj} is a fluid; otherwise, return
@ -701,7 +707,8 @@ Return @code{#t} iff @var{obj} is a fluid; otherwise, return
@deffnx {C Function} scm_fluid_ref (fluid) @deffnx {C Function} scm_fluid_ref (fluid)
Return the value associated with @var{fluid} in the current Return the value associated with @var{fluid} in the current
dynamic root. If @var{fluid} has not been set, then return dynamic root. If @var{fluid} has not been set, then return
@code{#f}. @code{#f}. Calling @code{fluid-ref} on an unbound fluid produces a
runtime error.
@end deffn @end deffn
@deffn {Scheme Procedure} fluid-set! fluid value @deffn {Scheme Procedure} fluid-set! fluid value
@ -709,6 +716,17 @@ dynamic root. If @var{fluid} has not been set, then return
Set the value associated with @var{fluid} in the current dynamic root. Set the value associated with @var{fluid} in the current dynamic root.
@end deffn @end deffn
@deffn {Scheme Procedure} fluid-unset! fluid
@deffnx {C Function} scm_fluid_unset_x (fluid)
Disassociate the given fluid from any value, making it unbound.
@end deffn
@deffn {Scheme Procedure} fluid-bound? fluid
@deffnx {C Function} scm_fluid_bound_p (fluid)
Returns @code{#t} iff the given fluid is bound to a value, otherwise
@code{#f}.
@end deffn
@code{with-fluids*} temporarily changes the values of one or more fluids, @code{with-fluids*} temporarily changes the values of one or more fluids,
so that the given procedure and each procedure called by it access the so that the given procedure and each procedure called by it access the
given values. After the procedure returns, the old values are restored. given values. After the procedure returns, the old values are restored.