std.uuid is ready for review

Jonathan M Davis jmdavisProg at gmx.com
Fri Feb 10 16:37:44 PST 2012


On Saturday, February 11, 2012 00:40:39 Timon Gehr wrote:
> On 02/11/2012 12:26 AM, Tobias Pankrath wrote:
> > Jonathan M Davis wrote:
> >> On Friday, February 10, 2012 16:36:48 Robert Jacques wrote:
> >>> These functions are _constructors_; ideally, they should be
> >>> expressed as such. In a managed language, we'd probably for with
> >>> UUID("random",...). And if explicit template ctors were valid
> >>> syntax, we'd used
> >>> UUID!"random"(...) or UUID!Mt19937() or UUID!randomNumberBased or
> >>> something. There's also the enum/aliases, i.e. UUID(UUID.random) or
> >>> UUID(Enum!"random") or UUID(UUID.Version.randomNumberBased). And at
> >>> least for random, overloading works decently well, i.e.
> >>> UUID(mySeed) or UUID(Mt19937(unpredictableSeed)). My point, or lack
> >>> thereof, was to brainstorm ways of expressing a large variety of
> >>> construction routines _as_ actual constructors.
> >> 
> >> A factory function is vastly better than any of those suggestions
> >> IMHO. I see no problem with having randomUUID as a free function, and
> >> I really think that it's best as-is.
> >> 
> >> - Jonathan M Davis
> > 
> > randomUuid it should be.
> 
> No.
> 
> Also see http://www.d-programming-language.org/phobos/std_utf.html

Yeah. For the most part, Phobos takes the tact of making all letters in 
acronyms be the same case (all uppercase if the first letter is uppercase and 
all lowercase if the first letter is lowercase).

- Jonathan M Davis


More information about the Digitalmars-d mailing list