guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.3-146-gf41ef


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.3-146-gf41ef41
Date: Wed, 11 Jan 2012 23:32:28 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=f41ef416803b57473761b1963b0709312f36ddad

The branch, stable-2.0 has been updated
       via  f41ef416803b57473761b1963b0709312f36ddad (commit)
       via  e2e8ca42405133edda17d6a679985b9569059406 (commit)
       via  f43622a27b98ae2d44cd1a5d35c95309cc617c5c (commit)
       via  99db1bc2e2de7ee9a91eb07d7f9a7188626ac6bc (commit)
       via  cd3370bac1cfd4b01dd7a9865e2ece5c2696db2b (commit)
      from  bbe3408ae48ce07a5265d065511ee1a1e5ccd026 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f41ef416803b57473761b1963b0709312f36ddad
Author: Andy Wingo <address@hidden>
Date:   Thu Jan 12 00:32:11 2012 +0100

    update NEWS
    
    * NEWS: Update.

commit e2e8ca42405133edda17d6a679985b9569059406
Author: Andy Wingo <address@hidden>
Date:   Thu Jan 12 00:32:00 2012 +0100

    print-options doc update
    
    * doc/ref/api-evaluation.texi (Scheme Write): Update print-options.

commit f43622a27b98ae2d44cd1a5d35c95309cc617c5c
Author: Andy Wingo <address@hidden>
Date:   Thu Jan 12 00:10:44 2012 +0100

    fluids.c docstring
    
    * libguile/fluids.c (scm_make_fluid_with_default): Update docstring.

commit 99db1bc2e2de7ee9a91eb07d7f9a7188626ac6bc
Author: Andy Wingo <address@hidden>
Date:   Thu Jan 12 00:10:25 2012 +0100

    Move parameters documentation to core
    
    * doc/ref/api-scheduling.texi (Fluids and Dynamic States): Update for
      default values.
      (Parameters): Move here from srfi-39, and adapt.

commit cd3370bac1cfd4b01dd7a9865e2ece5c2696db2b
Author: Andy Wingo <address@hidden>
Date:   Thu Jan 12 00:09:39 2012 +0100

    add docs for scm_gc_register_allocation
    
    * doc/ref/api-memory.texi: Update for scm_gc_register_allocation.
      Remove docs for scm_gc_{un,}register_collectable_memory.

-----------------------------------------------------------------------

Summary of changes:
 NEWS                        |  145 ++++++++++++++++++++++++++++++++++++++++
 doc/ref/api-evaluation.texi |    4 +-
 doc/ref/api-memory.texi     |   52 ++++++--------
 doc/ref/api-scheduling.texi |  128 +++++++++++++++++++++++++++++++++--
 doc/ref/srfi-modules.texi   |  156 ++-----------------------------------------
 libguile/fluids.c           |    5 +-
 6 files changed, 302 insertions(+), 188 deletions(-)

diff --git a/NEWS b/NEWS
index 6098130..10d78b6 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,151 @@ See the end for copying conditions.
 Please send Guile bug reports to address@hidden
 
 
