November 19, 2017
On Sunday, 19 November 2017 at 08:05:38 UTC, Tony wrote:
>
>
> OK, but how would someone who is looking at:
>
> https://docarchives.dlang.io/v2.074.0/spec/contracts.html
>

I wish this board had an edit function. That should be

"OK, but how would someone who is looking at:

https://dlang.org/spec/contracts.html
November 19, 2017
On Sunday, 19 November 2017 at 08:13:32 UTC, Tony wrote:
> On Sunday, 19 November 2017 at 08:05:38 UTC, Tony wrote:
>>
>>
>> OK, but how would someone who is looking at:
>>
>> https://docarchives.dlang.io/v2.074.0/spec/contracts.html
>>
>
> I wish this board had an edit function. That should be
>
> "OK, but how would someone who is looking at:
>
> https://dlang.org/spec/contracts.html

They wouldn't need to know. Obviously they know its purpose and how it works if they have it in their source code, if they don't have it in their source code and they look at contracts, then they will be fine either way as it's not a required keyword anymore and thus doesn't require documentation, since you can achieve the same semantics without using the keyword.

The keyword is completely irrelevant unless you're maintaining old source codes, in which case you should already be aware of how it functions and if you aren't then a little research won't hurt.
November 19, 2017
On Sunday, 19 November 2017 at 11:02:37 UTC, bauss wrote:
> On Sunday, 19 November 2017 at 08:13:32 UTC, Tony wrote:
>> On Sunday, 19 November 2017 at 08:05:38 UTC, Tony wrote:
>>>
>>>
>>> OK, but how would someone who is looking at:
>>>
>>> https://docarchives.dlang.io/v2.074.0/spec/contracts.html
>>>
>>
>> I wish this board had an edit function. That should be
>>
>> "OK, but how would someone who is looking at:
>>
>> https://dlang.org/spec/contracts.html
>
> They wouldn't need to know. Obviously they know its purpose and how it works if they have it in their source code, if they don't have it in their source code and they look at contracts, then they will be fine either way

They won't be fine either way if they are using LDC or GDC right now or they are using a slightly older version of DMD and they want to try using contracts. They will look at the documentation and think that they need to write "do" and their version of the compiler will only accept "body", which won't be documented.

> as it's not a required keyword anymore and thus doesn't require documentation, since you can achieve the same semantics without using the keyword.
>
> The keyword is completely irrelevant unless you're maintaining old source codes, in which case you should already be aware of how it functions and if you aren't then a little research won't hurt.

"do" doesn't appear to be optional and the compiler still talks about the deprecated "body", even if any mention of it has been removed from the documentation:

import std.stdio : writeln;

int MyFunction(int input)
in
{
   assert(input >= 0);
}
out (result)
{
   assert(result > 100);
}

{
   return input + 100;
}


void main()
{
   writeln("output: ",MyFunction(10));
}



dmd --version
DMD64 D Compiler v2.077.0
Copyright (c) 1999-2017 by Digital Mars written by Walter Bright

dmd test_contracts.d
test_contracts.d(13): Error: missing `body { ... }` after `in` or `out`



November 19, 2017
On Sunday, 19 November 2017 at 11:02:37 UTC, bauss wrote:

>
> They wouldn't need to know. Obviously they know its purpose and how it works if they have it in their source code, if they don't have it in their source code and they look at contracts, then they will be fine either way as it's not a required keyword anymore and thus doesn't require documentation, since you can achieve the same semantics without using the keyword.
>
> The keyword is completely irrelevant unless you're maintaining old source codes, in which case you should already be aware of how it functions and if you aren't then a little research won't hurt.

