Added `guess' as a fake teachpack. See additional note in

"overridden-collects/readme.txt".

svn: r11866
This commit is contained in:
Eli Barzilay 2008-09-25 07:05:48 +00:00
parent b465a25656
commit 18d0028d35
2 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,31 @@
#lang scheme/gui
(require htdp/error lang/prim)
(provide guess-with-gui guess-with-gui-3 guess-with-gui-list)
(define-higher-order-primitive guess-with-gui guess-with-gui/proc
(check-guess))
(define-higher-order-primitive guess-with-gui-3 guess-with-gui-3/proc
(check-guess))
(define-higher-order-primitive guess-with-gui-list guess-with-gui-list/proc
(_ check-guess-list))
(define (convert guesses:vec)
(void))
(define (guess-with-gui/proc cg)
(check-proc 'guess-with-gui cg 2 'first "two arguments")
(void))
(define (guess-with-gui-3/proc cg)
(check-proc 'guess-with-gui-3 cg (+ 3 1) 'first "four arguments")
(void))
(define (guess-with-gui-list/proc n cg)
(check-arg 'guess-with-gui-list
(and (number? n) (integer? n) (>= n 1)) "positive integer" '1st n)
(check-proc 'guess-with-gui-list cg 2 'first "two arguments")
(unless (<= (expt 10 n) 2147483647)
(error 'guess-with-gui-list "the given number of digits (~a) is too large" n))
(void))

View File

@ -4,3 +4,11 @@ that appear here will be used instead of ones in the PLT tree or the
user-local collections. Use it to override collections that are safe user-local collections. Use it to override collections that are safe
for testing, for example -- avoid using actual gui. See also the for testing, for example -- avoid using actual gui. See also the
documentation for `sandbox-override-collection-paths' in "doc.txt". documentation for `sandbox-override-collection-paths' in "doc.txt".
This is currently used with the `teachpack' collection. Note that
mzscheme resolved collection directories based on toplevel names only,
which means that if we actually use `teachpack' for the directory
name, then files that are not here will not be searched in the usual
plt tree. Because of this the collection is called `fake-teachpack',
and checkers should specify requires in this collection if submissions
need a fake teachpack.