Friday, April 6, 2012

Thanks, Ryan!

Ryan Culpepper has developed a nifty tool for posting Scribble documents to blogs. Not only does this simplify my life as a writer, it allows you, the reader, to see Racket as I see it. Consider my last post’s example, as rendered by Ryan’s tool:
> (require"../private/geometry.rkt")
> (define my-geometry(make-geometry #(1 0.5+0.05i 0+0.1i 0.5+0.05i 1)))
Warning: (j-1 n a) is not yet implemented!
Warning: (optimize-c0 c0 n a) is not yet implemented!
Warning: (dt/dc ? ? ?) is not yet implemented!
> (geometry? my-geometry)
#t
> (geometry-chord my-geometry)
1.004987562112089
> (geometry-N my-geometry)
'#(0.5024937810560445+6.938893903907228e-018i
   0.0+0.0i
   -0.5024937810560445-6.938893903907228e-018i
   0.0+0.0i
   0.5024937810560445+6.938893903907228e-018i)
First up, see how pretty it is? This depiction is much closer to what I see in the Racket environment, although it still doesn't show the syntax coloring. At least I achieve it by writing Racket, writing in my favorite language. All those parentheses aren’t so bad, when you consider HTML’s tags are just the same but <tag>longer</tag>.
And second, my first bug is fixed, as the result of geometry-N is all real (or nearly so, I can accept imaginary components on the order of 1e-18), as it should be. Future topic: incorporation of testing into the development process, or how to document past mistakes as future requirements.

1 comment:

  1. Re: "it still doesn't show the syntax coloring", it does as soon as I add the style sheet that Ryan recommends. RTFM!

    ReplyDelete