/usr/lib/replace.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 | ; Scheme 9 from Empty Space, Function Library
; By Nils M Holm, 2009
; Placed in the Public Domain
;
; (replace object-old object-new pair) ==> pair
;
; Replace elements of a pair. OBJECT-OLD is the object to be
; replaced and OBJECT-NEW is the new object.
;
; Example: (replace '(x) '(y) '(lambda (x) y)) ==> (lambda (y) y)
(define (replace old new obj)
(cond ((equal? obj old)
new)
((pair? obj)
(cons (replace old new (car obj))
(replace old new (cdr obj))))
(else
obj)))
|