+Changes in 2.0.4 (since 2.0.3):
+
+* Notable changes
+
+** Better debuggability for interpreted procedures.
+    
+Guile 2.0 came with a great debugging experience for compiled
+procedures, but the story for interpreted procedures was terrible.  Now,
+at least, interpreted procedures have names, and the 'arity procedure
+property is always as correct (or, as it can be, in the presence of
+case-lambda).
+
+** Support for cross-compilation.
+    
+One can now use a native Guile to cross-compile `.go' files for a
+different architecture.  See the documentation for `--target' in the
+"Compilation" section of the manual, for how to use the cross-compiler.
+See the "Cross building Guile" section of the README, for more on how to
+cross-compile Guile itself.
+
+** Fluids can now have default values.
+
+Fluids are used for dynamic and thread-local binding.  They have always
+inherited their values from the context or thread that created them.
+However, there was a case in which a new thread would enter Guile, and
+the default values of all the fluids would be `#f' for that thread.
+
+This has now been fixed so that `make-fluid' has an optional default
+value, which defaults to `#f'. 
+
+** Garbage collector tuning.
+
+The garbage collector has now been tuned to run more often under some
+circumstances.
+
+*** Unmanaged allocation
+
+The new `scm_gc_register_allocation' function will notify the collector
+of unmanaged allocation.  This will cause the collector to run sooner.
+Guile's `scm_malloc', `scm_calloc', and `scm_realloc' unmanaged
+allocators eventually call this function.  This leads to better
+performance under steady-state unmanaged allocation.
+
+*** Transient allocation
+    
+When the collector runs, it will try to record the total memory
+footprint of a process, if the platform supports this information.  If
+the memory footprint is growing, the collector will run more frequently.
+This reduces the increase of the resident size of a process in response
+to a transient increase in allocation.
+
+*** Management of threads, bignums
+
+Creating a thread will allocate a fair amount of memory.  Guile now does
+some GC work (using `GC_collect_a_little') when allocating a thread.
+This leads to a better memory footprint when creating many short-lived
+threads.
+    
+Similarly, bignums can occupy a lot of memory.  Guile now offers hooks
+to enable custom GMP allocators that end up calling
+scm_gc_register_allocation'.  These allocators are enabled by default
+when running Guile from the command-line.  To enable them in libraries,
+set the `scm_install_gmp_memory_functions' variable to a nonzero value
+before loading Guile.
+
+Thanks to Mark Weaver for inspiration.
+
+** SRFI-39 parameters are available by default.
+    
+Guile now includes support for parameters, as defined by SRFI-39, in the
+default environment.  See "Parameters" in the manual, for more
+information.  `current-input-port', `current-output-port', and
+`current-error-port' are now parameters.
+    
+** Add `current-warning-port'
+    
+Guile now outputs warnings on a separate port, `current-warning-port',
+initialized to the value that `current-error-port' has on startup.
+
+** Syntax parameters.
+
+Following Racket's lead, Guile now supports syntax parameters.  See
+"Syntax parameters" in the manual, for more.
+
+Also see Barzilay, Culpepper, and Flatt's 2011 SFP workshop paper,
+"Keeping it Clean with syntax-parameterize".
+    
+    
+`primitive-load' returns the values yielded from evaluating the last
+expression in the file.  This in turn makes `load' always return the
+results of the last expression, both when interpreted and compiled.
+    
+** Parse command-line arguments from the locale encoding.
+    
+Guile now attempts to parse command-line arguments using the user's
+locale.  However for backwards compatibility with other 2.0.x releases,
+it does so without actually calling `setlocale'.  Please report any bugs
+in this facility to address@hidden
+
+* New interfaces
+
+** (ice-9 session): `apropos-hook'
+** New print option: `escape-newlines', defaults to #t.
+** (ice-9 ftw): `file-system-fold', `file-system-tree', `scandir'
+
+* Bug fixes
+
+** Fix R6RS `fold-left' so the accumulator is the first argument.
+** fix <dynwind> serialization.
+** Fix bugs in the new `peval' optimizer.
+** Allow values bound in non-tail let expressions to be collected.
+** Fix bit-set*! bug from 2005.
+** Fix bug in `make-repl' when `lang' is actually a language.
+** Hack the port-column of current-output-port after printing a prompt.
+** FFI: Hold a weak reference to the CIF made by `procedure->pointer'.
+** FFI: Hold a weak reference to the procedure passed to `procedure->pointer'.
+** FFI: Properly unpack small integer return values in closure call.
+** Allow overlapping regions to be passed to `bytevector-copy!'.
+** Fix `validate-target' in (system base target).
+** `,language' at REPL sets the current-language fluid.
+** `primitive-load' returns the value(s) of the last expression.
+** Add an exception printer for `getaddrinfo-error'.
+** Add a deprecated alias for $expt.
+** Document invalidity of (begin) as expression; add back-compat shim.
+** Web: Allow URIs with empty authorities, like "file:///etc/hosts".
+** HTTP: Fix validators for various list-style headers.
+** HTTP: Extend handling of "Cache-Control" header.
+** HTTP: Fix qstring writing of cache-extension values
+** HTTP: `write-request-line' writes absolute paths, not absolute URIs.
+** HTTP: Permit non-date values for Expires header.
+** FreeBSD build fixes.
+** Fix generalized-vector-{ref,set!} for slices.
+** Fix erroneous check in `set-procedure-properties!'.
+** Don't leak file descriptors when mmaping objcode.
+** Fix bugs related to mutation, the null string, and shared substrings.
+** Deprecate SCM_ASRTGO.
+** Add deprecated shim for `scm_display_error' with stack as first argument.
+** i18n: Fix gc_malloc/free mismatch on non-GNU systems.
+** Make sure `regexp-quote' tests use Unicode-capable string ports.
+** Have `cpu-word-size' error out on unknown CPUs; add support for MIPSEL.
+** `scm_from_stringn' always returns unique strings.
+** Empty substrings no longer reference the original stringbuf.
+** `scm_i_substring_copy' tries to narrow the substring.
+** Avoid calling `u32_conv_from_encoding' on the null string.
+
 Changes in 2.0.3 (since 2.0.2):
 
 * Speed improvements
diff --git a/doc/ref/api-evaluation.texi b/doc/ref/api-evaluation.texi
index 6a09bef..2e48dcb 100644
--- a/doc/ref/api-evaluation.texi
+++ b/doc/ref/api-evaluation.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 
2006, 2009, 2010, 2011
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2005, 
2006, 2009, 2010, 2011, 2012
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
 
@@ -417,6 +417,8 @@ quote-keywordish-symbols  reader  How to print symbols that 
have a colon
                                   '#t' quotes them; 'reader' quotes them
                                   when the reader option 'keywords' is
                                   not '#f'.
+escape-newlines           yes     Render newlines as \n when printing
+                                  using `write'. 
 @end smalllisp
 
 These options may be modified with the print-set! syntax.
diff --git a/doc/ref/api-memory.texi b/doc/ref/api-memory.texi
index 375686d..6dca7a2 100644
--- a/doc/ref/api-memory.texi
+++ b/doc/ref/api-memory.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 
2010
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2009, 
2010, 2012
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
 
@@ -163,6 +163,9 @@ between different modules.
 
 The function @code{scm_calloc} is similar to @code{scm_malloc}, but
 initializes the block of memory to zero as well.
+
+These functions will (indirectly) call
address@hidden
 @end deftypefn
 
 @deftypefn {C Function} {void *} scm_realloc (void address@hidden, size_t 
@var{new_size})
@@ -174,6 +177,8 @@ and allocates a new block of size @var{new_size}.
 
 When not enough memory is available, signal an error.  This function
 runs the GC to free up some memory when it deems it appropriate.
+
+This function will call @code{scm_gc_register_allocation}.
 @end deftypefn
 
 
@@ -209,39 +214,26 @@ the memory management overhead very low.  However, in 
Guile 2.x,
 @end deftypefn
 
 
address@hidden {C Function} void scm_gc_register_collectable_memory (void 
address@hidden, size_t @var{size}, const char address@hidden)
-Informs the GC that the memory at @var{mem} of size @var{size} can
-potentially be freed during a GC.  That is, announce that @var{mem} is
-part of a GC controlled object and when the GC happens to free that
-object, @var{size} bytes will be freed along with it.  The GC will
address@hidden free the memory itself, it will just know that so-and-so
-much bytes of memory are associated with GC controlled objects and the
-memory system figures this into its decisions when to run a GC.
-
-The @var{what} argument is used for statistical purposes.  It should
-describe the type of object that the memory will be used for so that
-users can identify just what strange objects are eating up their
-memory.
-
-In Guile 2.x, this function has no effect.
address@hidden deftypefn
address@hidden {C Function} void scm_gc_register_allocation (size_t @var{size})
+Informs the garbage collector that @var{size} bytes have been allocated,
+which the collector would otherwise not have known about.
 
address@hidden {C Function} void scm_gc_unregister_collectable_memory (void 
address@hidden, size_t @var{size})
-Informs the GC that the memory at @var{mem} of size @var{size} is no
-longer associated with a GC controlled object.  You must take care to
-match up every call to @code{scm_gc_register_collectable_memory} with
-a call to @code{scm_gc_unregister_collectable_memory}.  If you don't do
-this, the GC might have a wrong impression of what is going on and run
-much less efficiently than it could.
+In general, Scheme will decide to collect garbage only after some amount
+of memory has been allocated.  Calling this function will make the
+Scheme garbage collector know about more allocation, and thus run more
+often (as appropriate).
 
-In Guile 2.x, this function has no effect.
+It is especially important to call this function when large unmanaged
+allocations, like images, may be freed by small Scheme allocations, like
+SMOBs.
 @end deftypefn
 
 
address@hidden {C Function} void scm_frame_free (void *mem)
-Equivalent to @code{scm_frame_unwind_handler (free, @var{mem},
-SCM_F_WIND_EXPLICITLY)}.  That is, the memory block at @var{mem} will
-be freed when the current frame is left.
address@hidden {C Function} void scm_dynwind_free (void *mem)
+Equivalent to @code{scm_dynwind_unwind_handler (free, @var{mem},
+SCM_F_WIND_EXPLICITLY)}.  That is, the memory block at @var{mem} will be
+freed (using @code{free} from the C library) when the current dynwind is
+left.
 @end deftypefn
 
 @deffn {Scheme Procedure} malloc-stats
@@ -272,7 +264,7 @@ The functions @code{scm_must_malloc} and 
@code{scm_must_realloc}
 behaved like @code{scm_gc_malloc} and @code{scm_gc_realloc} do now,
 respectively.  They would inform the GC about the newly allocated
 memory via the internal equivalent of
address@hidden  However,
address@hidden  However,
 @code{scm_must_free} did not unregister the memory it was about to
 free.  The usual way to unregister memory was to return its size from
 a smob free function.
diff --git a/doc/ref/api-scheduling.texi b/doc/ref/api-scheduling.texi
index f107cbf..6b0ed22 100644
--- a/doc/ref/api-scheduling.texi
+++ b/doc/ref/api-scheduling.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 
2009, 2010
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2007, 
2009, 2010, 2012
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
 
@@ -15,6 +15,7 @@
 * Blocking::                    How to block properly in guile mode.
 * Critical Sections::           Avoiding concurrency and reentries.
 * Fluids and Dynamic States::   Thread-local variables, etc.
+* Parameters::                  Dynamic scoping in Scheme.
 * Futures::                     Fine-grain parallelism.
 * Parallel Forms::              Parallel execution of forms.
 @end menu
@@ -680,9 +681,11 @@ used for testing whether an object is actually a fluid.  
The values
 stored in a fluid can be accessed with @code{fluid-ref} and
 @code{fluid-set!}.
 
address@hidden {Scheme Procedure} make-fluid
address@hidden {Scheme Procedure} make-fluid [dflt]
 @deffnx {C Function} scm_make_fluid ()
-Return a newly created fluid.
address@hidden {C Function} scm_make_fluid_with_default (dflt)
+Return a newly created fluid, whose initial value is @var{dflt}, or
address@hidden if @var{dflt} is not given.
 Fluids are objects that can hold one
 value per dynamic state.  That is, modifications to this value are
 only visible to code that executes with the same dynamic state as
@@ -694,7 +697,7 @@ with its own dynamic state, you can use fluids for thread 
local storage.
 @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}.
