From 3e78806e6703c8d08be999bfdc1dfba9a7e3834d Mon Sep 17 00:00:00 2001 From: John Clements Date: Mon, 27 Sep 2010 22:49:42 -0700 Subject: [PATCH] added new safe-ops file that may be used instead of ops to disable unsafety --- collects/racket/unsafe/safe-ops.rkt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 collects/racket/unsafe/safe-ops.rkt diff --git a/collects/racket/unsafe/safe-ops.rkt b/collects/racket/unsafe/safe-ops.rkt new file mode 100644 index 0000000000..8617f08396 --- /dev/null +++ b/collects/racket/unsafe/safe-ops.rkt @@ -0,0 +1,25 @@ +#lang racket + +(require racket/fixnum + racket/flonum) + + +;; the point of this file is to provide functions that are labeled +;; as unsafe but are actually safe. This provides an easy means to +;; disable unsafety; a require of racket/unsafe/ops can be replaced +;; with a require of racket/unsafe/safe-ops. + +;; this list is almost certainly incomplete; I feel partially justified +;; in adding it to the tree anyhow because +;; a) it's easy to extend, and +;; b) it appears to me (based on the require of #%unsafe in the corresponding +;; 'ops' library) that determining the full set of functions will require +;; mucking around in the C source, and not being very confident about +;; my conclusions. + + +(provide (prefix-out unsafe- (all-from-out racket/fixnum)) + (prefix-out unsafe- (all-from-out racket/flonum)) + (prefix-out unsafe- (combine-out vector-length + vector-ref + vector-set!))) \ No newline at end of file