From 23d245c09f07911748436aedf2d66a3a4f0c324b Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 29 Jul 2007 03:39:44 +0000 Subject: [PATCH] fixed PR 8830 svn: r6979 --- collects/teachpack/htdp/image.ss | 58 ++++++++++++++++++++++++++- collects/tests/mzscheme/htdp-image.ss | 10 ++++- 2 files changed, 64 insertions(+), 4 deletions(-) diff --git a/collects/teachpack/htdp/image.ss b/collects/teachpack/htdp/image.ss index 66dcbd30e4..2ff7ce06eb 100644 --- a/collects/teachpack/htdp/image.ss +++ b/collects/teachpack/htdp/image.ss @@ -1,3 +1,57 @@ +;; this is like (lib "htdp" "image.ss") +;; except that it provides things with +;; provide-primitives for better error +;; reporting in the teaching languages. + (module image mzscheme - (require (lib "image.ss" "htdp")) - (provide (all-from (lib "image.ss" "htdp")))) + (require (lib "image.ss" "htdp") + (lib "prim.ss" "lang")) + + + (provide-primitives + image-width + image-height + overlay + overlay/xy + + pinhole-x + pinhole-y + move-pinhole + put-pinhole + + rectangle + circle + ellipse + triangle + line + star + add-line + text + + shrink + shrink-tl + shrink-tr + shrink-bl + shrink-br + + image-inside? + find-image + + image->color-list + color-list->image + + image->alpha-color-list + alpha-color-list->image + + image-color? + make-color + color-red + color-green + color-blue + color? + make-alpha-color + alpha-color-alpha + alpha-color-red + alpha-color-green + alpha-color-blue + alpha-color?)) \ No newline at end of file diff --git a/collects/tests/mzscheme/htdp-image.ss b/collects/tests/mzscheme/htdp-image.ss index 59ff0b1324..f9bf738036 100644 --- a/collects/tests/mzscheme/htdp-image.ss +++ b/collects/tests/mzscheme/htdp-image.ss @@ -1,7 +1,7 @@ ;; Load this one with MrEd (load-relative "loadtest.ss") -(require (lib "image.ss" "htdp") +(require (lib "image.ss" "teachpack" "htdp") (lib "error.ss" "htdp") (lib "posn.ss" "lang") (lib "list.ss") @@ -1182,4 +1182,10 @@ (err/rt-name-test (overlay/xy (rectangle 100 200 'outline 'red) 10 +inf.0 #f) "third") (err/rt-name-test (overlay/xy (rectangle 100 200 'outline 'red) -inf.0 +inf.0 #f) "second") -(report-errs) \ No newline at end of file +(parameterize ((current-namespace (make-namespace))) + (err/rt-test (eval '(module m (lib "htdp-beginner.ss" "lang") (require (lib "image.ss" "teachpack" "htdp")) overlay)) + (lambda (exn) + (regexp-match #rx"must be applied to arguments" + (exn-message exn))))) + +(report-errs)