unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Kevin Ryde <user42@zip.com.au>
Subject: doco srfi-1 iota
Date: Tue, 08 Jul 2003 07:57:24 +1000	[thread overview]
Message-ID: <871xx2ov97.fsf@zip.com.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]

        * srfi-modules.texi (SRFI-1 Constructors): In iota, reword a bit for
        clarity and add a couple of examples.

I found the formula for each element less clear than it could be, and
thought a couple of examples would be enough to illustrate what
happens.


 - Scheme Procedure: iota count [start step]
     Return a list containing COUNT numbers, starting from START and
     adding STEP each time.  The default START is 0, the default STEP
     is 1.  For example,

          (iota 6)        => (0 1 2 3 4 5)
          (iota 4 2.5 -2) => (2.5 0.5 -1.5 -3.5)

     This function takes its name from the corresponding primitive in
     the APL language.



[-- Attachment #2: srfi-modules.texi.iota.diff --]
[-- Type: text/plain, Size: 807 bytes --]

--- srfi-modules.texi.~1.18.~	2003-06-05 01:47:08.000000000 +1000
+++ srfi-modules.texi	2003-07-06 11:53:08.000000000 +1000
@@ -220,12 +220,17 @@
 @end deffn
 
 @deffn {Scheme Procedure} iota count [start step]
-Return a list containing @var{count} elements, where each element is
-calculated as follows:
+Return a list containing @var{count} numbers, starting from
+@var{start} and adding @var{step} each time.  The default @var{start}
+is 0, the default @var{step} is 1.  For example,
 
-@var{start} + (@var{count} - 1) * @var{step}
+@example
+(iota 6)        @result{} (0 1 2 3 4 5)
+(iota 4 2.5 -2) @result{} (2.5 0.5 -1.5 -3.5)
+@end example
 
-@var{start} defaults to 0 and @var{step} defaults to 1.
+This function takes its name from the corresponding primitive in the
+APL language.
 @end deffn
 
 

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel

             reply	other threads:[~2003-07-07 21:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-07 21:57 Kevin Ryde [this message]
2003-07-07 23:16 ` doco srfi-1 iota Han-Wen Nienhuys
2003-07-11 22:43   ` Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871xx2ov97.fsf@zip.com.au \
    --to=user42@zip.com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).