whalesong/lang/bool.rkt
2011-09-01 11:47:45 -04:00

22 lines
456 B
Racket

#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))