Re: Solutions and Discussion for Perl Quiz of the Week #23

Mark Jason Dominus <[email protected]>
Newsgroups gmane.comp.lang.perl.qotw.discuss
Message-ID <[email protected]>
On Fri, Sep 10, 2004 at 05:07:21PM -0400, Daniel Martin wrote:
> > The problem with his code was that when Matthew Walton posted it to
> > the mailing list, an extra space was inserted into the source.  Since
> > haskell is (or at least, is usually) a language where indentation is
> > significant, this meant it didn't compile.

Haskell's base definition includes curly brace delimiters for the
blocks, similar to Perl or C.  It only becomes whitespace-sensitive if
you leave out the delimiters; then the indentation is used to infer
the block structure.  

So an alternative to this:

> Suggestions for future solution submitters:
> 
> 1. If you're going to submit a solution in a format-sensitive language
> e.g. python, submit it as an attachment, for obvious reasons.

at least for Haskell, is simply to put the braces in, so that the
structure doesn't have to be inferred from the whitespace.

> 2. Extra "debug" output from your script is great, but (a) send it to
> STDERR and/or (b) use a "--verbose" option to your script to enable it.
> 
> 3. If an output format is specified, adhere to it reasonably closely.
> 

Until they've tried it, people really don't understand what a pain it
can be to test twenty-five slightly different variations on the same
program, each of which has one or two clever extensions.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.