/usr/lib/count.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 | ; Scheme 9 from Empty Space, Function Library
; By Nils M Holm, 2009,2010
; Placed in the Public Domain
;
; (count pair) ==> integer
;
; Count atomic members of a pair.
;
; Example: (count '(a (b (c)) d . e)) ==> 5
(define (count x)
(cond ((null? x) 0)
((pair? x)
(+ (count (car x))
(count (cdr x))))
(else 1)))
|