1 ;;;; Copyright (C) 2000 Free Software Foundation, Inc.
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.
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.
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
19 ;;;; Safe subset of R5RS bindings
21 (define-module (ice-9 safe-r5rs))
23 (define null-interface (resolve-interface '(ice-9 null)))
25 (module-use! %module-public-interface null-interface)
27 (export eqv? eq? equal?
28 number? complex? real? rational? integer?
31 zero? positive? negative? odd? even?
35 quotient remainder modulo
38 floor ceiling truncate round
40 exp log sin cos tan asin acos atan
43 make-rectangular make-polar real-part imag-part magnitude angle
44 exact->inexact inexact->exact
46 number->string string->number
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
69 symbol->string string->symbol
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
84 string-ref string-set!
86 string<? string>? string<=? string>=?
87 string-ci<? string-ci>? string-ci<=? string-ci>=?
91 string->list list->string
92 string-copy string-fill!
98 vector-ref vector-set!
99 vector->list list->vector
108 call-with-current-continuation
117 input-port? output-port?
118 current-input-port current-output-port
135 (define (null-environment n)
137 (scm-error 'misc-error 'null-environment
138 "~A is not a valid version"
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)