/usr/lib/iota.scm is in scheme9 2013.11.26-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ; Scheme 9 from Empty Space, Function Library
; By Nils M Holm, 2009-2012
; Placed in the Public Domain
;
; (iota integer) ==> list
; (iota integer1 integer2) ==> list
; (iota* integer1 integer2) ==> list
;
; (load-from-library "iota.scm")
;
; IOTA creates a sequence of integers starting at 1 and ending
; at INTEGER (including both). When a second argument is passed
; to IOTA, the sequence returned by it will start at INTEGER1
; and ; end at INTEGER2 (again, including both).
;
; IOTA* differs from IOTA in two ways: it always takes two
; arguments and excludes INTEGER2 from the generated sequence.
;
; Example: (iota 7) ==> (1 2 3 4 5 6 7)
; (iota 17 21) ==> (17 18 19 20 21)
; (iota* 17 21) ==> (17 18 19 20)
; (iota* 1 1) ==> ()
(define (iota* l h)
(if (> l h)
(error "iota*: bad range" (list l h)))
(let j ((x (- h 1))
(r '()))
(if (< x l)
r
(j (- x 1) (cons x r)))))
(define (iota l . h)
(let ((l (if (null? h) 1 l))
(h (if (null? h) l (car h))))
(iota* l (+ 1 h))))
|