1 ;;; srfi-13.scm --- String Library
3 ;; Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
5 ;; This library is free software; you can redistribute it and/or
6 ;; modify it under the terms of the GNU Lesser General Public
7 ;; License as published by the Free Software Foundation; either
8 ;; version 2.1 of the License, or (at your option) any later version.
10 ;; This library is distributed in the hope that it will be useful,
11 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ;; Lesser General Public License for more details.
15 ;; You should have received a copy of the GNU Lesser General Public
16 ;; License along with this library; if not, write to the Free Software
17 ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 ;; This module is fully documented in the Guile Reference Manual.
25 (define-module (srfi srfi-13)
28 ;; string? string-null? <= in the core
29 string-any string-every
32 ;; make-string string <= in the core
35 ;;; List/string conversion
36 ;; string->list extended
37 ;; list->string <= in the core
42 ;; string-length string-ref <= in the core
43 ;; string-copy extended
46 string-take string-take-right
47 string-drop string-drop-right
48 string-pad string-pad-right
49 string-trim string-trim-right
53 ;; string-set! <= in the core
54 ;; string-fill! extended
57 string-compare string-compare-ci
61 string-ci= string-ci<>
63 string-ci<= string-ci>=
64 string-hash string-hash-ci
68 string-prefix-length-ci
70 string-suffix-length-ci
77 ;; string-index extended
79 string-skip string-skip-right
81 string-contains string-contains-ci
83 ;;; Alphabetic case mapping
85 ;; string-upcase string-upcase! extended
86 ;; string-downcase string-downcase! extended
87 string-titlecase string-titlecase!
90 string-reverse string-reverse!
91 ;; string-append <= in the core
94 string-concatenate-reverse
95 string-concatenate/shared
96 string-concatenate-reverse/shared
99 string-map string-map!
105 string-for-each-index
108 xsubstring string-xcopy!
114 ;;; Filtering/Deleting
118 :replace (string->list string-copy string-fill!
119 string-upcase! string-upcase string-downcase! string-downcase
123 (cond-expand-provide (current-module) '(srfi-13))
125 (load-extension "libguile-srfi-srfi-13-14" "scm_init_srfi_13")
129 (let ((bound (if (pair? rest)
133 (start (if (and (pair? rest) (pair? (cdr rest)))
136 (end (if (and (pair? rest) (pair? (cdr rest)) (pair? (cddr rest)))
139 (hash (substring/shared s start end) bound))))
141 (define string-hash-ci
143 (let ((bound (if (pair? rest)
147 (start (if (and (pair? rest) (pair? (cdr rest)))
150 (end (if (and (pair? rest) (pair? (cdr rest)) (pair? (cddr rest)))
153 (hash (string-upcase (substring/shared s start end)) bound))))
155 ;;; srfi-13.scm ends here