guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 01/01: Single definition of (iota)


From: Daniel Llorens
Subject: [Guile-commits] 01/01: Single definition of (iota)
Date: Fri, 6 Dec 2019 08:11:48 -0500 (EST)

lloda pushed a commit to branch master
in repository guile.

commit 334102da90316a0e066b17ec06286fb71192432d
Author: Daniel Llorens <address@hidden>
Date:   Fri Dec 6 13:08:08 2019 +0100

    Single definition of (iota)
    
    * module/ice-9/boot-9.scm (iota): Fix to be SRFI-1 compatible.
    * module/srfi/srfi-1.scm: Re-export iota.
---
 NEWS                    | 209 +++++++++++++++++++++++++-----------------------
 module/ice-9/boot-9.scm |  53 ++++++------
 module/srfi/srfi-1.scm  |  30 +++----
 3 files changed, 151 insertions(+), 141 deletions(-)

diff --git a/NEWS b/NEWS
index 185f592..49292f1 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,17 @@ See the end for copying conditions.
 
 Please send Guile bug reports to address@hidden.
 
+
+Changes since alpha 2.9.6:
+
+* Notable changes
+
+** (iota) in core and SRFI-1 (iota) are the same
+
+Previously, (iota) in core would not accept start and step arguments and
+would return an empty list for negative count. Now there is only one
+(iota) function with the semantics of SRFI-1 (negative count is an
+error).
 
 
 Changes in alpha 2.9.6 (since alpha 2.9.5):
@@ -1362,7 +1373,7 @@ These functions now require a valid `encoding' argument, 
and will abort
 if given `NULL'.
 
 ** All r6rs ports are both textual and binary
-    
+
 Because R6RS ports are a thin layer on top of Guile's ports, and Guile's
 ports are both textual and binary, Guile's R6RS ports are also both
 textual and binary, and thus both kinds have port transcoders.  This is
@@ -1492,7 +1503,7 @@ is now deprecated.  Instead, users should just use 
`make-vtable' with
 appropriate arguments.  See "Structures" in the manual for all of the
 details.  As such, `record-type-vtable' and `%condition-type-vtable' now
 have a parent vtable and are no longer roots of the vtable hierarchy.
-    
+
 ** Syntax parameters are a distinct type
 
 Guile 2.0's transitional implementation of `syntax-parameterize' was
@@ -1504,7 +1515,7 @@ and only such bindings may be parameterized.  See "Syntax 
Parameters" in
 the manual for more.
 
 ** Defined identifiers scoped in the current module
-    
+
 Sometimes Guile's expander would attach incorrect module scoping
 information for top-level bindings made by an expansion.  For example,
 given the following R6RS library:
@@ -1528,7 +1539,7 @@ It wasn't clear that we could fix this in Guile 2.0 
without breaking
 someone's delicate macros, so the fix is only coming out now.
 
 ** Pseudo-hygienically rename macro-introduced bindings
-    
+
 Bindings introduced by macros, like `t' in the `defconst' example above,
 are now given pseudo-fresh names.  This allows
 
@@ -1542,7 +1553,7 @@ pseudo-fresh names.  See "Hygiene and the Top-Level" in 
the manual, for
 details.
 
 ** Fix literal matching for module-bound literals
-    
+
 `syntax-rules' and `syntax-case' macros can take a set of "literals":
 bound or unbound keywords that the syntax matcher treats specially.
 Before, literals were always matched symbolically (by name).  Now they
@@ -2773,7 +2784,7 @@ See "Hash Tables".
 See "Bitwise Operations".
 
 ** New foreign types: `ssize_t', `ptrdiff_t'
-    
+
 See "Foreign Types".
 
 ** New C helpers: `scm_from_ptrdiff_t', `scm_to_ptrdiff_t'
@@ -2802,7 +2813,7 @@ See "REPL Commands" in the manual for information on the 
new
 user-customizable REPL printer.
 
 ** New variable: %site-ccache-dir
-    
+
 The "Installing Site Packages" and "Build Config" manual sections now
 refer to this variable to describe where users should install their
 `.go' files.
@@ -3275,7 +3286,7 @@ 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
@@ -3283,7 +3294,7 @@ property is always correct (or, as correct 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 information on how to use the
@@ -3322,7 +3333,7 @@ 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.
@@ -3335,7 +3346,7 @@ 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
@@ -3344,14 +3355,14 @@ set the `scm_install_gmp_memory_functions' variable to 
a nonzero value
 before loading Guile.
 
 ** 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.
 
@@ -3362,9 +3373,9 @@ Following Racket's lead, Guile now supports syntax 
parameters.  See
 
 Also see Barzilay, Culpepper, and Flatt's 2011 SFP workshop paper,
 "Keeping it Clean with syntax-parameterize".
-    
+
 ** 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
@@ -3504,12 +3515,12 @@ See "Web Client" in the manual, for more.
 See "Installing Site Packages" in the manual.
 
 ** Remove Front-Cover and Back-Cover text from the manual.
