/usr/share/zenlisp/sum.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 | ; zenlisp example program
; By Nils M Holm, 1998-2007
; See the file LICENSE for conditions of use.
; Compute the sum of a sequence of positive numbers:
; (sum '#2 '#5) => '#14
(require '~nmath)
(define (sum n m)
(letrec
((s (lambda (n m)
(let ((x (+ '#1 (- m n))))
(+ (quotient (+ (* x x) x)
'#2)
(* (- n '#1) x))))))
(let ((nn (natural n))
(nm (natural m)))
(cond ((or (zero nn) (zero nm))
(bottom 'sum n m))
(t (s (min nn nm) (max nn nm)))))))
|