<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>The problem isn’t with List vs. Sequenceof, the problem is that (Vector Symbol Symbol Integer) isn’t a subtype of (Vector Any Any (U Real False ivl)). </div><div><div><font face="Courier New">#lang typed/racket</font></div><div><div><font face="Courier New">(require plot/typed)</font></div><div><font face="Courier New">(ann (cast 0 (Vector Symbol Symbol Integer)) (Vector Any Any (U Real False ivl)))</font></div></div><div><br></div><div>Also (Vector Symbol) isn’t a subtype of (Vector Any), either. </div><div><br></div></div><div>You can solve this problem by doing this:</div><div><div><font face="Courier New">#lang typed/racket ;<- typed</font></div><div><font face="Courier New">(require plot/typed) ;<- typed</font></div><div><font face="Courier New">(plot-new-window? #t)</font></div><div><font face="Courier New">(plot3d (discrete-histogram3d (ann '(#(a a 1) #(a b 2) #(b b 3))</font></div><div><font face="Courier New"> (List (Vector Any Any (U Real False ivl))</font></div><div><font face="Courier New"> (Vector Any Any (U Real False ivl))</font></div><div><font face="Courier New"> (Vector Any Any (U Real False ivl))))</font></div><div><font face="Courier New"> #:label "Missing (b,a)"</font></div><div><font face="Courier New"> #:color 4 #:line-color 4))</font></div></div><div><br></div><div>The type (Vector Symbol Symbol Integer) can’t be a subtype of (Vector Any Any (U Real False ivl)) because Vectors are mutable. </div><div>From the perspective of an accessor it should be a subtype, but from the perspective of a mutator it should be the other way around. </div><div><br></div><div>At one point I submitted a bug report about this, but it turns out I was wrong. </div><div><div><a href="http://bugs.racket-lang.org/query/?cmd=view%20audit-trail&database=default&pr=14506&return_url=http%3A%2F%2Fbugs.racket-lang.org%2Fquery%2F%3Fdatabase%3Ddefault%3Bdebug%3D%3BState%3Dany%3BSynopsis%3DVector%3Bmultitext%3D%3Bcolumns%3DState%3Bcolumns%3DSynopsis%3Bcolumns%3DCategory%3Bcolumns%3DLast-Modified%3Bcolumns%3DRelease%3Bcmd%3Dsubmit%2520query%3Bsortby%3DNumber">http://bugs.racket-lang.org/query/?cmd=view%20audit-trail&database=default&pr=14506&return_url=http%3A%2F%2Fbugs.racket-lang.org%2Fquery%2F%3Fdatabase%3Ddefault%3Bdebug%3D%3BState%3Dany%3BSynopsis%3DVector%3Bmultitext%3D%3Bcolumns%3DState%3Bcolumns%3DSynopsis%3Bcolumns%3DCategory%3Bcolumns%3DLast-Modified%3Bcolumns%3DRelease%3Bcmd%3Dsubmit%2520query%3Bsortby%3DNumber</a></div></div><br><div><div>On May 30, 2014, at 10:17 AM, Greg Hendershott <<a href="mailto:greghendershott@gmail.com">greghendershott@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">p.s. I happened to paste the error message from 5.3.5. The TR error<br>message format in recent versions of Racket is much nicer; kudos!<br><br>; /tmp/tr.rkt:4:8: Type Checker: type mismatch<br>; expected: (Sequenceof<br>; (U (Vector Any Any (U Real False ivl))<br>; (List Any Any (U Real False ivl))))<br>; given: (List<br>; (Vector Symbol Symbol Integer)<br>; (Vector Symbol Symbol Integer)<br>; (Vector Symbol Symbol Integer))<br>; in: (discrete-histogram3d (quote (#(a a 1) #(a b 2) #(b b 3)))<br>#:label "Missing (b,a)" #:color 4 #:line-color 4)<br><br><br>On Fri, May 30, 2014 at 10:13 AM, Greg Hendershott<br><<a href="mailto:greghendershott@gmail.com">greghendershott@gmail.com</a>> wrote:<br><blockquote type="cite">This example from the plot docs works great:<br><br> #lang racket<br> (require plot)<br> (plot-new-window? #t)<br> (plot3d (discrete-histogram3d '(#(a a 1) #(a b 2) #(b b 3))<br> #:label "Missing (b,a)"<br> #:color 4 #:line-color 4))<br><br>But not with Typed Racket:<br><br> #lang typed/racket ;<- typed<br> (require plot/typed) ;<- typed<br> (plot-new-window? #t)<br> (plot3d (discrete-histogram3d '(#(a a 1) #(a b 2) #(b b 3))<br> #:label "Missing (b,a)"<br> #:color 4 #:line-color 4))<br> ; /tmp/tr.rkt:7:8: Type Checker: Expected (Sequenceof (U (Vector<br>Any Any (U Real False ivl)) (List Any Any (U Real False ivl)))), but<br>got (List (Vector Symbol Symbol Integer) (Vector Symbol Symbol<br>Integer) (Vector Symbol Symbol Integer))<br> ; in: (discrete-histogram3d (quote (#(a a 1) #(a b 2) #(b b 3)))<br>#:label "Missing (b,a)" #:color 4 #:line-color 4)<br><br>It fails to typecheck on 6.0.1.10, but also back on 5.3.5.<br><br>I don't understand the error; a list is a sequence, no?<br></blockquote>____________________<br> Racket Users list:<br> <a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a><br></blockquote></div><br></body></html>