[darcs-users] [issue1550] general purpose command line parsing library (CmdArgs)
kowey at darcs.net
Thu Oct 1 08:08:09 UTC 2009
On Wed, Sep 30, 2009 at 16:54:20 -0700, Jason Dagit wrote:
> > I wonder: what if we just replaced [DarcsFlag] with Set DarcsFlag.
> > Would that not achieve the intended effect as well?
> I'm not certain, but I think a switch like this assumes that we have a
> systematic way to combine multiple flags.
Well, this would be the same as Neil's approach in the sense that your
implicit assumption is that you don't have multiple instances of the
same flag (so your getopt wrapper or whatever would have to complain if
it picked up a flag)
> I do get your point about query efficiency though. And I think you're right
> that using Data.Set would provide good enough lookup performance. Well,
> okay, I've never seen our queries of [DarcsFlag] show up in the profiling
> data so I don't really feel like it's something that is worth optimizing.
I wasn't concerned with query performance at all. My main concern with
the flags is whether they help us make our code, clear, safe and easy to
understand which is what Neil shares.
To be clear, I actually quite like Neil's approach too. The sets idea
just came to me randomly, and I wanted to explore it.
Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
PGP Key ID: 08AC04F9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 197 bytes
Desc: Digital signature
More information about the darcs-users