-    
+
 The manual is still under the GNU Free Documentation License, but no
 longer has any invariant sections.
 
 ** More helpful `guild help'.
-    
+
 `guild' is Guile's multi-tool, for use in shell scripting.  Now it has a
 nicer interface for querying the set of existing commands, and getting
 help on those commands.  Try it out and see!
@@ -3525,7 +3536,7 @@ The output of this command now has microsecond precision, 
instead of
 10-millisecond precision.
 
 ** `(ice-9 match)' can now match records.
-    
+
 See "Pattern Matching" in the manual, for more on matching records.
 
 ** New module: `(language tree-il debug)'.
@@ -3534,7 +3545,7 @@ This module provides a tree-il verifier.  This is useful 
for people that
 generate tree-il, usually as part of a language compiler.
 
 ** New functions: `scm_is_exact', `scm_is_inexact'.
-    
+
 These provide a nice C interface for Scheme's `exact?' and `inexact?',
 respectively.
 
@@ -3571,25 +3582,25 @@ Changes in 2.0.2 (since 2.0.1):
 * Notable changes
 
 ** `guile-tools' renamed to `guild'
-    
+
 The new name is shorter.  Its intended future use is for a CPAN-like
 system for Guile wizards and journeyfolk to band together to share code;
 hence the name.  `guile-tools' is provided as a backward-compatible
 symbolic link.  See "Using Guile Tools" in the manual, for more.
 
 ** New control operators: `shift' and `reset'
-    
+
 See "Shift and Reset" in the manual, for more information.
 
 ** `while' as an expression
-    
+
 Previously the return value of `while' was unspecified.  Now its
 values are specified both in the case of normal termination, and via
 termination by invoking `break', possibly with arguments.  See "while
 do" in the manual for more.
 
 ** Disallow access to handles of weak hash tables
-    
+
 `hash-get-handle' and `hash-create-handle!' are no longer permitted to
 be called on weak hash tables, because the fields in a weak handle could
 be nulled out by the garbage collector at any time, but yet they are
@@ -3597,18 +3608,18 @@ otherwise indistinguishable from pairs.  Use `hash-ref' 
and `hash-set!'
 instead.
 
 ** More precision for `get-internal-run-time', `get-internal-real-time'
-    
+
 On 64-bit systems which support POSIX clocks, Guile's internal timing
 procedures offer nanosecond resolution instead of the 10-millisecond
 resolution previously available.  32-bit systems now use 1-millisecond
 timers.
 
 ** Guile now measures time spent in GC
-    
+
 `gc-stats' now returns a meaningful value for `gc-time-taken'.
 
 ** Add `gcprof'
-    
+
 The statprof profiler now exports a `gcprof' procedure, driven by the
 `after-gc-hook', to see which parts of your program are causing GC.  Let
 us know if you find it useful.
@@ -3624,22 +3635,22 @@ core `map', SRFI-1 `map', and GOOPS.
 Also it's pretty cool that we can do this without a performance impact.
 
 ** Add `scm_peek_byte_or_eof'.
-    
+
 This helper is like `scm_peek_char_or_eof', but for bytes instead of
 full characters.
 
 ** Implement #:stop-at-first-non-option option for getopt-long
-    
+
 See "getopt-long Reference" in the manual, for more information.
 
 ** Improve R6RS conformance for conditions in the I/O libraries
-    
+
 The `(rnrs io simple)' module now raises the correct R6RS conditions in
 error cases.  `(rnrs io ports)' is also more correct now, though it is
 still a work in progress.
 
 ** All deprecated routines emit warnings
-    
+
 A few deprecated routines were lacking deprecation warnings.  This has
 been fixed now.
 
@@ -3656,7 +3667,7 @@ as much as possible, in the entire compilation unit.  
This cuts compiled
 These procedures are now twice as fast as they were.
 
 ** UTF-8 ports to bypass `iconv' entirely
-    
+
 This reduces memory usage in a very common case.
 
 ** Compiler speedups
@@ -3666,7 +3677,7 @@ once the compiler is itself compiled, so the build still 
takes as long
 as it did before.)
 
 ** VM speed tuning
-    
+
 Some assertions that were mostly useful for sanity-checks on the
 bytecode compiler are now off for both "regular" and "debug" engines.
 This together with a fix to cache a TLS access and some other tweaks
@@ -3683,14 +3694,14 @@ These procedures are now at least twice as fast than in 
2.0.1.
 * Deprecations
 
 ** Deprecate scm_whash API
-    
+
 `scm_whash_get_handle', `SCM_WHASHFOUNDP', `SCM_WHASHREF',
 `SCM_WHASHSET', `scm_whash_create_handle', `scm_whash_lookup', and
 `scm_whash_insert' are now deprecated.  Use the normal hash table API
 instead.
 
 ** Deprecate scm_struct_table
-    
+
 `SCM_STRUCT_TABLE_NAME', `SCM_SET_STRUCT_TABLE_NAME',
 `SCM_STRUCT_TABLE_CLASS', `SCM_SET_STRUCT_TABLE_CLASS',
 `scm_struct_table', and `scm_struct_create_handle' are now deprecated.
@@ -3698,13 +3709,13 @@ These routines formed part of the internals of the map 
between structs
 and classes.
 
 ** Deprecate scm_internal_dynamic_wind
-    
+
 The `scm_t_inner' type and `scm_internal_dynamic_wind' are deprecated,
 as the `scm_dynwind' API is better, and this API encourages users to
 stuff SCM values into pointers.
 
 ** Deprecate scm_immutable_cell, scm_immutable_double_cell
-    
+
 These routines are deprecated, as the GC_STUBBORN API doesn't do
 anything any more.
 
@@ -3733,14 +3744,14 @@ ports)' documentation from the R6RS documentation.  
Thanks Andreas!
 ** Fix unaligned accesses for bytevectors of complex numbers
 ** Fix '(a #{.} b)
 ** Fix erroneous VM stack overflow for canceled threads
-    
+
 
 Changes in 2.0.1 (since 2.0.0):
 
 * Notable changes
 
 ** guile.m4 supports linking with rpath
-    
+
 The GUILE_FLAGS macro now sets GUILE_LIBS and GUILE_LTLIBS, which
 include appropriate directives to the linker to include libguile-2.0.so
 in the runtime library lookup path.
@@ -3777,11 +3788,11 @@ modules and their public interfaces.  See 
`scm_c_public_ref' and friends
 in "Accessing Modules from C" in the manual.
 
 ** Added `scm_call_5', `scm_call_6'
-    
+
 See "Fly Evaluation" in the manual.
 
 ** Added `scm_from_latin1_keyword', `scm_from_utf8_keyword'
-    
+
 See "Keyword Procedures" in the manual, for more.  Note that
 `scm_from_locale_keyword' should not be used when the name is a C string
 constant.
@@ -3794,17 +3805,17 @@ and `current-error-port' from `(rnrs io ports)', and 
enhanced support
 for transcoders.
 
 ** Added `pointer->scm', `scm->pointer' to `(system foreign)'
-    
+
 These procedure are useful if one needs to pass and receive SCM values
 to and from foreign functions.  See "Foreign Variables" in the manual,
 for more.
-    
+
 ** Added `heap-allocated-since-gc' to `(gc-stats)'
 
 Also fixed the long-standing bug in the REPL `,stat' command.
-    
+
 ** Add `on-error' REPL option
-    
+
 This option controls what happens when an error occurs at the REPL, and
 defaults to `debug', indicating that Guile should enter the debugger.
 Other values include `report', which will simply print a backtrace
@@ -3813,7 +3824,7 @@ without entering the debugger.  See "System Commands" in 
the manual.
 ** Enforce immutability of string literals
 
 Attempting to mutate a string literal now causes a runtime error.
-    
+
 ** Fix pthread redirection
 
 Guile 2.0.0 shipped with headers that, if configured with pthread
@@ -3830,26 +3841,26 @@ A throw to `quit' in a continuation barrier will cause 
Guile to exit.
 Before, it would do so before unwinding to the barrier, which would
 prevent cleanup handlers from running.  This has been fixed so that it
 exits only after unwinding.
-    
+
 ** `string->pointer' and `pointer->string' have optional encoding arg
-    
+
 This allows users of the FFI to more easily deal in strings with
 particular (non-locale) encodings, like "utf-8".  See "Void Pointers and
 Byte Access" in the manual, for more.
 
 ** R6RS fixnum arithmetic optimizations
-    
+
 R6RS fixnum operations are are still slower than generic arithmetic,
 however.
 
 ** New procedure: `define-inlinable'
-    
+
 See "Inlinable Procedures" in the manual, for more.
 
 ** New procedure: `exact-integer-sqrt'
 
 See "Integer Operations" in the manual, for more.
-    
+
 ** "Extended read syntax" for symbols parses better
 
 In #{foo}# symbols, backslashes are now treated as escapes, as the
@@ -3880,7 +3891,7 @@ The humble `error' SRFI now has an entry in the manual.
 ** `(ice-9 binary-ports)': "R6RS I/O Ports", in the manual
 ** `(ice-9 eval-string)': "Fly Evaluation", in the manual
 ** `(ice-9 command-line)', not documented yet
-    
+
 * Bugs fixed
 
 ** Fixed `iconv_t' memory leak on close-port
@@ -3965,7 +3976,7 @@ Changes in 2.0.0 (changes since the 1.8.x series):
 ** `(web server http)', HTTP-over-TCP web server implementation
 
 ** Replaced `(ice-9 match)' with Alex Shinn's compatible, hygienic matcher.
-    
+
 Guile's copy of Andrew K. Wright's `match' library has been replaced by
 a compatible hygienic implementation by Alex Shinn.  It is now
 documented, see "Pattern Matching" in the manual.