I may have misunderstood you. I assumed you were saying that the "do" keyword was optional in the syntax. If not, given the fact that "body" may be required on the compiler that someone is currently using and the documentation only mentions "do", the keyword seems relevant to me.
November 19, 2017
On Saturday, 18 November 2017 at 19:22:25 UTC, Meta wrote:
> On Saturday, 18 November 2017 at 16:21:30 UTC, Eljay wrote:
>> On Monday, 28 March 2011 at 18:59:03 UTC, Walter Bright wrote:
>>> On 3/27/2011 10:35 PM, Jonathan M Davis wrote:
>>>> I'll be _very_ excited to have both the destructor issues and the const issues
>>>> sorted out. They are some of the more annoying quality of implementation
>>>> issues at the moment.
>>>
>>> Yes, I agree those are the top priority at the moment, now that we have the 64 bit compiler online and the worst of the optlink issues resolved.
>>
>> NECRO ALERT...
>>
>> But I just saw that https://github.com/dlang/DIPs/blob/master/DIPs/DIP1003.md was addressed with https://github.com/dlang/dmd/pull/6855 .
>>
>> I, for one, will miss 'body' the keyword.  Now I'll have to update all my toy code.
>>
>> (Just kidding, I don't mind updating my toy code.  At least it isn't a codebase the size of Photoshop!)
>
> Don't worry, you've got a few years yet. Currently `body`is not even deprecated; it's become a conditional keyword, or you can use `do` in its place.

Yeah, "no worries" but for example a few weeks ago a bug report has drawn my attention:

https://issues.dlang.org/show_bug.cgi?id=17925

After testing some code with i've indeed observed that the transition period for `do` had started...

"since when ?" i've wondered.

Good question, it's even not in the changelog:

https://www.google.fr/search?domains=dlang.org&dcr=0&biw=1280&bih=635&tbs=qdr%3Ay&ei=H34RWpKDPIzTgAatnqK4DA&q=body+do+site%3Adlang.org%2Fchangelog&oq=body+do+site%3Adlang.org%2Fchangelog&gs_l=psy-ab.3...4014.4428.0.4779.3.3.0.0.0.0.67.190.3.3.0....0...1.1.64.psy-ab..0.0.0....0.AOIgJDEhh_g

So maybe it's wort mentioning something like

"(formerly body, which is still allowed during ....)", because there's been a communication problem with that deprecation.
November 19, 2017
On Sunday, 19 November 2017 at 12:54:37 UTC, Basile B. wrote:
> Yeah, "no worries" but for example a few weeks ago a bug report has drawn my attention:
>
> https://issues.dlang.org/show_bug.cgi?id=17925
>
> After testing some code with i've indeed observed that the transition period for `do` had started...
>
> "since when ?" i've wondered.
>
> Good question, it's even not in the changelog:
>
> https://www.google.fr/search?domains=dlang.org&dcr=0&biw=1280&bih=635&tbs=qdr%3Ay&ei=H34RWpKDPIzTgAatnqK4DA&q=body+do+site%3Adlang.org%2Fchangelog&oq=body+do+site%3Adlang.org%2Fchangelog&gs_l=psy-ab.3...4014.4428.0.4779.3.3.0.0.0.0.67.190.3.3.0....0...1.1.64.psy-ab..0.0.0....0.AOIgJDEhh_g
>
> So maybe it's wort mentioning something like
>
> "(formerly body, which is still allowed during ....)", because there's been a communication problem with that deprecation.

