<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>When I take out the #{} annotations, it gives me 24 errors (with some repeated) instead of just 6: (that’s the reason I put them there in the first place)</div><div><div><font face="Courier New">(: sphere3d (#:posn (Vectorof Real) #:r Nonnegative-Real [#:color Plot-Color] -> renderer3d))</font></div><div><font face="Courier New">(define (sphere3d #:posn ctr.posn #:r r #:color [color "black"])</font></div><div><font face="Courier New">  (let: ([ctr.x : Real (vector-x ctr.posn)]</font></div><div><font face="Courier New">         [ctr.y : Real (vector-y ctr.posn)]</font></div><div><font face="Courier New">         [ctr.z : Real (vector-z ctr.posn)])</font></div><div><font face="Courier New">    (isosurface3d (λ: ([x : Real] [y : Real] [z : Real])</font></div><div><font face="Courier New">                    (let: ([posn : (Vectorof Real) (vector x y z)])</font></div><div><font face="Courier New">                      (vmag^2 (v- posn ctr.posn))))</font></div><div><font face="Courier New">                  (ann (sqr r) Real)</font></div><div><font face="Courier New">                  (ann (- ctr.x r) (U Real False)) (ann (+ ctr.x r) (U Real False))</font></div><div><font face="Courier New">                  (ann (- ctr.y r) (U Real False)) (ann (+ ctr.y r) (U Real False))</font></div><div><font face="Courier New">                  (ann (- ctr.z r) (U Real False)) (ann (+ ctr.z r) (U Real False))</font></div><div><font face="Courier New">                  #:line-style 'transparent</font></div><div><font face="Courier New">                  #:color color)))</font></div></div><div><br></div><div><div><font face="Courier New">. Type Checker: Expected (Vectorof Real), but got Plot-Color in: ctr.posn</font></div><div><font face="Courier New">. Type Checker: Expected (Vectorof Real), but got Plot-Color in: ctr.posn</font></div><div><font face="Courier New">. Type Checker: Expected (Vectorof Real), but got Plot-Color in: ctr.posn</font></div><div><font face="Courier New">. Type Checker: Expected (Vectorof Real), but got Plot-Color in: ctr.posn</font></div><div><font face="Courier New">. Type Checker: Expected Real, but got True in: r</font></div><div><font face="Courier New">. Type Checker: Expected Real, but got True in: r</font></div><div><font face="Courier New">. Type Checker: Expected Real, but got True in: r</font></div><div><font face="Courier New">. Type Checker: Expected Real, but got True in: r</font></div><div><font face="Courier New">. Type Checker: Expected Real, but got True in: r</font></div><div><font face="Courier New">. Type Checker: Expected Real, but got True in: r</font></div><div><font face="Courier New">. Type Checker: Expected Real, but got True in: r</font></div><div><font face="Courier New">. Type Checker: No function domains matched in function application:</font></div><div><font face="Courier New">Types: (Real Real Real -> Real) Real (U Real False) (U Real False) (U Real False) (U Real False) (U Real False) (U Real False) -> renderer3d</font></div><div><font face="Courier New">       (Real Real Real -> Real) Real (U Real False) (U Real False) (U Real False) (U Real False) (U Real False) -> renderer3d</font></div><div><font face="Courier New">       (Real Real Real -> Real) Real (U Real False) (U Real False) (U Real False) (U Real False) -> renderer3d</font></div><div><font face="Courier New">       (Real Real Real -> Real) Real (U Real False) (U Real False) (U Real False) -> renderer3d</font></div><div><font face="Courier New">       (Real Real Real -> Real) Real (U Real False) (U Real False) -> renderer3d</font></div><div><font face="Courier New">       (Real Real Real -> Real) Real (U Real False) -> renderer3d</font></div><div><font face="Courier New">       (Real Real Real -> Real) Real -> renderer3d</font></div><div><font face="Courier New">Arguments: (Real Real Real -> Real) Real (U Real False) (U Real False) (U Real False) (U Real False) (U Real False) (U Real False)</font></div><div><font face="Courier New">Expected result: renderer3d</font></div><div><font face="Courier New"> in: (isosurface3d (λ: ((x : Real) (y : Real) (z : Real)) (let: ((posn : (Vectorof Real) (vector x y z))) (vmag^2 (v- posn ctr.posn)))) (ann (sqr r) Real) (ann (- ctr.x r) (U Real False)) (ann (+ ctr.x r) (U Real False)) (ann (- ctr.y r) (U Real False)) (ann (+ ctr.y r) (U Real False)) (ann (- ctr.z r) (U Real False)) (ann (+ ctr.z r) (U Real False)) #:line-style (quote transparent) #:color color)</font></div><div><font face="Courier New">. Type Checker: Expected (Vectorof Real), but got False in: ctr.posn</font></div><div><font face="Courier New">. Type Checker: Expected (Vectorof Real), but got False in: ctr.posn</font></div><div><font face="Courier New">. Type Checker: Expected (Vectorof Real), but got False in: ctr.posn</font></div><div><font face="Courier New">. Type Checker: Expected (Vectorof Real), but got False in: ctr.posn</font></div><div><font face="Courier New">. Type Checker: Expected Real, but got False in: r</font></div><div><font face="Courier New">. Type Checker: Expected Real, but got False in: r</font></div><div><font face="Courier New">. Type Checker: Expected Real, but got False in: r</font></div><div><font face="Courier New">. Type Checker: Expected Real, but got False in: r</font></div><div><font face="Courier New">. Type Checker: Expected Real, but got False in: r</font></div><div><font face="Courier New">. Type Checker: Expected Real, but got False in: r</font></div><div><font face="Courier New">. Type Checker: Expected Real, but got False in: r</font></div><div><font face="Courier New">. Type Checker: No function domains matched in function application:</font></div><div><font face="Courier New">Types: (Real Real Real -> Real) Real (U Real False) (U Real False) (U Real False) (U Real False) (U Real False) (U Real False) -> renderer3d</font></div><div><font face="Courier New">       (Real Real Real -> Real) Real (U Real False) (U Real False) (U Real False) (U Real False) (U Real False) -> renderer3d</font></div><div><font face="Courier New">       (Real Real Real -> Real) Real (U Real False) (U Real False) (U Real False) (U Real False) -> renderer3d</font></div><div><font face="Courier New">       (Real Real Real -> Real) Real (U Real False) (U Real False) (U Real False) -> renderer3d</font></div><div><font face="Courier New">       (Real Real Real -> Real) Real (U Real False) (U Real False) -> renderer3d</font></div><div><font face="Courier New">       (Real Real Real -> Real) Real (U Real False) -> renderer3d</font></div><div><font face="Courier New">       (Real Real Real -> Real) Real -> renderer3d</font></div><div><font face="Courier New">Arguments: (Real Real Real -> Real) Real (U Real False) (U Real False) (U Real False) (U Real False) (U Real False) (U Real False)</font></div><div><font face="Courier New">Expected result: renderer3d</font></div><div><font face="Courier New"> in: (isosurface3d (λ: ((x : Real) (y : Real) (z : Real)) (let: ((posn : (Vectorof Real) (vector x y z))) (vmag^2 (v- posn ctr.posn)))) (ann (sqr r) Real) (ann (- ctr.x r) (U Real False)) (ann (+ ctr.x r) (U Real False)) (ann (- ctr.y r) (U Real False)) (ann (+ ctr.y r) (U Real False)) (ann (- ctr.z r) (U Real False)) (ann (+ ctr.z r) (U Real False)) #:line-style (quote transparent) #:color color)</font></div></div><div><br></div><div><br></div><br><div><div>On Apr 19, 2014, at 10:46 PM, Greg Hendershott <<a href="mailto:greghendershott@gmail.com">greghendershott@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">I think you don't want those #{} annotations in the function definition:<br><br><blockquote type="cite">(define (sphere3d #:posn #{ctr.posn : (Vectorof Real)} #:r #{r :<br>Nonnegative-Real} #:color [#{color : Plot-Color} "black"])<br></blockquote><br>The following typechecks OK for me:<br><br>(define (sphere3d #:posn ctr.posn #:r r #:color [color "black"])<br><br>In other words, when you annotate the function using `(: sphere3d<br>___)`, you've told Typed Racket all it needs to know about the<br>function type. Then you can write the function definition just as you<br>would in untyped Racket.<br></blockquote></div><br></body></html>