@@ -3975,7 +3986,7 @@ Compared to Andrew K. Wright's `match', the new `match' 
lacks
 `match:error', `match:set-error', and all structure-related procedures.
 
 ** Imported statprof, SSAX, and texinfo modules from Guile-Lib
-    
+
 The statprof statistical profiler, the SSAX XML toolkit, and the texinfo
 toolkit from Guile-Lib have been imported into Guile proper. See
 "Standard Library" in the manual for more details.
@@ -4018,9 +4029,9 @@ Guile had an unused `--emacs' command line argument that 
was supposed to
 help when running Guile inside Emacs. This option has been removed, and
 the helper functions `named-module-use!' and `load-emacs-interface' have
 been deprecated.
-    
+
 ** Add `(system repl server)' module and `--listen' command-line argument
-    
+
 The `(system repl server)' module exposes procedures to listen on
 sockets for connections, and serve REPLs to those clients.  The --listen
 command-line argument allows any Guile program to thus be remotely
@@ -4052,7 +4063,7 @@ Additionally, Guile follows the R6RS newline escaping 
rules when the
 See "String Syntax" in the manual, for more information.
 
 ** Function profiling and tracing at the REPL
-    
+
 The `,profile FORM' REPL meta-command can now be used to statistically
 profile execution of a form, to see which functions are taking the most
 time. See `,help profile' for more information.
@@ -4092,7 +4103,7 @@ Backtraces may now be disclosed with the keyboard in 
addition to the
 mouse.
 
 ** Load path change: search in version-specific paths before site paths
-    
+
 When looking for a module, Guile now searches first in Guile's
 version-specific path (the library path), *then* in the site dir. This
 allows Guile's copy of SSAX to override any Guile-Lib copy the user has
@@ -4111,7 +4122,7 @@ When readline is enabled, tab completion works for 
arguments too, not
 just for the operator position.
 
 ** Expression-oriented readline history
-    
+
 Guile's readline history now tries to operate on expressions instead of
 input lines.  Let us know what you think!
 
@@ -4148,7 +4159,7 @@ information.
 
 Please contact address@hidden if you have found an issue not
 mentioned in that compatibility list.
-    
+
 ** New implementation of `primitive-eval'
 
 Guile's `primitive-eval' is now implemented in Scheme. Actually there is
@@ -4234,7 +4245,7 @@ These socket procedures now take bytevectors as 
arguments, instead of
 strings.  There is some deprecated string support, however.
 
 ** New GNU procedures: `setaffinity' and `getaffinity'.
-    
+
 See "Processes" in the manual, for more information.
 
 ** New procedures: `compose', `negate', and `const'
@@ -4342,13 +4353,13 @@ It used to be you had to export `helper' from `(foo)' 
as well.
 Thankfully, this has been fixed.
 
 ** Support for version information in Guile's `module' form
-    
+
 Guile modules now have a `#:version' field.  See "R6RS Version
 References", "General Information about Modules", "Using Guile Modules",
 and "Creating Guile Modules" in the manual for more information.
 
 ** Support for renaming bindings on module export
-    
+
 Wherever Guile accepts a symbol as an argument to specify a binding to
 export, it now also accepts a pair of symbols, indicating that a binding
 should be renamed on export. See "Creating Guile Modules" in the manual
@@ -4358,9 +4369,9 @@ for more information.
 
 This procedure exports all current and future bindings from a module.
 Use as `(module-export-all! (current-module))'.
-    
+
 ** New procedure `reload-module', and `,reload' REPL command
-    
+
 See "Module System Reflection" and "Module Commands" in the manual, for
 more information.
 
@@ -4464,9 +4475,9 @@ context.
 Following the R6RS, "variable transformers" are settable
 identifier-syntax. See "Identifier macros" in the manual, for more
 information.
-    
+
 ** syntax-case treats `_' as a placeholder
-    
+
 Following R6RS, a `_' in a syntax-rules or syntax-case pattern matches
 anything, and binds no pattern variables. Unlike the R6RS, Guile also
 permits `_' to be in the literals list for a pattern.
@@ -4531,7 +4542,7 @@ actually used this, this behavior may be reinstated via 
the
 `read-hash-extend' mechanism.
 
 ** `unquote' and `unquote-splicing' accept multiple expressions
-    
+
 As per the R6RS, these syntax operators can now accept any number of
 expressions to unquote.
 
@@ -4571,7 +4582,7 @@ differences, however. Please mail address@hidden if you 
see any
 deficiencies with Guile's backtraces.
 
 ** `positions' reader option enabled by default
-    
+
 This change allows primitive-load without --auto-compile to also
 propagate source information through the expander, for better errors and
 to let macros know their source locations.  The compiler was already
@@ -4640,7 +4651,7 @@ and a deprecation warning is raised as appropriate.
 Finally, to support lazy loading of modules as one used to be able to do
 with module binder procedures, Guile now has submodule binders, called
 if a given submodule is not found. See boot-9.scm for more information.
-    
+
 ** New procedures: module-ref-submodule, module-define-submodule,
    nested-ref-module, nested-define-module!, local-ref-module,
    local-define-module
@@ -4672,7 +4683,7 @@ loading a module is one that has the needed bindings, 
instead of relying
 on chance.
 
 ** `load' is a macro (!) that resolves paths relative to source file dir