Yes, I'm pretty sure I created the PR to remove all references to `body` myself. It's part of the process; the first step is removing it from the documentation, because outright deprecation is too sudden. It's still perfectly usable, but we don't want to advertise it anymore.
November 19, 2017
On Sunday, November 19, 2017 21:07:53 Meta via Digitalmars-d wrote:
> On Sunday, 19 November 2017 at 12:54:37 UTC, Basile B. wrote:
> > Yeah, "no worries" but for example a few weeks ago a bug report has drawn my attention:
> >
> > https://issues.dlang.org/show_bug.cgi?id=17925
> >
> > After testing some code with i've indeed observed that the transition period for `do` had started...
> >
> > "since when ?" i've wondered.
> >
> > Good question, it's even not in the changelog:
> >
> > https://www.google.fr/search?domains=dlang.org&dcr=0&biw=1280&bih=635&tb s=qdr%3Ay&ei=H34RWpKDPIzTgAatnqK4DA&q=body+do+site%3Adlang.org%2Fchangel og&oq=body+do+site%3Adlang.org%2Fchangelog&gs_l=psy-ab.3...4014.4428.0.4 779.3.3.0.0.0.0.67.190.3.3.0....0...1.1.64.psy-ab..0.0.0....0.AOIgJDEhh_ g
> >
> > So maybe it's wort mentioning something like
> >
> > "(formerly body, which is still allowed during ....)", because there's been a communication problem with that deprecation.
>
> Yes, I'm pretty sure I created the PR to remove all references to `body` myself. It's part of the process; the first step is removing it from the documentation, because outright deprecation is too sudden. It's still perfectly usable, but we don't want to advertise it anymore.

It would have been better to explain in the documentation that body was being phased out rather than just removing it right when the changes were made to dmd. It's already caused problems due to folks trying to use do and it not working with the compiler that they're using (e.g. ldc).

https://stackoverflow.com/questions/46860573/do-ldc-and-gdc-support-d-language-contracts

- Jonathan M Davis

November 19, 2017
On Sunday, 19 November 2017 at 12:54:37 UTC, Basile B. wrote:
> Good question, it's even not in the changelog:
>
> https://www.google.fr/search?domains=dlang.org&dcr=0&biw=1280&bih=635&tbs=qdr%3Ay&ei=H34RWpKDPIzTgAatnqK4DA&q=body+do+site%3Adlang.org%2Fchangelog&oq=body+do+site%3Adlang.org%2Fchangelog&gs_l=psy-ab.3...4014.4428.0.4779.3.3.0.0.0.0.67.190.3.3.0....0...1.1.64.psy-ab..0.0.0....0.AOIgJDEhh_g
>
> So maybe it's wort mentioning something like
>
> "(formerly body, which is still allowed during ....)", because there's been a communication problem with that deprecation.

Yes, I just checked and it's nowhere to be found in the changelog. Walter created the PR to implement the `do` syntax but he did not make a corresponding doc change. I'm not sure what to do considering 2.077.0 has already released.
November 19, 2017
On Sunday, 19 November 2017 at 21:14:58 UTC, Jonathan M Davis wrote:
> It would have been better to explain in the documentation that body was being phased out rather than just removing it right when the changes were made to dmd. It's already caused problems due to folks trying to use do and it not working with the compiler that they're using (e.g. ldc).
>
> https://stackoverflow.com/questions/46860573/do-ldc-and-gdc-support-d-language-contracts
>
> - Jonathan M Davis

Yeah, you're right. I never use GDC/LDC so I didn't consider them.
November 19, 2017
On Sunday, 19 November 2017 at 21:19:58 UTC, Meta wrote:
> On Sunday, 19 November 2017 at 12:54:37 UTC, Basile B. wrote:
>> Good question, it's even not in the changelog:
>>
>> https://www.google.fr/search?domains=dlang.org&dcr=0&biw=1280&bih=635&tbs=qdr%3Ay&ei=H34RWpKDPIzTgAatnqK4DA&q=body+do+site%3Adlang.org%2Fchangelog&oq=body+do+site%3Adlang.org%2Fchangelog&gs_l=psy-ab.3...4014.4428.0.4779.3.3.0.0.0.0.67.190.3.3.0....0...1.1.64.psy-ab..0.0.0....0.AOIgJDEhh_g
>>
>> So maybe it's wort mentioning something like
>>
>> "(formerly body, which is still allowed during ....)", because there's been a communication problem with that deprecation.
>
> Yes, I just checked and it's nowhere to be found in the changelog. Walter created the PR to implement the `do` syntax but he did not make a corresponding doc change. I'm not sure what to do considering 2.077.0 has already released.

It's probably too late for the changelog but the specs can still mention that there was another keyword in the past. New comers will encounter body much when they read old code.