-
Notifications
You must be signed in to change notification settings - Fork 5
/
rnrs-sans.sls
437 lines (410 loc) · 11 KB
/
rnrs-sans.sls
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
#!r6rs
;; (rnrs) minus items which conflict with procedures provided by mpl
(library (mpl rnrs-sans)
(export
#; (rnrs base (6))
define define-syntax
quote lambda if set! cond case and or
let let* letrec letrec* let-values let*-values
begin quasiquote unquote unquote-splicing
let-syntax letrec-syntax syntax-rules
identifier-syntax assert
else => ... _
eq?
eqv?
equal?
procedure?
number? complex? real? rational? integer?
real-valued? rational-valued? integer-valued?
exact? inexact?
inexact exact
= < > <= >=
zero? positive? negative? odd? even?
finite? infinite? nan?
max min abs
div-and-mod div mod div0-and-mod0 div0 mod0
gcd lcm
floor ceiling truncate round
rationalize
;; log
;; tan
asin acos atan
exact-integer-sqrt
expt
make-rectangular make-polar real-part imag-part
magnitude angle
number->string string->number
not boolean? boolean=?
pair? cons car cdr
caar cadr cdar cddr caaar caadr cadar
caddr cdaar cdadr cddar cdddr caaaar caaadr
caadar caaddr cadaar cadadr caddar cadddr cdaaar
cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr
null? list? list length append reverse list-tail
list-ref map for-each
symbol? symbol->string string->symbol symbol=?
char? char->integer integer->char
char=? char<? char>? char<=? char>=?
string? make-string string string-length string-ref
string=? string<? string>? string<=? string>=?
substring string-append string->list list->string string-copy string-for-each
vector? make-vector vector vector-length vector-ref vector-set!
vector->list list->vector vector-fill!
vector-map vector-for-each
error assertion-violation
apply call-with-current-continuation call/cc
values call-with-values dynamic-wind
#;(rnrs unicode (6))
char-upcase char-downcase char-titlecase char-foldcase
char-ci=? char-ci<? char-ci>? char-ci<=? char-ci>=?
char-alphabetic? char-numeric? char-whitespace? char-upper-case? char-lower-case? char-title-case?
char-general-category
string-upcase string-downcase string-titlecase string-foldcase
string-ci=? string-ci<? string-ci>? string-ci<=? string-ci>=?
string-normalize-nfd string-normalize-nfkd string-normalize-nfc string-normalize-nfkc
#;(rnrs bytevectors (6))
endianness native-endianness
bytevector? make-bytevector bytevector-length bytevector=?
bytevector-fill! bytevector-copy! bytevector-copy
bytevector-u8-ref bytevector-s8-ref bytevector-u8-set! bytevector-s8-set!
bytevector->u8-list u8-list->bytevector
bytevector-u16-ref bytevector-s16-ref bytevector-u16-native-ref bytevector-s16-native-ref
bytevector-u16-set! bytevector-s16-set! bytevector-u16-native-set! bytevector-s16-native-set!
bytevector-u32-ref bytevector-s32-ref bytevector-u32-native-ref bytevector-s32-native-ref
bytevector-u32-set! bytevector-s32-set! bytevector-u32-native-set! bytevector-s32-native-set!
bytevector-u64-ref bytevector-s64-ref bytevector-u64-native-ref bytevector-s64-native-ref
bytevector-u64-set! bytevector-s64-set! bytevector-u64-native-set! bytevector-s64-native-set!
bytevector-ieee-single-ref bytevector-ieee-single-native-ref
bytevector-ieee-single-set! bytevector-ieee-single-native-set!
bytevector-ieee-double-ref bytevector-ieee-double-native-ref
bytevector-ieee-double-set! bytevector-ieee-double-native-set!
bytevector-uint-ref bytevector-sint-ref
bytevector-uint-set! bytevector-sint-set!
bytevector->uint-list bytevector->sint-list
uint-list->bytevector sint-list->bytevector
string->utf8 utf8->string
string->utf16 utf16->string
string->utf32 utf32->string
#;(rnrs lists (6))
find for-all exists
filter
partition
fold-left fold-right
remp remove remv remq
memp member memv memq
assp assoc assv assq cons*
#;(rnrs sorting (6))
list-sort vector-sort vector-sort!
#;(rnrs control (6))
when unless do case-lambda
#;(rnrs records syntactic (6))
define-record-type
record-type-descriptor
record-constructor-descriptor
fields mutable immutable parent protocol sealed opaque nongenerative parent-rtd
#;(rnrs records procedural (6))
make-record-type-descriptor
record-type-descriptor?
make-record-constructor-descriptor
record-constructor
record-predicate
record-accessor
record-mutator
#;(rnrs records inspection (6))
record?
record-rtd
record-type-name
record-type-parent
record-type-uid
record-type-generative?
record-type-sealed?
record-type-opaque?
record-type-field-names
record-field-mutable?
#;(rnrs exceptions (6))
with-exception-handler guard raise raise-continuable
#;(rnrs conditions (6))
&condition
condition simple-conditions condition?
condition-predicate condition-accessor
define-condition-type
&message make-message-condition message-condition? condition-message
&warning make-warning warning?
&serious make-serious-condition serious-condition?
&error make-error error?
&violation make-violation violation?
&assertion make-assertion-violation assertion-violation?
&irritants make-irritants-condition irritants-condition? condition-irritants
&who make-who-condition who-condition? condition-who
&non-continuable make-non-continuable-violation non-continuable-violation?
&implementation-restriction make-implementation-restriction-violation implementation-restriction-violation?
&lexical make-lexical-violation lexical-violation?
&syntax make-syntax-violation syntax-violation? syntax-violation-form syntax-violation-subform
&undefined make-undefined-violation undefined-violation?
#;(rnrs io ports (6))
&i/o make-i/o-error i/o-error?
&i/o-read make-i/o-read-error i/o-read-error?
&i/o-write make-i/o-write-error i/o-write-error?
&i/o-invalid-position make-i/o-invalid-position-error i/o-invalid-position-error? i/o-error-position
&i/o-filename make-i/o-filename-error i/o-filename-error? i/o-error-filename
&i/o-file-protection make-i/o-file-protection-error i/o-file-protection-error?
&i/o-file-is-read-only make-i/o-file-is-read-only-error i/o-file-is-read-only-error?
&i/o-file-already-exists make-i/o-file-already-exists-error i/o-file-already-exists-error?
&i/o-file-does-not-exist make-i/o-file-does-not-exist-error i/o-file-does-not-exist-error?
&i/o-port make-i/o-port-error i/o-port-error? i/o-error-port
&i/o-decoding make-i/o-decoding-error i/o-decoding-error?
&i/o-encoding make-i/o-encoding-error i/o-encoding-error? i/o-encoding-error-char
file-options
buffer-mode
buffer-mode?
utf-8-codec
utf-16-codec
latin-1-codec
eol-style
error-handling-mode
make-transcoder
transcoder-codec
transcoder-eol-style
transcoder-error-handling-mode
native-transcoder
native-eol-style
bytevector->string
string->bytevector
eof-object
eof-object?
port?
port-transcoder
textual-port?
binary-port?
transcoded-port
port-has-port-position?
port-position
port-has-set-port-position!?
set-port-position!
close-port
call-with-port
input-port?
port-eof?
open-file-input-port
open-bytevector-input-port
open-string-input-port
standard-input-port
current-input-port
get-u8
lookahead-u8
get-bytevector-n
get-bytevector-n!
get-bytevector-some
get-bytevector-all
get-char
lookahead-char
get-string-n
get-string-n!
get-string-all
get-line
get-datum
output-port?
flush-output-port
output-port-buffer-mode
open-file-output-port
open-bytevector-output-port
call-with-bytevector-output-port
open-string-output-port
call-with-string-output-port
standard-output-port
standard-error-port
current-output-port
current-error-port
put-u8
put-bytevector
put-char
put-string
put-datum
open-file-input/output-port
make-custom-binary-input-port
make-custom-textual-input-port
make-custom-binary-output-port
make-custom-textual-output-port
make-custom-binary-input/output-port
make-custom-textual-input/output-port
#;(rnrs io simple (6))
call-with-input-file
call-with-output-file
with-input-from-file
with-output-to-file
open-input-file
open-output-file
close-input-port
close-output-port
read-char
peek-char
read
write-char
newline
display
write
#;(rnrs files (6))
file-exists? delete-file
#;(rnrs enums (6))
make-enumeration
enum-set-universe
enum-set-indexer
enum-set-constructor
enum-set->list
enum-set-member?
enum-set-subset?
enum-set=?
enum-set-union
enum-set-intersection
enum-set-difference
enum-set-complement
enum-set-projection
define-enumeration
#;(rnrs programs (6))
command-line
exit
#;(rnrs arithmetic fixnums (6))
fixnum?
fixnum-width
least-fixnum
greatest-fixnum
fx=?
fx<?
fx>?
fx<=?
fx>=?
fxzero?
fxpositive?
fxnegative?
fxodd?
fxeven?
fxmax
fxmin
fx+
fx*
fx-
fxdiv
fxmod
fxdiv-and-mod
fxdiv0
fxmod0
fxdiv0-and-mod0
fx+/carry
fx-/carry
fx*/carry
fxnot
fxand
fxior
fxxor
fxif
fxbit-count
fxlength
fxfirst-bit-set
fxbit-set?
fxcopy-bit
fxbit-field
fxcopy-bit-field
fxarithmetic-shift
fxarithmetic-shift-left
fxarithmetic-shift-right
fxrotate-bit-field
fxreverse-bit-field
#;(rnrs arithmetic flonums (6))
flonum?
real->flonum
fl=?
fl<?
fl>?
fl<=?
fl>=?
flinteger?
flzero?
flpositive?
flnegative?
flodd?
fleven?
flfinite?
flinfinite?
flnan?
flmax
flmin
fl+
fl*
fl-
fl/
fldiv-and-mod
fldiv
flmod
fldiv0-and-mod0
fldiv0
flmod0
flnumerator
fldenominator
flfloor
flceiling
fltruncate
flround
flabs
flexpt
flsqrt
flexp
fllog
flsin
flcos
fltan
flasin
flacos
flatan
fixnum->flonum
&no-infinities make-no-infinities-violation no-infinities-violation?
&no-nans make-no-nans-violation no-nans-violation?
#;(rnrs arithmetic bitwise (6))
bitwise-not
bitwise-and
bitwise-ior
bitwise-xor
bitwise-if
bitwise-bit-count
bitwise-length
bitwise-first-bit-set
bitwise-bit-set?
bitwise-copy-bit
bitwise-bit-field
bitwise-copy-bit-field
bitwise-arithmetic-shift
bitwise-arithmetic-shift-left
bitwise-arithmetic-shift-right
bitwise-rotate-bit-field
bitwise-reverse-bit-field
#;(rnrs syntax-case (6))
syntax-case syntax
with-syntax
make-variable-transformer
identifier? bound-identifier=? free-identifier=?
datum->syntax syntax->datum
generate-temporaries
quasisyntax
unsyntax
unsyntax-splicing
syntax-violation
#;(rnrs hashtables (6))
make-eq-hashtable
make-eqv-hashtable
make-hashtable
hashtable?
hashtable-size
hashtable-ref
hashtable-set!
hashtable-delete!
hashtable-contains?
hashtable-update!
hashtable-copy
hashtable-clear!
hashtable-keys
hashtable-entries
hashtable-equivalence-function
hashtable-hash-function
hashtable-mutable?
equal-hash string-hash string-ci-hash symbol-hash)
(import (rnrs))
)