* safe-r5rs.scm: Fix typo: make-rectangualr => make-rectangular.
[bpt/guile.git] / ice-9 / safe-r5rs.scm
1 ;;;; Copyright (C) 2000 Free Software Foundation, Inc.
2 ;;;;
3 ;;;; This program is free software; you can redistribute it and/or modify
4 ;;;; it under the terms of the GNU General Public License as published by
5 ;;;; the Free Software Foundation; either version 2, or (at your option)
6 ;;;; any later version.
7 ;;;;
8 ;;;; This program is distributed in the hope that it will be useful,
9 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
10 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 ;;;; GNU General Public License for more details.
12 ;;;;
13 ;;;; You should have received a copy of the GNU General Public License
14 ;;;; along with this software; see the file COPYING. If not, write to
15 ;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
16 ;;;; Boston, MA 02111-1307 USA
17 ;;;;
18 \f
19 ;;;; Safe subset of R5RS bindings
20
21 (define-module (ice-9 safe-r5rs))
22
23 (define null-interface (resolve-interface '(ice-9 null)))
24
25 (module-use! %module-public-interface null-interface)
26
27 (export eqv? eq? equal?
28 number? complex? real? rational? integer?
29 exact? inexact?
30 = < > <= >=
31 zero? positive? negative? odd? even?
32 max min
33 + * - /
34 abs
35 quotient remainder modulo
36 gcd lcm
37 numerator denominator
38 floor ceiling truncate round
39 rationalize
40 exp log sin cos tan asin acos atan
41 sqrt
42 expt
43 make-rectangular make-polar real-part imag-part magnitude angle
44 exact->inexact inexact->exact
45
46 number->string string->number
47
48 boolean?
49 not
50
51 pair?
52 cons car cdr
53 set-car! set-cdr!
54 caar cadr cdar cddr
55 caaar caadr cadar caddr cdaar cdadr cddar cdddr
56 caaaar caaadr caadar caaddr cadaar cadadr caddar cadddr
57 cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr
58 null?
59 list?
60 list
61 length
62 append
63 reverse
64 list-tail list-ref
65 memq memv member
66 assq assv assoc
67
68 symbol?
69 symbol->string string->symbol
70
71 char?
72 char=? char<? char>? char<=? char>=?
73 char-ci=? char-ci<? char-ci>? char-ci<=? char-ci>=?
74 char-alphabetic? char-numeric? char-whitespace?
75 char-upper-case? char-lower-case?
76 char->integer integer->char
77 char-upcase
78 char-downcase
79
80 string?
81 make-string
82 string
83 string-length
84 string-ref string-set!
85 string=? string-ci=?
86 string<? string>? string<=? string>=?
87 string-ci<? string-ci>? string-ci<=? string-ci>=?
88 substring
89 string-length
90 string-append
91 string->list list->string
92 string-copy string-fill!
93
94 vector?
95 make-vector
96 vector
97 vector-length
98 vector-ref vector-set!
99 vector->list list->vector
100 vector-fill!
101
102 procedure?
103 apply
104 map
105 for-each
106 force
107
108 call-with-current-continuation
109
110 values
111 call-with-values
112 dynamic-wind
113
114 eval
115 null-environment
116
117 input-port? output-port?
118 current-input-port current-output-port
119
120 read
121 read-char
122 peek-char
123 eof-object?
124 char-ready?
125
126 write
127 display
128 newline
129 write-char
130
131 ;;transcript-on
132 ;;transcript-off
133 )
134
135 (define (null-environment n)
136 (if (not (= n 5))
137 (scm-error 'misc-error 'null-environment
138 "~A is not a valid version"
139 (list n)
140 '()))
141 ;; Note that we need to create a *fresh* interface
142 (let ((interface (make-module 31)))
143 (set-module-kind! interface 'interface)
144 (module-use! interface null-interface)
145 interface))