/usr/lib/string-prefixeqp.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 | ; Scheme 9 from Empty Space, Function Library
; By Nils M Holm, 2010
; Placed in the Public Domain
;
; (string-prefix=? string1 string2) ==> boolean
; (string-prefix-ci=? string1 string2) ==> boolean
;
; Return #T when STRING2 has a prefix of STRING1 and otherwise
; return #F. STRING-PREFIX-CI=? performs the same operation, but
; ignores the case of the strings.
;
; Example: (string-prefix=? "foo" "foobar") ==> #t
; (string-prefix=? "foo" "fubar") ==> #f
(define (make-s-p=? op)
(lambda (p s)
(let ((k (string-length p)))
(and (>= (string-length s) k)
(op p (substring s 0 k))))))
(define string-prefix=? (make-s-p=? string=?))
(define string-prefix-ci=? (make-s-p=? string-ci=?))
|