[prev in list] [next in list] [prev in thread] [next in thread] 

List:       darcs-devel
Subject:    [darcs-devel] Re: Fwd: Style issues [was: should we import...]
From:       Aaron Denney <wnoise () ofb ! net>
Date:       2005-05-25 22:01:08
Message-ID: slrnd99tgk.1dq.wnoise () ofb ! net
[Download RAW message or body]

On 2005-05-25, David Roundy <droundy@abridgegame.org> wrote:
> I'd add though that while there certainly are times when I might like
> having unused argument names as "comments", now that I've started getting
> used to it, I actually like even more the "enforced" comment of calling
> your unused arguments "_".  At first glance it seems nice to say
>
> foo x y [] = x
> foo x y list = y
>
> but I actually find something like
>
> foo x _ [] = x
> foo _ y _ = y
>
> easier to read, since it directs the eye directly to the argument that
> actually matters.

Well, it seems that way, yes, and usually is, but for the casses where
the _ is a catch-all after explicitly handling some cases differently,
I don't think it's clearly true.  (Though I still prefer it).

In the example that started this, we had
foo x [y] = ...
foo x _   = ...

Which showed handling singletons seperately.  It's not that the _ is not
looked at, or unimportant.  It is examined to make sure it's not a
singleton.

-- 
Aaron Denney
-><-


_______________________________________________
darcs-devel mailing list
darcs-devel@darcs.net
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic