[racket] Rosetta Code

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Mon Feb 25 16:30:58 EST 2013

It would be nice to show module+ but when I checked I couldn't find other examples with tests. 


On Feb 25, 2013, at 3:55 PM, John Clements wrote:

> 
> On Feb 25, 2013, at 11:33 AM, Eli Barzilay wrote:
> 
>> A few minutes ago, Danny Yoo wrote:
>>> Yup; I've been doing so a little bit, fixing up some of the code
>>> snippets so they work on sequences rather than just on lists, and
>>> using "raise-argument-error" in favor of just plain error, since the
>>> error messages are better.  For example:
>>> 
>>>   http://rosettacode.org/wiki/Dot_product#Racket
>>>   http://rosettacode.org/wiki/A%2BB#Racket
>> 
>> Two comments:
>> 
>> * IMO having complete #lang-ed files is much better, since people get
>> a working template file rather than a repl demonstration.
>> 
>> * -1 for the pedantics of errors etc in the second example -- I think
>> that the main goal of these things is for quick impressions, and for
>> that second example, a half-line
>> 
>>   (+ (read) (read))
>> 
>> is *much* better-looking.  For extras like error checking, I'd defer
>> them for an additional extended example with more stuff in.  (But in
>> the case of error checking, I'd probably still skip it.)
> 
> Any general opinion on the value of test cases? I did a quick copy of gcd this morning, and I couldn't decide whether the test cases made it look more helpful or just verbose.
> 
> John
> 
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users



Posted on the users mailing list.