-    
+
 The familiar Schem `load' procedure is now a macro that captures the
 name of the source file being expanded, and dispatches to the new
 `load-in-vicinity'.  Referencing `load' by bare name returns a closure
@@ -4841,7 +4852,7 @@ to maintain compatibility with Guile 1.8 and earlier.
 This can be the case, for example, in case-lambda procedures. The
 arities of compiled procedures may be accessed via procedures from the
 `(system vm program)' module; see "Compiled Procedures", "Optional
-Arguments", and "Case-lambda" in the manual. 
+Arguments", and "Case-lambda" in the manual.
 
 ** Deprecate arity access via (procedure-properties proc 'arity)
 
@@ -4885,7 +4896,7 @@ warning if a number is passed as its first argument.
 
 Also, it used to be that you could omit passing a port to `format', in
 some cases.  This still works, but has been formally deprecated.
-    
+
 ** SRFI-4 vectors reimplemented in terms of R6RS bytevectors
 
 Guile now implements SRFI-4 vectors using bytevectors. Often when you
@@ -4936,7 +4947,7 @@ documentation for more information. Thanks to Andre van 
Tonder for the
 implementation.
 
 ** `*unspecified*' is identifier syntax
-    
+
 `*unspecified*' is no longer a variable, so it is optimized properly by
 the compiler, and is not `set!'-able.
 
@@ -5173,7 +5184,7 @@ the default encoding is UTF-8, instead of being taken 
from the current
 locale.
 
 ** Interactive Guile installs the current locale.
-    
+
 Instead of leaving the user in the "C" locale, running the Guile REPL
 installs the current locale.  [FIXME xref?]
 
@@ -5317,7 +5328,7 @@ This change should inhibit backtraces on argument parsing 
errors.
 itself.
 
 ** New primitive: `tmpfile'.
-    
+
 See "File System" in the manual.
 
 ** Random generator state may be serialized to a datum
@@ -5327,7 +5338,7 @@ may be written out, read back in later, and revivified 
using
 `datum->random-state'.  See "Random" in the manual, for more details.
 
 ** Fix random number generator on 64-bit platforms
-    
+
 There was a nasty bug on 64-bit platforms in which asking for a random
 integer with a range between 2**32 and 2**64 caused a segfault. After
 many embarrassing iterations, this was fixed.
@@ -5368,7 +5379,7 @@ test for the `guile-2' cond-expand feature. Like this:
 These are analogous to %load-path and %load-extensions.
 
 ** New fluid: `%file-port-name-canonicalization'
-    
+
 This fluid parameterizes the file names that are associated with file
 ports. If %file-port-name-canonicalization is 'absolute, then file names
 are canonicalized to be absolute paths. If it is 'relative, then the
@@ -5454,7 +5465,7 @@ So `save-stack', `stack-saved?', and `the-last-stack' 
have been moved to
 `(ice-9 save-stack)', with deprecated bindings left in the root module.
 
 ** `top-repl' has its own module
-    
+
 The `top-repl' binding, called with Guile is run interactively, is now
 is its own module, `(ice-9 top-repl)'. A deprecated forwarding shim was
 left in the default environment.
@@ -5467,7 +5478,7 @@ builds. Additionally, `display-error' will again source 
location
 information for the error.
 
 ** No more `(ice-9 debug)'
-    
+
 This module had some debugging helpers that are no longer applicable to
 the current debugging model. Importing this module will produce a
 deprecation warning. Users should contact bug-guile for support.
@@ -5485,7 +5496,7 @@ on by default.
 ** `turn-on-debugging' deprecated
 
 ** Remove obsolete print-options
-    
+
 The `source' and `closure-hook' print options are obsolete, and have
 been removed.
 
@@ -5528,24 +5539,24 @@ instead.
 
 `@bind' was part of an older implementation of the Emacs Lisp language,
 and is no longer used.
-    
+
 ** Miscellaneous other deprecations
 
 `cuserid' has been deprecated, as it only returns 8 bytes of a user's
 login.  Use `(passwd:name (getpwuid (geteuid)))' instead.
-    
+
 Additionally, the procedures `apply-to-args', `has-suffix?', 
`scheme-file-suffix'
 `get-option', `for-next-option', `display-usage-report',
 `transform-usage-lambda', `collect', and `set-batch-mode?!' have all
 been deprecated.
 
 ** Add support for unbound fluids
-    
+
 See `make-unbound-fluid', `fluid-unset!', and `fluid-bound?' in the
 manual.
 
 ** Add `variable-unset!'
