Only want to say

Meta jared771 at gmail.com
Mon Jan 11 16:21:55 UTC 2021


On Monday, 11 January 2021 at 14:38:58 UTC, ddcovery wrote:
> On Monday, 11 January 2021 at 14:06:01 UTC, Steven 
> Schveighoffer wrote:
>> ...
>>
>> 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
>
> 100,000 apologies, Steve. You're right: it was an overreaction.
>
> The cause is not about do vs body (well, partly yes)... it is 
> about an accepted DIP telling that Contract programming is not 
> enough important in D community and can be belittled... I have 
> to recognize that it was a shock for me (because it is,with 
> scope, the basis of all scripting I'm working with D, and one 
> of the most used arguments in some posts in quora or when I 
> present D to other developers).
>
> Thank you very much for clarifying the situation so quickly.

I am the author of that DIP, and you are grossly mis-interpreting 
what I'm saying there. I am not saying that contract programming 
is not important; on the contrary, I think it is very important 
and use D's contract programming features whenever possible. 
However, I seem to be in the minority in that regard in the D 
community, and people have been complaining for 10+ years about 
not being able to use `body` as the name for a symbol. In that 
context, it does not make sense to tie up a very commonly used 
symbol name for a relatively underused feature.

As for `do`, that was not my idea; I originally proposed using 
`function` instead of body, but Andrei opted for `do` instead.

Regardless, it doesn't matter much now, as was mentioned, because 
body is now only a keyword in the context of function contracts.


More information about the Digitalmars-d mailing list