1#lang scheme
2
3(require htdp/big-draw
4         htdp/draw-sig
5         mzlib/unit)
6
7(define-syntax (draw s)
8  (syntax-case s (produce)
9    [(_ stmt ... produce exp) (syntax (begin (and stmt ...) exp))]
10    [(_ stmt ... produce)
11     (raise-syntax-error #f "produce must be followed by an expression" s)]
12    [(_ stmt ... produce exp exp2)
13     (raise-syntax-error #f "produce must be followed by exactly one expression" s)]
14    [(_ stmt ... produce exp exp2 exp3)
15     (raise-syntax-error #f "produce must be followed by exactly one expression" s)]
16    [(_ stmt ...)
17     (raise-syntax-error #f "use drawing instructions between _draw_ and _produce_ and an expression behind produce" s)]
18    ))
19
20(provide
21 draw ;; (draw <expression> ... produce <expression>)
22 )
23
24(provide-signature-elements draw^)
25