On 08/12/2012 06:14 PM, Ray Racine wrote:
Just completed a first cut draft TRing the Plot collection.  Completely
untested, though the few things I've tried worked fine.
Neil/Sam, any suggestions, naming or layout conventions are much
appreciated.  Otherwise, I'll do a cleanup pass, test it, and initiate a
pull-request this week.

https://github.com/RayRacine/racket/tree/tr-plot/collects/typed/plot

Cool!

This is probably going to annoy you, but the `Option' type doesn't mean the argument isn't required. The entry for `surface3d' is currently

[surface3d ((Real Real -> Real)
            (Option Exact-Rational)
            (Option Exact-Rational)
            (Option Exact-Rational)
            (Option Exact-Rational)
            .... -> Renderer3d)]

where `....' represents the keyword argument types. To account for the possible argument combinations, it should be

[surface3d
 (case-> ((Real Real -> Real)
          .... -> Renderer3d)
         ((Real Real -> Real)
          (Option Exact-Rational)
          .... -> Renderer3d)
         ((Real Real -> Real)
          (Option Exact-Rational)
          (Option Exact-Rational)
          .... -> Renderer3d)
         ((Real Real -> Real)
          (Option Exact-Rational)
          (Option Exact-Rational)
          (Option Exact-Rational)
          .... -> Renderer3d)
         ((Real Real -> Real)
          (Option Exact-Rational)
          (Option Exact-Rational)
          (Option Exact-Rational)
          (Option Exact-Rational)
          .... -> Renderer3d))]

I agree with you that this is insane, and that Sam or Vincent should do something about it. :D

In the meantime, write a new macro to use instead of `require/typed/provide'. (Macros inside types won't expand.) Fortunately, function types with keyword arguments already expand to `case->' types, so you don't have to change anything about those.

Neil ⊥

_________________________
 Racket Developers list:
 http://lists.racket-lang.org/dev

Reply via email to