Switch off unsafe operations for now, better to turn it on after the

code was used for a while.

svn: r17008
This commit is contained in:
Eli Barzilay 2009-11-23 18:53:13 +00:00
parent 0b6ae05e9b
commit 4977e6bd6c

View File

@ -24,14 +24,16 @@ doing these checks.
|#
(#%require (rename '#%unsafe i+ unsafe-fx+)
(rename '#%unsafe i- unsafe-fx-)
(rename '#%unsafe i= unsafe-fx=)
(rename '#%unsafe i< unsafe-fx<)
(rename '#%unsafe i<= unsafe-fx<=)
(rename '#%unsafe i>> unsafe-fxrshift)
(rename '#%unsafe vref unsafe-vector-ref)
(rename '#%unsafe vset! unsafe-vector-set!))
;; This code works with unsafe operations, but don't use it for a while to
;; catch potential problems.
;; (#%require (rename '#%unsafe i+ unsafe-fx+)
;; (rename '#%unsafe i- unsafe-fx-)
;; (rename '#%unsafe i= unsafe-fx=)
;; (rename '#%unsafe i< unsafe-fx<)
;; (rename '#%unsafe i<= unsafe-fx<=)
;; (rename '#%unsafe i>> unsafe-fxrshift)
;; (rename '#%unsafe vref unsafe-vector-ref)
;; (rename '#%unsafe vset! unsafe-vector-set!))
(define sort (let ()
@ -40,6 +42,15 @@ doing these checks.
[(dr (foo . pattern) template)
(define-syntax foo (syntax-rules () [(_ . pattern) template]))]))
(define-syntax-rule (i+ x y) (+ x y))
(define-syntax-rule (i- x y) (- x y))
(define-syntax-rule (i= x y) (= x y))
(define-syntax-rule (i< x y) (< x y))
(define-syntax-rule (i<= x y) (<= x y))
(define-syntax-rule (i>> x y) (arithmetic-shift x (- y)))
(define-syntax-rule (vref v i) (vector-ref v i))
(define-syntax-rule (vset! v i x) (vector-set! v i x))
(define-syntax-rule (sort-internal-body v *<? n has-getkey? getkey)
(let* ([n/2- (i>> n 1)] [n/2+ (i- n n/2-)])
(define-syntax-rule (<? x y)