Only want to say

Steven Schveighoffer schveiguy at gmail.com
Mon Jan 11 14:06:01 UTC 2021


On 1/11/21 8:43 AM, ddcovery wrote:
> On Monday, 11 January 2021 at 10:14:36 UTC, ddcovery wrote:
>> ...
>> * Finally, with the "extended" version,  I use "body" instead "do":  
>> in/out/body are not verbs... "do" is a verb.  it's a subtle 
>> difference, but it's very important to me.
>> ...
> Oh my God, I found 
> https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1003.md
> 
> It seems that "body" will be deprecated in favor of "do"... I find this 
> decision specially bad but I suppose I will eat it with potatoes 
> (spanish expression).
> 
> Imagine someone saying "Because we want to use 'catch' for catching 
> errors with promises in JavaScript, we decide to deprecate 'catch' in 
> the try/catch structure).   Internet Explorer was this incompatibility 
> and everybody was to write ["catch"] for bypassing the IE problem... 
> actually "catch" is used in promises and as language itself and there is 
> no problems.
> 
> what "do" signifies?  "if precondition, then do... and check 
> postcondition" it is a "sequential" way to express something that, in my 
> opinion, must be declarative:  "this method has a precondition, a 
> postcondition and a body"
> 
> As I say... I will adapt to the new term... but it is clearly how 
> "imperative" developers doesn't accept "declarative" way of thinking... 
> sometimes
> 
> In special this kind of affirmation:
> 
> "Furthermore, D's contract programming features are rarely used compared 
> to how useful and desirable it is to be able to name a symbol "body"
> 
> Oh my God... one of the most powerful tools of D are belittled.
> 
> Seriously?... this is the kind of decisions that makes me doubt about D 
> future.

I highly doubt we will remove body in that syntax. The DIP proposed 
that, but that was under the expectation that we couldn't remove body as 
a keyword without also removing its support in that position.

Today, body is *not* a keyword, but can be used there. I don't think it 
will ever change. See the PR that was reverted because it affected a lot 
of code: https://github.com/dlang/dmd/pull/10763

And I have to say, this is quite the overreaction. "body" vs. "do" is 
not the thing that makes contracts function, let alone should cause you 
to doubt the future of D.

But this is kind of a side-thing, I'm glad you are loving the language, 
I share that emotion completely!

-Steve


More information about the Digitalmars-d mailing list