diff --git a/remix/exp/cond.rkt b/remix/exp/cond.rkt deleted file mode 100644 index cebb7b4..0000000 --- a/remix/exp/cond.rkt +++ /dev/null @@ -1,25 +0,0 @@ -#lang racket/base -(require (for-syntax racket/base - syntax/parse)) - -(define-syntax (brackets-cond stx) - (syntax-parse stx - [(_) - (syntax/loc stx - (error 'cond "Reach the end of cond"))] - [(_ ((~literal #%brackets) q . a) . more) - (syntax/loc stx - (if q (let () . a) (brackets-cond . more)))] - [(_ e . more) - (syntax/loc stx - (let () e (brackets-cond . more)))])) - -(module+ test - (brackets-cond - (define x 5) - (#%brackets (even? x) - 27) - (define y (+ x 6)) - (#%brackets (odd? y) - 28) - 19)) diff --git a/remix/exp/struct.rkt b/remix/exp/struct.rkt deleted file mode 100644 index ab6b1d9..0000000 --- a/remix/exp/struct.rkt +++ /dev/null @@ -1,72 +0,0 @@ -#lang racket/base -(require racket/unsafe/ops - ffi/unsafe) - -(define (test-struct N) - (struct the (f i r)) - (define x #f) - (define y #f) - (define z #f) - (for ([i (in-range N)]) - (define t (the (exact->inexact i) i (number->string i))) - (set! x (the-f t)) - (set! y (the-i t)) - (set! z (the-r t)))) - -(define (test-unsafe-struct N) - (struct the (f i r)) - (define x #f) - (define y #f) - (define z #f) - (for ([i (in-range N)]) - (define t (the (exact->inexact i) i (number->string i))) - (set! x (unsafe-struct-ref t 0)) - (set! y (unsafe-struct-ref t 1)) - (set! z (unsafe-struct-ref t 2)))) - -(define (test-unsafe*-struct N) - (struct the (f i r)) - (define x #f) - (define y #f) - (define z #f) - (for ([i (in-range N)]) - (define t (the (exact->inexact i) i (number->string i))) - (set! x (unsafe-struct*-ref t 0)) - (set! y (unsafe-struct*-ref t 1)) - (set! z (unsafe-struct*-ref t 2)))) - -(define (test-vector N) - (define x #f) - (define y #f) - (define z #f) - (for ([i (in-range N)]) - (define t (vector (exact->inexact i) i (number->string i))) - (set! x (vector-ref t 0)) - (set! y (vector-ref t 1)) - (set! z (vector-ref t 2)))) - -(define (test-unsafe-vector N) - (define x #f) - (define y #f) - (define z #f) - (for ([i (in-range N)]) - (define t (vector (exact->inexact i) i (number->string i))) - (set! x (unsafe-vector-ref t 0)) - (set! y (unsafe-vector-ref t 1)) - (set! z (unsafe-vector-ref t 2)))) - -(define (test-cstruct N) - (define-cstruct _the ([f _float] [i _int] [r _racket])) - (define x #f) - (define y #f) - (define z #f) - (for ([i (in-range N)]) - (define t (make-the (exact->inexact i) i (number->string i))) - (set! x (the-f t)) - (set! y (the-i t)) - (set! z (the-r t)))) - -(module+ test - (for ([p (in-list (list test-struct test-vector test-unsafe-struct test-unsafe*-struct test-unsafe-vector test-cstruct))]) - (printf "testing ~v\n" p) - (time (p 1000000)))) diff --git a/remix/exp/reader.rkt b/remix/tests/reader.rkt similarity index 100% rename from remix/exp/reader.rkt rename to remix/tests/reader.rkt