Enum name convention consistency

John C johnch_atms at hotmail.com
Wed Aug 19 01:00:27 PDT 2009


Sam Hu wrote:
> 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

Note that std.socket also uses the SHOUTY style. But I think Phobos 
should stick to the std.stream style. The std.range style seems to be 
one of Andrei's peccadilloes.


More information about the Digitalmars-d-learn mailing list