[racket] Typed Racket interface to plot

From: Neil Toronto (neil.toronto at gmail.com)
Date: Mon Dec 17 18:19:54 EST 2012

Scratch the note for Typed Racket users, except for the "it shouldn't 
take long" part. Vincent just fixed optional arguments in Typed Racket. 
Making plots in Typed Racket is now exactly the same as in untyped 
Racket, except you require a different module and annotate the plotted 
functions. Very nice, V.

Neil ⊥

On 12/17/2012 12:14 PM, Neil Toronto wrote:
> Working from Ray Racine's initial Typed Racket interface to `plot', I've
> added the module `plot/typed'. It should be in the next nightly build,
> if something I did earlier for it doesn't continue to break the build.
> It shouldn't. :D
>
> Example use:
>
> #lang typed/racket
>
> (require math plot/typed)
>
> (plot3d (contour-intervals3d
>           (λ: ([x : Real] [y : Real])
>             (/ (gamma x) (gamma y)))
>           0.25 2 0.25 2)
>          #:angle 250
>          #:out-file "gamma-ratio.pdf")
>
>
> Every documented `plot' and `plot/utils' export is now typed, and they
> pass the new `plot/typed' tests. There are probably small errors remaining.
>
> Two things to note:
>
>   * For Typed Racket users: non-keyword optional arguments are currently
>     required. We're waiting on a fix in TR for this. It shouldn't take
>     long. In the meantime, including all non-keyword arguments doesn't
>     seem to be a serious imposition, because they're usually required to
>     get sensible plot bounds. (For multiple plots, use `#f'.)
>
>   * For all plot users: functions that used to accept lists and vectors
>     now accept arbitrary sequences and sequences of sequences. Even the
>     function passed to `vector-field' can return a sequence.
>
> Ray: thanks a ton for doing most of it. It took me just over a day
> instead of a week because of your initial work.
>
> Neil ⊥


Posted on the users mailing list.