My body is ugly [Re: Contextualizing keywords]

Jarrett Billingsley jarrett.billingsley at gmail.com
Mon Aug 3 07:39:14 PDT 2009


On Mon, Aug 3, 2009 at 3:11 AM, Don<nospam at nospam.com> wrote:
> Robert Fraser wrote:
>>
>> Hi, hope you're all enjoying the properties debate.
>>
>> I've been seeing the "too many keywords" argument a lot lately, and I
>> think it's definitely a valid argument. "shared" and "body" in particular
>> are rather annoying keywords since I frequently use them in code. And if
>> users are deciding not to use D because of the number of keywords, that's
>> even worse.
>
> Why not just get rid of 'body'?
>
> 'body' is the most useless keyword in D. It's ugly, and doesn't achieve
> anything much at all -- it's just a compiler-checked comment, really.
> Almost identical to // body
>
> Compare:
> ----------------------
> int foo(int a)
> in {
>   assert(a>2);
> }
> body
> {
>   return a-1;
> }
> ----------------------
> int foo(int a)
> in {
>   assert(a>2);
> }
> // body
> {
>   return a-1;
> }
> ----------------------
>
> That's a ridiculously tiny benefit for a keyword. I hate my body.
> <g>

Seeeeconded.  It's the silliest keyword.



More information about the Digitalmars-d mailing list