-    
+
 See "Variables" in the manual, for more details.
 
 ** Last but not least, the `λ' macro can be used in lieu of `lambda'
@@ -5564,7 +5575,7 @@ code easier and less error-prone.
 ** New procedures: `scm_to_stringn', `scm_from_stringn'
 ** New procedures: scm_{to,from}_{utf8,latin1}_symbol{n,}
 ** New procedures: scm_{to,from}_{utf8,utf32,latin1}_string{n,}
-    
+
 These new procedures convert to and from string representations in
 particular encodings.
 
@@ -5658,12 +5669,12 @@ Removed the deprecated array functions `scm_i_arrayp',
 `SCM_ARRAY_V', `SCM_ARRAY_BASE', and `SCM_ARRAY_DIMS'.
 
 ** Remove unused snarf macros
-    
+
 `SCM_DEFINE1', `SCM_PRIMITIVE_GENERIC_1', `SCM_PROC1, and `SCM_GPROC1'
 are no more. Use SCM_DEFINE or SCM_PRIMITIVE_GENERIC instead.
 
 ** New functions: `scm_call_n', `scm_c_run_hookn'
-    
+
 `scm_call_n' applies to apply a function to an array of arguments.
 `scm_c_run_hookn' runs a hook with an array of arguments.
 
@@ -5816,7 +5827,7 @@ part of Guile).
 
 Guile's build is visually quieter, due to the use of Automake 1.11's
 AM_SILENT_RULES. Build as `make V=1' to see all of the output.
-    
+
 ** GOOPS documentation folded into Guile reference manual
 
 GOOPS, Guile's object system, used to be documented in separate manuals.
@@ -6006,7 +6017,7 @@ See the `Traps' node of the manual for details.
 Guile now incorporates the `GDS' library (previously distributed
 separately) for working on Guile code from within Emacs.  See the
 `Using Guile In Emacs' node of the manual for details.
