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-rectangualr 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
68 symbol->string string->symbol
71 char=? char<? char>? char<=? char>=?
72 char-ci=? char-ci<? char-ci>? char-ci<=? char-ci>=?
73 char-alphabetic? char-numeric? char-whitespace?
74 char-upper-case? char-lower-case?
75 char->integer integer->char
83 string-ref string-set!
85 string<? string>? string<=? string>=?
86 string-ci<? string-ci>? string-ci<=? string-ci>=?
90 string->list list->string
91 string-copy string-fill!
97 vector-ref vector-set!
98 vector->list list->vector
107 call-with-current-continuation
116 input-port? output-port?
117 current-input-port current-output-port
134 (define (null-environment n)
136 (scm-error 'misc-error 'null-environment
137 "~A is not a valid version"
140 ;; Note that we need to create a *fresh* interface
141 (let ((interface (make-module 31)))
142 (set-module-kind! interface 'interface)
143 (module-use! interface null-interface)