+implicitly bound to some definite value).
 @end deffn
 
 @deffn {Scheme Procedure} fluid? obj
@@ -707,8 +710,8 @@ Return @code{#t} iff @var{obj} is a fluid; otherwise, return
 @deffnx {C Function} scm_fluid_ref (fluid)
 Return the value associated with @var{fluid} in the current
 dynamic root.  If @var{fluid} has not been set, then return
address@hidden Calling @code{fluid-ref} on an unbound fluid produces a
-runtime error.
+its default value. Calling @code{fluid-ref} on an unbound fluid produces
+a runtime error.
 @end deffn
 
 @deffn {Scheme Procedure} fluid-set! fluid value
@@ -820,6 +823,119 @@ Like @code{scm_with_dynamic_state}, but call @var{func} 
with
 @var{data}.
 @end deftypefn
 
address@hidden Parameters
address@hidden Parameters
+
address@hidden SRFI-39
address@hidden parameter object
address@hidden Parameter
+
+A parameter object is a procedure.  Calling it with no arguments returns
+its value.  Calling it with one argument sets the value.
+
address@hidden
+(define my-param (make-parameter 123))
+(my-param) @result{} 123
+(my-param 456)
+(my-param) @result{} 456
address@hidden example
+
+The @code{parameterize} special form establishes new locations for
+parameters, those new locations having effect within the dynamic scope
+of the @code{parameterize} body.  Leaving restores the previous
+locations.  Re-entering (through a saved continuation) will again use
+the new locations.
+
address@hidden
+(parameterize ((my-param 789))
+  (my-param)) @result{} 789
+(my-param) @result{} 456
address@hidden example
+
+Parameters are like dynamically bound variables in other Lisp dialects.
+They allow an application to establish parameter settings (as the name
+suggests) just for the execution of a particular bit of code, restoring
+when done.  Examples of such parameters might be case-sensitivity for a
+search, or a prompt for user input.
+
+Global variables are not as good as parameter objects for this sort of
+thing.  Changes to them are visible to all threads, but in Guile
+parameter object locations are per-thread, thereby truly limiting the
+effect of @code{parameterize} to just its dynamic execution.
+
+Passing arguments to functions is thread-safe, but that soon becomes
+tedious when there's more than a few or when they need to pass down
+through several layers of calls before reaching the point they should
+affect.  And introducing a new setting to existing code is often easier
+with a parameter object than adding arguments.
+
address@hidden make-parameter init [converter]
+Return a new parameter object, with initial value @var{init}.
+
+If a @var{converter} is given, then a call @code{(@var{converter}
+val)} is made for each value set, its return is the value stored.
+Such a call is made for the @var{init} initial value too.
+
+A @var{converter} allows values to be validated, or put into a
+canonical form.  For example,
+
address@hidden
+(define my-param (make-parameter 123
+                   (lambda (val)
+                     (if (not (number? val))
+                         (error "must be a number"))
+                     (inexact->exact val))))
+(my-param 0.75)
+(my-param) @result{} 3/4
address@hidden example
address@hidden defun
+
address@hidden {Scheme Syntax} parameterize ((param value) @dots{}) body @dots{}
+Establish a new dynamic scope with the given @var{param}s bound to new
+locations and set to the given @var{value}s.  @var{body} is evaluated
+in that environment, the result is the return from the last form in
address@hidden
+
+Each @var{param} is an expression which is evaluated to get the
+parameter object.  Often this will just be the name of a variable
+holding the object, but it can be anything that evaluates to a
+parameter.
+
+The @var{param} expressions and @var{value} expressions are all
+evaluated before establishing the new dynamic bindings, and they're
+evaluated in an unspecified order.
+
+For example,
+
address@hidden
+(define prompt (make-parameter "Type something: "))
+(define (get-input)
+  (display (prompt))
+  ...)
+
+(parameterize ((prompt "Type a number: "))
+  (get-input)
+  ...)
address@hidden example
address@hidden deffn
+
+Parameter objects are implemented using fluids (@pxref{Fluids and
+Dynamic States}), so each dynamic state has its own parameter
+locations.  That includes the separate locations when outside any
address@hidden form.  When a parameter is created it gets a
+separate initial location in each dynamic state, all initialized to the
+given @var{init} value.
+
+As alluded to above, because each thread usually has a separate dynamic
+state, each thread has its own locations behind parameter objects, and
+changes in one thread are not visible to any other.  When a new dynamic
+state or thread is created, the values of parameters in the originating
+context are copied, into new locations.
+
address@hidden SRFI-39
+Guile's parameters conform to SRFI-39 (@pxref{SRFI-39}).
+
+
 @node Futures
 @subsection Futures
 @cindex futures
diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi
index f7521b4..c2b19fd 100644
--- a/doc/ref/srfi-modules.texi
+++ b/doc/ref/srfi-modules.texi
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 
2007, 2008, 2009, 2010, 2011
address@hidden Copyright (C)  1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 
2007, 2008, 2009, 2010, 2011, 2012
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
 
@@ -3846,134 +3846,14 @@ from a closed port.
 @node SRFI-39
 @subsection SRFI-39 - Parameters
 @cindex SRFI-39
address@hidden parameter object
address@hidden Parameter
 
-This SRFI provides parameter objects, which implement dynamically
-bound locations for values.  The functions below are available from
+This SRFI adds support for dynamically-scoped parameters.  SRFI 39 is
+implemented in the Guile core; there's no module needed to get SRFI-39
+itself.  Parameters are documented in @ref{Parameters}.
 
address@hidden
-(use-modules (srfi srfi-39))
address@hidden example
-
-A parameter object is a procedure.  Called with no arguments it
-returns its value, called with one argument it sets the value.
-
address@hidden
-(define my-param (make-parameter 123))
-(my-param) @result{} 123
-(my-param 456)
-(my-param) @result{} 456
address@hidden example
-
-The @code{parameterize} special form establishes new locations for
-parameters, those new locations having effect within the dynamic scope
-of the @code{parameterize} body.  Leaving restores the previous
-locations, or re-entering through a saved continuation will again use
-the new locations.
-
address@hidden
-(parameterize ((my-param 789))
-  (my-param) @result{} 789
-  )
-(my-param) @result{} 456
address@hidden example
-
-Parameters are like dynamically bound variables in other Lisp dialects.
-They allow an application to establish parameter settings (as the name
-suggests) just for the execution of a particular bit of code,
-restoring when done.  Examples of such parameters might be
-case-sensitivity for a search, or a prompt for user input.
-
-Global variables are not as good as parameter objects for this sort of
-thing.  Changes to them are visible to all threads, but in Guile
-parameter object locations are per-thread, thereby truly limiting the
-effect of @code{parameterize} to just its dynamic execution.
-
-Passing arguments to functions is thread-safe, but that soon becomes
-tedious when there's more than a few or when they need to pass down
-through several layers of calls before reaching the point they should
-affect.  And introducing a new setting to existing code is often
-easier with a parameter object than adding arguments.
-
-
address@hidden 1
address@hidden make-parameter init [converter]
-Return a new parameter object, with initial value @var{init}.
-
-A parameter object is a procedure.  When called @code{(param)} it
-returns its value, or a call @code{(param val)} sets its value.  For
-example,
-
address@hidden
-(define my-param (make-parameter 123))
-(my-param) @result{} 123
-
-(my-param 456)
-(my-param) @result{} 456
address@hidden example
-
-If a @var{converter} is given, then a call @code{(@var{converter}
-val)} is made for each value set, its return is the value stored.
-Such a call is made for the @var{init} initial value too.
-
-A @var{converter} allows values to be validated, or put into a
-canonical form.  For example,
-
address@hidden
-(define my-param (make-parameter 123
-                   (lambda (val)
-                     (if (not (number? val))
-                         (error "must be a number"))
-                     (inexact->exact val))))
-(my-param 0.75)
-(my-param) @result{} 3/4
address@hidden example
address@hidden defun
-
address@hidden {library syntax} parameterize ((param value) @dots{}) body 
@dots{}
-Establish a new dynamic scope with the given @var{param}s bound to new
-locations and set to the given @var{value}s.  @var{body} is evaluated
-in that environment, the result is the return from the last form in
address@hidden
-
-Each @var{param} is an expression which is evaluated to get the
-parameter object.  Often this will just be the name of a variable
-holding the object, but it can be anything that evaluates to a
-parameter.
-
-The @var{param} expressions and @var{value} expressions are all
-evaluated before establishing the new dynamic bindings, and they're
-evaluated in an unspecified order.
-
-For example,
-
address@hidden
-(define prompt (make-parameter "Type something: "))
-(define (get-input)
-  (display (prompt))
-  ...)
-
-(parameterize ((prompt "Type a number: "))
-  (get-input)
-  ...)
address@hidden example
address@hidden deffn
-
address@hidden {Parameter object} current-input-port [new-port]
address@hidden {Parameter object} current-output-port [new-port]
address@hidden {Parameter object} current-error-port [new-port]
-This SRFI extends the core @code{current-input-port} and
address@hidden, making them parameter objects.  The
-Guile-specific @code{current-error-port} is extended too, for
-consistency.  (@pxref{Default Ports}.)
-
-This is an upwardly compatible extension, a plain call like
address@hidden(current-input-port)} still returns the current input port, and
address@hidden can still be used.  But the port can now
-also be set with @code{(current-input-port my-port)} and bound
-dynamically with @code{parameterize}.
address@hidden deffn
+This module does export one extra function: @code{with-parameters*}.
+This is a Guile-specific addition to the SRFI, similar to the core
address@hidden (@pxref{Fluids and Dynamic States}).
 
 @defun with-parameters* param-list value-list thunk
 Establish a new dynamic scope, as per @code{parameterize} above,
