Enum name convention consistency

2009-08-18 Thread Sam Hu
>From std.range:
enum StoppingPolicy
{
/// Stop when the shortest range is exhausted
shortest,
/// Stop when the longest range is exhausted
longest,
/// Require that all ranges are equal
requireSameLength,
}

>From std.thread:( phobos webpage) 
enum State; 
A fiber may occupy one of three states: HOLD, EXEC, and TERM. The HOLD state 
applies to any fiber that is suspended and ready to be called. The EXEC state 
will be set for any fiber that is currently executing. And the TERM state is 
set when a fiber terminates. Once a fiber terminates, it must be reset before 
it may be called again. 

HOLD

EXEC

TERM

>From std.stream:
enum FileMode {
  In = 1,
  Out = 2,
  OutNew = 6, // includes FileMode.Out
  Append = 10 // includes FileMode.Out
}

Would not this be better if we keep the name convention consistent.
Regards,
Sam


Re: RegExp.match question

2009-08-18 Thread BCS

Reply to Saaa,


const char[] re1 = `(re)1`;
const char[] re2 = `(re)2`;
char[] matchWrite(RegExp re)
{
writefln(re.match(1),`,`,re.match(2));
return "";
}
std.regexp.sub(`re1 re2`, re1~'|'~re2, &matchWrite, "g");
--- prints
re,
re,re // shouldn't this be `,re`?


I *think* you are correct. If I had to guess, I'd do with it's an old data 
issue.