April 28, 2012
On Friday, 27 April 2012 at 20:49:54 UTC, Andrej Mitrovic wrote:
> On 4/27/12, Marco Leise <Marco.Leise@gmx.de> wrote:
>> In C:
>> STATUS_SUCCESS
>>
>> In D unmodified:
>> cairo_status_t.STATUS_SUCCESS
>>
>> In D with cosmetic changes:
>> cairo_status_t.SUCCESS
>
> cairo_status_t.SUCCESS is like going halfway there but stopping. It
> looks rather ugly imo. I think you either want the existing C names,
> or names that *fully* fit the D coding style. So maybe the choice
> should be between this:
>
> cairo_status_t.STATUS_SUCCESS
>
> and this:
>
> CairoStatus.Success

I'm going for the second one, due mostly to the fact that if I'm going to change the enum to fit in with D, I might make it fit in with D style-wise. The difference in style should help to make it obvious to spot.

Also, most functions would get covered by a wrapper, but there is little use to wrapping enums, so it is worthwhile making it nice to work with in "normal" D code.

--
James Miller
1 2 3
Next ›   Last »