/usr/share/zenlisp/iter.l is in zenlisp 2013.11.22-2.
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 | ; zenlisp iterators
; By Nils M Holm, 2007, 2008
; Feel free to copy, share, and modify this code.
; See the file LICENSE for details.
(define iter :t)
(define (arithmetic-iterator conv fn neutral)
(lambda x
(cond ((null x) neutral)
(t (fold (lambda (a b)
(fn (conv a) (conv b)))
(car x)
(cdr x))))))
(define (predicate-iterator conv fn)
(let ((:fail (cons ':fail ())))
(let ((comp (lambda (a b)
(cond ((eq a :fail) :fail)
((fn (conv a) (conv b)) b)
(t :fail)))))
(lambda (first . rest)
(cond ((null rest) (bottom '(too few arguments)))
(t (neq (fold comp first rest) :fail)))))))
|