Subject: Re: array-iota
From: rpw3@rpw3.org (Rob Warnock)
Date: Wed, 12 Dec 2007 22:09:24 -0600
Newsgroups: comp.lang.lisp
Message-ID: <dISdnWSH_P7pLf3anZ2dnUVZ_ryqnZ2d@speakeasy.net>
Maciej Katafiasz  <mathrick@gmail.com> wrote:
+---------------
| skrev metaperl.com:
| > Before I implement this in Lisp, I would like to know if it has already
| > been done. Examples of the Scheme version follow:
| 
| Rob Warnock mentioned having a iota in his library,
| in the J thread a couple posts back.
+---------------

Thanks, but it's not relevant to metaperl's request.
Mine is just the naive list-valued version:

    > (defun iota (count &optional (start 0) (step 1))
        (loop repeat count for i from start by step collect i))

    IOTA
    > (iota 20)

    (0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19)
    > (iota 20 13)

    (13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32)
    > (iota 20 13 5)

    (13 18 23 28 33 38 43 48 53 58 63 68 73 78 83 88 93 98 103 108)
    > 


-Rob

p.s. Although I must admit the IOTA/MOD/STRIDE I ended up with
in the "SETF...Self Similar" thread was kinda interesting...  ;-}
[But still not applicable to metaperl's request.]

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607