;;;; reflect-reify-test.scm ;;;; Kon Lovett, Apr 6 '06 ; (import utf8) (import test) (import (only (chicken format) format) (test-utils gloss)) ;;; (test-begin "Reflect-Reify") (import reflect-reify) ;; Monads (define-unit maybe obj) (define-bind maybe (and monad (func monad))) (define (maybe-foo x) (if (zero? x) (reflect maybe #f) ; exception (/ 1 x) ) ) (define (maybe-bar x) (+ x x) ) (define (maybe-baz x) (if (zero? x) (reflect maybe #f) (/ 1 x) ) ) (test-group "reflect/reify" (test 1/2 (reify maybe (maybe-baz (maybe-bar (reflect maybe (or (reify maybe (maybe-foo 0)) (reify maybe (maybe-foo 1)))))))) ) ;;; (test-end "Reflect-Reify") (test-exit)