/usr/lib/take.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 | ; Scheme 9 from Empty Space, Function Library
; By Nils M Holm, 2012
; Placed in the Public Domain
;
; (take list integer) ==> list
;
; Copy the first INTEGER conses of a proper list, creating a fresh
; that has the same elements as the original list in the first
; INTEGER positions.
;
; INTEGER may not be larger than the length of LIST.
;
; Example: (take '(foo bar baz) 0) ==> ()
; (take '(foo bar baz) 1) ==> (foo)
; (take '(foo bar baz) 3) ==> (foo bar baz)
(define (take a n)
(let copy ((a a)
(n n)
(r '()))
(if (or (not (pair? a))
(zero? n))
(reverse! r)
(copy (cdr a)
(- n 1)
(cons (car a) r)))))
|