@@ -3981,30 +3861,8 @@ taking parameters from @var{param-list} and 
corresponding values from
 @var{values-list}.  A call @code{(@var{thunk})} is made in the new
 scope and the result from that @var{thunk} is the return from
 @code{with-parameters*}.
-
-This function is a Guile-specific addition to the SRFI, it's similar
-to the core @code{with-fluids*} (@pxref{Fluids and Dynamic States}).
 @end defun
 
-
address@hidden 1
-Parameter objects are implemented using fluids (@pxref{Fluids and
-Dynamic States}), so each dynamic state has it's own parameter
-locations.  That includes the separate locations when outside any
address@hidden form.  When a parameter is created it gets a
-separate initial location in each dynamic state, all initialized to
-the given @var{init} value.
-
-As alluded to above, because each thread usually has a separate
-dynamic state, each thread has it's own locations behind parameter
-objects, and changes in one thread are not visible to any other.  When
-a new dynamic state or thread is created, the values of parameters in
-the originating context are copied, into new locations.
-
-SRFI-39 doesn't specify the interaction between parameter objects and
-threads, so the threading behaviour described here should be regarded
-as Guile-specific.
-
 @node SRFI-42
 @subsection SRFI-42 - Eager Comprehensions
 @cindex SRFI-42
diff --git a/libguile/fluids.c b/libguile/fluids.c
index f92c5dd..f1c09cb 100644
--- a/libguile/fluids.c
+++ b/libguile/fluids.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996,1997,2000,2001, 2004, 2006, 2007, 2008, 2009, 2010, 2011 
Free Software Foundation, Inc.
+/* Copyright (C) 1996,1997,2000,2001, 2004, 2006, 2007, 2008, 2009, 2010, 
2011, 2012 Free Software Foundation, Inc.
  * 
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -179,7 +179,8 @@ scm_make_fluid (void)
 
 SCM_DEFINE (scm_make_fluid_with_default, "make-fluid", 0, 1, 0, 
            (SCM dflt),
-           "Return a newly created fluid.\n"
+           "Return a newly created fluid, whose initial value is @var{dflt},\n"
+            "or @code{#f} if @var{dflt} is not given.\n"
            "Fluids are objects that can hold one\n"
            "value per dynamic state.  That is, modifications to this value 
are\n"
            "only visible to code that executes with the same dynamic state 
as\n"


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]