rnrs modules #:replace as appropriate
[bpt/guile.git] / module / rnrs.scm
CommitLineData
2d56d2df
JG
1;;; rnrs.scm --- The R6RS composite library
2
3;; Copyright (C) 2010 Free Software Foundation, Inc.
4;;
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 3 of the License, or (at your option) any later version.
9;;
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.
14;;
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18\f
19
20(library (rnrs (6))
21 (export ;; (rnrs arithmetic bitwise)
22
23 bitwise-not bitwise-and bitwise-ior bitwise-xor bitwise-if
24 bitwise-bit-count bitwise-length bitwise-first-bit-set
25 bitwise-bit-set? bitwise-copy-bit bitwise-bit-field
26 bitwise-copy-bit-field bitwise-arithmetic-shift
27 bitwise-arithmetic-shift-left bitwise-arithmetic-shift-right
28 bitwise-rotate-bit-field bitwise-reverse-bit-field
29
30 ;; (rnrs arithmetic fixnums)
31
32 fixnum? fixnum-width least-fixnum greatest-fixnum fx=? fx>? fx<? fx>=?
33 fx<=? fxzero? fxpositive? fxnegative? fxodd? fxeven? fxmax fxmin fx+
34 fx* fx- fxdiv-and-mod fxdiv fxmod fxdiv0-and-mod0 fxdiv0 fxmod0
35 fx+/carry fx-/carry fx*/carry fxnot fxand fxior fxxor fxif fxbit-count
36 fxlength fxfirst-bit-set fxbit-set? fxcopy-bit fxbit-field
37 fxcopy-bit-field fxarithmetic-shift fxarithmetic-shift-left
38 fxarithmetic-shift-right fxrotate-bit-field fxreverse-bit-field
39
40 ;; (rnrs arithmetic flonums)
41
42 flonum? real->flonum fl=? fl<? fl<=? fl>? fl>=? flinteger? flzero?
43 flpositive? flnegative? flodd? fleven? flfinite? flinfinite? flnan?
44 flmax flmin fl+ fl* fl- fl/ flabs fldiv-and-mod fldiv flmod
45 fldiv0-and-mod0 fldiv0 flmod0 flnumerator fldenominator flfloor
46 flceiling fltruncate flround flexp fllog flsin flcos fltan flacos
47 flasin flatan flsqrt flexpt &no-infinities
48 make-no-infinities-violation no-infinities-violation? &no-nans
49 make-no-nans-violation no-nans-violation? fixnum->flonum
50
51 ;; (rnrs base)
52
53 boolean? symbol? char? vector? null? pair? number? string? procedure?
54 define define-syntax syntax-rules lambda let let* let-values
55 let*-values letrec begin quote lambda if set! cond case or and not
56 eqv? equal? eq? + - * / max min abs numerator denominator gcd lcm
57 floor ceiling truncate round rationalize real-part imag-part
58 make-rectangular angle div mod div-and-mod div0 mod0 div0-and-mod0
59 expt exact-integer-sqrt sqrt exp log sin cos tan asin acos atan
60 make-polar magnitude angle complex? real? rational? integer? exact?
61 inexact? real-valued? rational-valued? integer-values? zero?
62 positive? negative? odd? even? nan? finite? infinite? exact inexact =
63 < > <= >= number->string string->number cons car cdr caar cadr cdar
64 cddr caaar caadr cadar cdaar caddr cdadr cddar cdddr caaaar caaadr
65 caadar cadaar cdaaar cddaar cdadar cdaadr cadadr caaddr caddar cadddr
66 cdaddr cddadr cdddar cddddr list? list length append reverse
67 list-tail list-ref map for-each symbol->string string->symbol symbol=?
68 char->integer integer->char char=? char<? char>? char<=? char>=?
69 make-string string string-length string-ref string=? string<? string>?
70 string<=? string>=? substring string-append string->list list->string
71 string-for-each string-copy vector? make-vector vector vector-length
72 vector-ref vector-set! vector->list list->vector vector-fill!
73 vector-map vector-for-each error assertion-violation assert
74 call-with-current-continuation call/cc call-with-values dynamic-wind
75 values apply quasiquote unquote unquote-splicing let-syntax
76 letrec-syntax syntax-rules identifier-syntax
77
07d22c02 78 ;; (rnrs bytevectors)
2d56d2df
JG
79
80 endianness native-endianness bytevector? make-bytevector
81 bytevector-length bytevector=? bytevector-fill! bytevector-copy!
82 bytevector-copy uniform-array->bytevector bytevector-u8-ref
83 bytevector-s8-ref bytevector-u8-set! bytevector-s8-set!
84 bytevector->u8-list u8-list->bytevector bytevector-uint-ref
85 bytevector-uint-set! bytevector-sint-ref bytevector-sint-set!
86 bytevector->sint-list bytevector->uint-list uint-list->bytevector
87 sint-list->bytevector bytevector-u16-ref bytevector-s16-ref
88 bytevector-u16-set! bytevector-s16-set! bytevector-u16-native-ref
89 bytevector-s16-native-ref bytevector-u16-native-set!
90 bytevector-s16-native-set! bytevector-u32-ref bytevector-s32-ref
91 bytevector-u32-set! bytevector-s32-set! bytevector-u32-native-ref
92 bytevector-s32-native-ref bytevector-u32-native-set!
93 bytevector-s32-native-set! bytevector-u64-ref bytevector-s64-ref
94 bytevector-u64-set! bytevector-s64-set! bytevector-u64-native-ref
95 bytevector-s64-native-ref bytevector-u64-native-set!
96 bytevector-s64-native-set! bytevector-ieee-single-ref
97 bytevector-ieee-single-set! bytevector-ieee-single-native-ref
98 bytevector-ieee-single-native-set! bytevector-ieee-double-ref
99 bytevector-ieee-double-set! bytevector-ieee-double-native-ref
100 bytevector-ieee-double-native-set! string->utf8 string->utf16
101 string->utf32 utf8->string utf16->string utf32->string
102
103 ;; (rnrs conditions)
104
105 &condition condition simple-conditions condition? condition-predicate
106 condition-accessor define-condition-type &message
107 make-message-condition message-condition? condition-message &warning
108 make-warning warning? &serious make-serious-condition
109 serious-condition? &error make-error error? &violation make-violation
110 violation? &assertion make-assertion-violation assertion-violation?
111 &irritants make-irritants-condition irritants-condition?
112 condition-irritants &who make-who-condition who-condition?
113 condition-who &non-continuable make-non-continuable-violation
114 non-continuable-violation? &implementation-restriction
115 make-implementation-restriction-violation
116 implementation-restriction-violation? &lexical make-lexical-violation
117 lexical-violation? &syntax make-syntax-violation syntax-violation?
118 syntax-violation-form syntax-violation-subform &undefined
119 make-undefined-violation undefined-violation?
120
121 ;; (rnrs control)
122
123 when unless do case-lambda
124
125 ;; (rnrs enums)
126
127 make-enumeration enum-set-universe enum-set-indexer
128 enum-set-constructor enum-set->list enum-set-member? enum-set-subset?
129 enum-set=? enum-set-union enum-set-intersection enum-set-difference
130 enum-set-complement enum-set-projection define-enumeration
131
132 ;; (rnrs exceptions)
133
134 guard with-exception-handler raise raise-continuable
135
136 ;; (rnrs files)
137
138 file-exists? delete-file &i/o make-i/o-error i/o-error? &i/o-read
139 make-i/o-read-error i/o-read-error? &i/o-write make-i/o-write-error
140 i/o-write-error? &i/o-invalid-position
141 make-i/o-invalid-position-error i/o-invalid-position-error?
142 i/o-error-position &i/o-filename make-i/o-filename-error
143 i/o-filename-error? i/o-error-filename &i/o-file-protection
144 make-i/o-file-protection-error i/o-file-protection-error?
145 &i/o-file-is-read-only make-i/o-file-is-read-only-error
146 i/o-file-is-read-only-error? &i/o-file-already-exists
147 make-i/o-file-already-exists-error i/o-file-already-exists-error?
148 &i/o-file-does-not-exist make-i/o-file-does-not-exist-error
149 i/o-file-does-not-exist-error? &i/o-port make-i/o-port-error
150 i/o-port-error? i/o-error-port
151
152 ;; (rnrs hashtables)
153
154 make-eq-hashtable make-eqv-hashtable make-hashtable hashtable?
155 hashtable-size hashtable-ref hashtable-set! hashtable-delete!
156 hashtable-contains? hashtable-update! hashtable-copy hashtable-clear!
157 hashtable-keys hashtable-entries hashtable-equivalence-function
158 hashtable-hash-function hashtable-mutable? equal-hash string-hash
159 string-ci-hash symbol-hash
160
161 ;; (rnrs io ports)
162
163 eof-object? port? input-port? output-port? eof-object port-transcoder
164 binary-port? transcoded-port port-position set-port-position!
165 port-has-port-position? port-has-set-port-position!? call-with-port
166 open-bytevector-input-port make-custom-binary-input-port get-u8
167 lookahead-u8 get-bytevector-n get-bytevector-n! get-bytevector-some
168 get-bytevector-all open-bytevector-output-port
169 make-custom-binary-output-port put-u8 put-bytevector
c3993330 170 open-string-input-port open-string-output-port
2d56d2df
JG
171
172 ;; (rnrs io simple)
173
174 call-with-input-file call-with-output-file current-input-port
175 current-output-port current-error-port with-input-from-file
176 with-output-to-file open-input-file open-output-file close-input-port
177 close-output-port read-char peek-char read write-char newline display
178 write
179
180 ;; (rnrs lists)
181
182 find for-all exists filter partition fold-left fold-right remp remove
183 remv remq memp member memv memq assp assoc assv assq cons*
184
185 ;; (rnrs programs)
186
187 command-line exit
188
189 ;; (rnrs records inspection)
190
191 record? record-rtd record-type-name record-type-parent
192 record-type-uid record-type-generative? record-type-sealed?
193 record-type-opaque? record-type-field-names record-field-mutable?
194
195 ;; (rnrs records procedural)
196
197 make-record-type-descriptor record-type-descriptor?
198 make-record-constructor-descriptor record-constructor record-predicate
199 record-accessor record-mutator
200
201 ;; (rnrs records syntactic)
202
203 define-record-type record-type-descriptor
204 record-constructor-descriptor
205
206 ;; (rnrs sorting)
207
208 list-sort vector-sort vector-sort!
209
210 ;; (rnrs syntax-case)
211
212 make-variable-transformer syntax syntax-case identifier?
213 bound-identifier=? free-identifier=? syntax->datum datum->syntax
214 generate-temporaries with-syntax quasisyntax unsyntax
a2e0b126
AR
215 unsyntax-splicing syntax-violation
216
217 ;; (rnrs unicode)
218
219 char-upcase char-downcase char-titlecase char-foldcase
220 char-ci=? char-ci<? char-ci>? char-ci<=? char-ci>=?
221 char-alphabetic? char-numeric? char-whitespace? char-upper-case?
222 char-lower-case? char-title-case? char-general-category
223 string-upcase string-downcase string-titlecase string-foldcase
224 string-ci=? string-ci<? string-ci>? string-ci<=? string-ci>=?
225 string-normalize-nfd string-normalize-nfkd string-normalize-nfc
226 string-normalize-nfkc)
2d56d2df
JG
227
228 (import (rnrs arithmetic bitwise (6))
229 (rnrs arithmetic fixnums (6))
230 (rnrs arithmetic flonums (6))
231 (rnrs base (6))
232
c08adae4
AW
233 (rnrs bytevectors (6))
234
2d56d2df
JG
235 (rnrs conditions (6))
236 (rnrs control (6))
237 (rnrs enums (6))
238 (rnrs exceptions (6))
239 (rnrs files (6))
240 (rnrs hashtables (6))
241
c08adae4 242 (rnrs io ports (6))
2d56d2df
JG
243
244 (rnrs io simple (6))
245 (rnrs lists (6))
246 (rnrs programs (6))
247 (rnrs records inspection (6))
248 (rnrs records procedural (6))
249 (rnrs records syntactic (6))
250 (rnrs sorting (6))
a2e0b126
AR
251 (rnrs syntax-case (6))
252 (rnrs unicode (6))))