[racket] Rosetta Code

From: John Clements (clements at brinckerhoff.org)
Date: Mon Feb 25 15:55:51 EST 2013

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4370 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20130225/1fae02dd/attachment.p7s>

Posted on the users mailing list.