For Development HEAD DRAFTSearch (procedure/syntax/module):

11.34 srfi.172 - 二つの安全なR7RSサブセット

Module: srfi.172
Module: srfi.172.functional

このモジュールは、R7RS-smallのうちほぼサンドボックスとして使えるような、 制限された比較的安全な束縛をエクスポートします。 「ほぼ」というのは、完全に安全なサンドボックスにするには束縛の制限以外の対策も 必要だからです。例えばリソースを無制限に消費するコードを走るのを防いだり、 渡すことでループホールが作られてしまうようなデータが渡らないようにする、等です。 このモジュールはそういった環境を作る起点として使えるでしょう。

サブモジュールsrfi.172.functionalは、そこからさらに副作用の無い関数のみに 限定した束縛をエクスポートします。

srfi.172がエクスポートする束縛は次のとおりです:

- * / + < <= = => > >= abs acos and angle append apply asin assoc assq
assv atan begin boolean? boolean=? bytevector bytevector?
bytevector-append bytevector-copy bytevector-copy!
bytevector-length bytevector-u8-ref bytevector-u8-set! caaaar
caaadr caaar caadar caaddr caadr caar cadaar cadadr cadar caddar
cadddr caddr cadr call/cc call-with-current-continuation
call-with-port call-with-values car case case-lambda cdaaar cdaadr
cdaar cdadar cdaddr cdadr cdar cddaar cddadr cddar cdddar cddddr
cdddr cddr cdr ceiling char? char<? char<=? char=? char>? char>=?
char->integer char-alphabetic? char-ci<? char-ci<=? char-ci=?
char-ci>? char-ci>=? char-downcase char-foldcase char-lower-case?
char-numeric? char-upcase char-upper-case? char-whitespace?
close-input-port close-output-port close-port complex? cond
cond-expand cons cos delay delay-force denominator digit-value do
dynamic-wind else eof-object eof-object? eq? equal? eqv? error
error-object? error-object-irritants error-object-message even?
exact exact? exact-integer? exact-integer-sqrt exp expt finite?
floor floor/ floor-quotient floor-remainder force for-each gcd
get-output-bytevector get-output-string guard if imag-part inexact
inexact? infinite? input-port? integer? integer->char lambda lcm
length let let* let*-values letrec letrec* let-values list list?
list->string list->vector list-copy list-ref list-set! list-tail
log magnitude make-bytevector make-list make-parameter make-polar
make-promise make-rectangular make-string make-vector map max
member memq memv min modulo nan? negative? newline not null?
number? number->string numerator odd? open-input-bytevector
open-input-string open-output-bytevector open-output-string or
output-port? pair? peek-char peek-u8 parameterize port? positive?
procedure? promise? quasiquote quote quotient raise
raise-continuable rational? rationalize read-bytevector
read-bytevector! read-char read-error? read-line read-string
read-u8 real? real-part remainder reverse round set! set-car!
set-cdr! sin sqrt square string string? string<? string<=?
string=? string>? string>=? string->list string->number
string->utf8 string->vector string-append string-ci<? string-ci<=?
string-ci=? string-ci>? string-ci>=? string-copy string-copy!
string-downcase string-fill! string-foldcase string-for-each
string-length string-map string-ref string-set! string-upcase
substring symbol? symbol=? symbol->string tan textual-port?
truncate truncate/ truncate-quotient truncate-remainder unless
unquote unquote-splicing utf8->string values vector vector?
vector->list vector->string vector-append vector-copy vector-copy!
vector-fill! vector-for-each vector-length vector-map vector-ref
vector-set! when with-exception-handler write-bytevector
write-char write-string write-u8 zero?

srfi.172.functionalがエクスポートするのは、上のリストから 以下のものを除いた束縛です。

  • set!
  • !で終わる手続き: bytevector-copy!, bytevector-u8-set!, list-set!, read-bytevector!, set-car!, set-cdr!, string-copy!, string-fill!, string-set!, vector-copy!, vector-fill!, vector-set!
  • portが含まれる手続き: call-with-port, close-input-port, close-output-port, close-port, input-port?, output-port?, port?, textual-port?
  • readで始まる手続き: read-bytevector, read-bytevector!, read-char, read-error?, read-line, read-string, read-u8
  • peekで始まる手続き: peek-char, peek-u8
  • writeで始まる手続き: write-bytevector, write-char, write-string, write-u8


For Development HEAD DRAFTSearch (procedure/syntax/module):
DRAFT