- 
+
 * Bugs fixed
 
 ** `scm_add_slot ()' no longer segfaults (fixes bug #22369)
@@ -6301,7 +6312,7 @@ the '--disable-discouraged' option.
 
 (debug-enable 'warn-deprecated) switches them on and (debug-disable
 'warn-deprecated) switches them off.
- 
+
 ** Support for SRFI 61, extended cond syntax for multiple values has
    been added.
 
@@ -6430,9 +6441,9 @@ variable %load-path.
 It now complies with SRFI-4 and the weird prototype based uniform
 array creation has been deprecated.  See the manual for more details.
 
-Some non-compatible changes have been made: 
+Some non-compatible changes have been made:
  - characters can no longer be stored into byte arrays.
- - strings and bit vectors are no longer considered to be uniform numeric 
+ - strings and bit vectors are no longer considered to be uniform numeric
    vectors.
  - array-rank throws an error for non-arrays instead of returning zero.
  - array-ref does no longer accept non-arrays when no indices are given.
@@ -6877,7 +6888,7 @@ easier to use, thread-safe and more future-proof than the 
older
 alternatives.
 
   - int scm_is_* (...)
- 
+
   These are predicates that return a C boolean: 1 or 0.  Instead of
   SCM_NFALSEP, you can now use scm_is_true, for example.
 
@@ -6991,7 +7002,7 @@ about the character encoding.
 Replace according to the following table:
 
     scm_allocate_string       -> scm_c_make_string
-    scm_take_str              -> scm_take_locale_stringn 
+    scm_take_str              -> scm_take_locale_stringn
     scm_take0str              -> scm_take_locale_string
     scm_mem2string            -> scm_from_locale_stringn
     scm_str2string            -> scm_from_locale_string
@@ -7110,15 +7121,15 @@ prevent a potential memory leak:
     scm_dynwind_unwind_handler (free, mem, SCM_F_WIND_EXPLICITLY);
 
     /* MEM would leak if BAR throws an error.
-       SCM_DYNWIND_UNWIND_HANDLER frees it nevertheless.  
+       SCM_DYNWIND_UNWIND_HANDLER frees it nevertheless.
      */
 
     bar ();
-  
+
     scm_dynwind_end ();
 
-    /* Because of SCM_F_WIND_EXPLICITLY, MEM will be freed by 
-       SCM_DYNWIND_END as well. 
+    /* Because of SCM_F_WIND_EXPLICITLY, MEM will be freed by
+       SCM_DYNWIND_END as well.
     */
   }
 
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index b5ce5f3..b602de2 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -6,12 +6,12 @@
 ;;;; modify it under the terms of the GNU Lesser General Public
 ;;;; License as published by the Free Software Foundation; either
 ;;;; version 3 of the License, or (at your option) any later version.
-;;;; 
+;;;;
 ;;;; This library is distributed in the hope that it will be useful,
 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 ;;;; Lesser General Public License for more details.
-;;;; 
+;;;;
 ;;;; You should have received a copy of the GNU Lesser General Public
 ;;;; License along with this library; if not, write to the Free Software
 ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
USA
@@ -883,10 +883,15 @@ VALUE."
 ;;; {IOTA functions: generating lists of numbers}
 ;;;
 
-(define (iota n)
-  (let loop ((count (1- n)) (result '()))
-    (if (< count 0) result
-        (loop (1- count) (cons count result)))))
+;;;  Compatible with srfi-1 so it can just be reused there.
+
+(define* (iota count #:optional (start 0) (step 1))
+  (unless (and (integer? count) (>= count 0))
+    (throw 'wrong-type-arg count))
+  (let loop ((n (- count 1)) (result '()))
+    (if (negative? n)
+      result
+      (loop (- n 1) (cons (+ start (* n step)) result)))))
 
 
 
@@ -989,7 +994,7 @@ VALUE."
         (let lp ((i 0))
           (if (< i n)
               (cons (datum->syntax
-                     x 
+                     x
                      (string->symbol
                       (string (integer->char (+ (char->integer #\a) i)))))
                     (lp (1+ i)))
@@ -2326,7 +2331,7 @@ name extensions listed in %load-extensions."
                                  (map (lambda (x)
                                         (if (symbol? x) x (syntax->datum x)))
                                       fragments))))
-         
+
          (define (getter rtd type-name field slot)
            (define id (make-id rtd type-name '- field))
            #`(define #,id
@@ -3219,7 +3224,7 @@ deterministic."
   (let ((f (module-filename m)))
     (if f
         (save-module-excursion
-         (lambda () 
+         (lambda ()
            ;; Re-set the initial environment, as in try-module-autoload.
            (set-current-module (make-fresh-user-module))
            (primitive-load-path f)
@@ -3342,7 +3347,7 @@ error if selected binding does not exist in the used 
module."
     (or (symbol? x) (and (pair? x) (symbol? (car x)) (symbol? (cdr x)))))
   (define (valid-autoload? x)
     (and (pair? x) (list-of symbol? (car x)) (list-of symbol? (cdr x))))
-  
+
   ;; We could add a #:no-check arg, set by the define-module macro, if
   ;; these checks are taking too much time.
   ;;
@@ -3397,7 +3402,7 @@ error if selected binding does not exist in the used 
module."
       (let ((iface (resolve-interface transformer))
             (sym (car (last-pair transformer))))
         (set-module-transformer! module (module-ref iface sym))))
-    
+
     (run-hook module-defined-hook module)
     module))
 
@@ -3723,7 +3728,7 @@ but it fails to load."
               (let lp ()
                 (call-with-prompt
                  continue-tag
-                 (lambda () 
+                 (lambda ()
                    (define-syntax #,(datum->syntax #'while 'continue)
                      (lambda (x)
                        (syntax-case x ()
@@ -3765,7 +3770,7 @@ but it fails to load."
              (eqv? (string-ref (symbol->string dat) 0) #\:))))
     (define (->keyword sym)
       (symbol->keyword (string->symbol (substring (symbol->string sym) 1))))
-    
+
     (define (parse-iface args)
       (let loop ((in args) (out '()))
         (syntax-case in ()
@@ -3850,7 +3855,7 @@ but it fails to load."
         ((kw val . args)
          (syntax-violation 'define-module "unknown keyword or bad argument"
                            #'kw #'val))))
-    
+
     (syntax-case x ()
       ((_ (name name* ...) arg ...)
        (and-map symbol? (syntax->datum #'(name name* ...)))
@@ -3892,7 +3897,7 @@ but it fails to load."
              (eqv? (string-ref (symbol->string dat) 0) #\:))))
     (define (->keyword sym)
       (symbol->keyword (string->symbol (substring (symbol->string sym) 1))))
-    
+
     (define (quotify-iface args)
       (let loop ((in args) (out '()))
         (syntax-case in ()
@@ -3919,7 +3924,7 @@ but it fails to load."
            (with-syntax (((quoted-arg ...) (quotify-iface #'(arg ...))))
              (lp #'in (cons #`(list '(name name* ...) quoted-arg ...)
                             out)))))))
-    
+
     (syntax-case x ()
       ((_ spec ...)
        (with-syntax (((quoted-args ...) (quotify #'(spec ...))))
@@ -4064,7 +4069,7 @@ but it fails to load."
 
 (define duplicate-handlers
   (let ((m (make-module)))
-    
+
     (define (check module name int1 val1 int2 val2 var val)
       (scm-error 'misc-error
                  #f
@@ -4074,7 +4079,7 @@ but it fails to load."
                        (module-name int1)
                        (module-name int2))
                  #f))
-    
+
     (define (warn module name int1 val1 int2 val2 var val)
       (format (current-warning-port)
               "WARNING: ~A: `~A' imported from both ~A and ~A\n"
@@ -4083,7 +4088,7 @@ but it fails to load."
               (module-name int1)
               (module-name int2))
       #f)
-     
+
     (define (replace module name int1 val1 int2 val2 var val)
       (let* ((replace1 (hashq-ref (module-replacements int1) name))
              (replace2 (hashq-ref (module-replacements int2) name))
@@ -4094,7 +4099,7 @@ but it fails to load."
             (and (or (eq? old new) (not replace2))
                  old)
             (and replace2 new))))
-    
+
     (define (warn-override-core module name int1 val1 int2 val2 var val)
       (and (eq? int1 the-scm-module)
            (begin
@@ -4104,16 +4109,16 @@ but it fails to load."
                      (module-name int2)
                      name)
              (module-local-variable int2 name))))
-     
+
     (define (first module name int1 val1 int2 val2 var val)
       (or var (module-local-variable int1 name)))
-     
+
     (define (last module name int1 val1 int2 val2 var val)
       (module-local-variable int2 name))
-     
+
     (define (noop module name int1 val1 int2 val2 var val)
       #f)
-    
+
     (set-module-name! m 'duplicate-handlers)
     (set-module-kind! m 'interface)
     (module-define! m 'check check)
diff --git a/module/srfi/srfi-1.scm b/module/srfi/srfi-1.scm
index 0806e73..c0ee535 100644
--- a/module/srfi/srfi-1.scm
+++ b/module/srfi/srfi-1.scm
@@ -6,12 +6,12 @@
 ;; modify it under the terms of the GNU Lesser General Public
 ;; License as published by the Free Software Foundation; either
 ;; version 3 of the License, or (at your option) any later version.
-;; 
+;;
 ;; This library is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 ;; Lesser General Public License for more details.
-;; 
+;;
 ;; You should have received a copy of the GNU Lesser General Public
 ;; License along with this library; if not, write to the Free Software
 ;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
@@ -48,7 +48,7 @@
  list-tabulate
  list-copy
  circular-list
- ;; iota                               ; Extended.
+ ;; iota                               <= in the core
 
 ;;; Predicates
  proper-list?
@@ -216,8 +216,9 @@
              caaaar caaadr caadar caaddr cadaar cadadr caddar cadddr
              cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr
              list-ref last-pair length append append! reverse reverse!
-             filter filter! memq memv assq assv set-car! set-cdr!)
-  :replace (iota map for-each map-in-order list-copy list-index member
+             filter filter! memq memv assq assv set-car! set-cdr!
+              iota)
+  :replace (map for-each map-in-order list-copy list-index member
            delete delete! assoc)
   )
 
@@ -266,13 +267,6 @@ INIT-PROC is applied to the indices is not specified."
   (set-cdr! (last-pair elts) elts)
   elts)
 
-(define* (iota count #:optional (start 0) (step 1))
-  (check-arg non-negative-integer? count iota)
-  (let lp ((n 0) (acc '()))
-    (if (= n count)
-       (reverse! acc)
-       (lp (+ n 1) (cons (+ start (* n step)) acc)))))
-
 ;;; Predicates
 
 (define (proper-list? x)
@@ -363,7 +357,7 @@ end-of-list checking in contexts where dotted lists are 
allowed."
 (define take list-head)
 (define drop list-tail)
 
-;;; TAKE-RIGHT and DROP-RIGHT work by getting two pointers into the list, 
+;;; TAKE-RIGHT and DROP-RIGHT work by getting two pointers into the list,
 ;;; off by K, then chasing down the list until the lead pointer falls off
 ;;; the end.  Note that they diverge for circular lists.
 
@@ -591,7 +585,7 @@ has just one element then that's the return value."
        (if (pair? l)
            (cons (f (car l)) (map1 (cdr l)))
            '())))
-    
+
     ((f l1 l2)
      (check-arg procedure? f map)
      (let* ((len1 (length+ l1))
@@ -677,7 +671,7 @@ has just one element then that's the return value."
 
 (define (append-map f clist1 . rest)
   (concatenate (apply map f clist1 rest)))
-  
+
 (define (append-map! f clist1 . rest)
   (concatenate! (apply map f clist1 rest)))
 
@@ -913,7 +907,7 @@ and those making the associations."
    ;; relying on memq/memv to check that = is a procedure.
    ((eq? = eq?) (memq x ls))
    ((eq? = eqv?) (memv x ls))
-   (else 
+   (else
     (check-arg procedure? = member)
     (find-tail (lambda (y) (= x y)) ls))))
 
@@ -961,7 +955,7 @@ given REST parameters."
         (begin
           (check-arg procedure? = lset-adjoin)
           (lambda (x y) (= y x)))))
-  
+
   (let lp ((ans list) (rest rest))
     (if (null? rest)
         ans
@@ -978,7 +972,7 @@ given REST parameters."
         (begin
           (check-arg procedure? = lset-union)
           (lambda (x y) (= y x)))))
-  
+
   (fold (lambda (lis ans)              ; Compute ANS + LIS.
           (cond ((null? lis) ans)      ; Don't copy any lists
                 ((null? ans) lis)      ; if we don't have to.



reply via email to

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