Re: Better ways of documenting functions with type information?

2013-01-15 Thread Stephen Compall
On Sun, 2013-01-13 at 19:03 +0100, Marcel Möhring wrote: Currently I am using this approach but it feels rather clumsy: Takes a screen and a pixel coordinate and returns a map of maps with pixel colors and adjusted pixel coordinates around the pixel. Directions are degree

Re: Better ways of documenting functions with type information?

2013-01-14 Thread u1204
Try literate programming. If you are going to write a program it will be read many times. Try to write as though you were writing a book. Make the code be just a reduction to practice of the words in the book. The idea of literate programming is that you write for other people and, incidentally,

Better ways of documenting functions with type information?

2013-01-13 Thread Marcel Möhring
Hello, is there a better way to document a function if I want to include type information and parameters for in/out? Currently I am using this approach but it feels rather clumsy: Takes a screen and a pixel coordinate and returns a map of maps with pixel colors and adjusted pixel

Re: Better ways of documenting functions with type information?

2013-01-13 Thread John Gabriele
On Sunday, January 13, 2013 1:03:35 PM UTC-5, Marcel Möhring wrote: Hello, is there a better way to document a function if I want to include type information and parameters for in/out? Currently I am using this approach but it feels rather clumsy: Takes a screen and a pixel

Re: Better ways of documenting functions with type information?

2013-01-13 Thread Brandon Bloom
You could use type hints and pre/post conditions: (defn foo Gets adjusted pixels or whatever [^BufferedImage screen ^Number x ^Number y] {:post [(foo-map? %)]} ...) (defn foo-map? True if x is a map of maps with pixel colors ... [x] ...) That said, it would be nice if