monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] typedef for args


From: Julio M. Merino Vidal
Subject: [Monotone-devel] typedef for args
Date: Mon, 16 Apr 2007 15:19:38 +0200

Hi,

I see that HACKING suggests to use typedefs to define new types that
are better suited to represent some concepts.  Indeed this is a good
idea, and while skimming through the sources I wondered why there was
no type to represent command line arguments nor arguments vectors.

The code currently uses std::string and utf8 to refer to arguments
indistinctly (as far as I can tell) in multiple places.  Conversions
between the two happen, and the lack of "standarization" makes adding
new APIs somewhat harder because they might be called from places that
use different representations.

So... what do you think about this patch?

   http://www.NetBSD.org/~jmmv/mtn-args.diff

It defines an arg_type to refer to a single argument and an
args_vector to refer to all arguments.  I doubt the place where I
defined them is correct, though, and maybe the names themselves are
not appropriate.

I can clean it up based on suggestions and commit the results, if you agree.

Thanks,

--
Julio M. Merino Vidal <address@hidden>
The Julipedia - http://julipedia.blogspot.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]