From cc4bc33331414fca7113b5ea31d9c4d6b1a9037e Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Thu, 1 Sep 2011 11:47:45 -0400 Subject: [PATCH] pulling in the bool.rkt module from racket --- lang/bool.rkt | 21 +++++++++++++++++++++ lang/kernel.rkt | 6 +----- lang/whalesong.rkt | 2 ++ 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 lang/bool.rkt diff --git a/lang/bool.rkt b/lang/bool.rkt new file mode 100644 index 0000000..7cf34e4 --- /dev/null +++ b/lang/bool.rkt @@ -0,0 +1,21 @@ +#lang s-exp "kernel.rkt" + +(provide true false false? + boolean=? + symbol=?) + +(define true #t) +(define false #f) + +(define (false? v) (eq? v #f)) + +(define (boolean=? x y) + (unless (and (boolean? x) (boolean? y)) + (raise-type-error 'boolean=? "boolean" (if (boolean? x) 1 0) x y)) + (eq? x y)) + +(define (symbol=? x y) + (unless (and (symbol? x) (symbol? y)) + (raise-type-error 'symbol=? "symbol" (if (symbol? x) 1 0) x y)) + (eq? x y)) + diff --git a/lang/kernel.rkt b/lang/kernel.rkt index 890c7c2..cbf2d61 100644 --- a/lang/kernel.rkt +++ b/lang/kernel.rkt @@ -23,8 +23,6 @@ syntax-parameterize) ;; constants -(define true #t) -(define false #f) (define pi racket:pi) (define e (racket:exp 1)) @@ -70,9 +68,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Provides -(provide true - false - pi +(provide pi e null #%plain-module-begin diff --git a/lang/whalesong.rkt b/lang/whalesong.rkt index af45a5e..9a6ff26 100644 --- a/lang/whalesong.rkt +++ b/lang/whalesong.rkt @@ -11,6 +11,7 @@ "private/traced-app.rkt" "private/shared.rkt" "check-expect/check-expect.rkt" + "bool.rkt" (for-syntax racket/base)) ;; Programs written in Whalesong will have tracing enabled by default. @@ -22,6 +23,7 @@ (rename-out [traced-app #%app] [my-module-begin #%module-begin]) shared + (all-from-out "bool.rkt") (except-out (all-from-out "check-expect/check-expect.rkt") run-tests))