5 days ago
On Thursday, 18 May 2017 at 03:59:49 UTC, MysticZach wrote:
> http://forum.dlang.org/post/kybywnscisxpebezwyvk@forum.dlang.org ) represents yet another distinct option. i.e. continue to allow `body`, but make it optional, that is, you can simply omit it if you want, while also allowing it as an identifier.

For the record, this was first suggested by H. S. Teoh:
http://forum.dlang.org/post/mailman.2204.1494612727.31550.digitalmars-d@puremagic.com
5 days ago
On Thursday, 18 May 2017 at 03:59:49 UTC, MysticZach wrote:
> On Thursday, 18 May 2017 at 02:13:52 UTC, Meta wrote:
>> On Wednesday, 17 May 2017 at 11:46:07 UTC, Meta wrote:
>>> I'll add this option to the DIP.
>>
>> https://github.com/dlang/DIPs/pull/65
>
> I think ( http://forum.dlang.org/post/kybywnscisxpebezwyvk@forum.dlang.org ) represents yet another distinct option. i.e. continue to allow `body`, but make it optional, that is, you can simply omit it if you want, while also allowing it as an identifier.

This is pretty much the same as option 2. The short-term contextual part is covered by Walter's suggestion.
5 days ago
On Thursday, 18 May 2017 at 12:56:31 UTC, Meta wrote:
> On Thursday, 18 May 2017 at 03:59:49 UTC, MysticZach wrote:
>> On Thursday, 18 May 2017 at 02:13:52 UTC, Meta wrote:
>>> On Wednesday, 17 May 2017 at 11:46:07 UTC, Meta wrote:
>>>> I'll add this option to the DIP.
>>>
>>> https://github.com/dlang/DIPs/pull/65
>>
>> I think ( http://forum.dlang.org/post/kybywnscisxpebezwyvk@forum.dlang.org ) represents yet another distinct option. i.e. continue to allow `body`, but make it optional, that is, you can simply omit it if you want, while also allowing it as an identifier.
>
> This is pretty much the same as option 2. The short-term contextual part is covered by Walter's suggestion.

No it's not. What MysticZach suggests, and what I suggested even earlier [0] is to make 'body' contextual and optional which is very different than replacing it with another keyword. The main difference is that it would make code that uses contracts cleaner and there would be no breakage. In contrast, deprecating 'body' is a breaking change.

IMO, option 2 and variations of it are *the worst* way forward.

[0]: http://forum.dlang.org/post/pmldhzgcpuoydllfrbei@forum.dlang.org
5 days ago
On Thursday, 18 May 2017 at 13:06:38 UTC, Petar Kirov [ZombineDev] wrote:
> On Thursday, 18 May 2017 at 12:56:31 UTC, Meta wrote:
>> This is pretty much the same as option 2. The short-term contextual part is covered by Walter's suggestion.
>
> No it's not. What MysticZach suggests, and what I suggested even earlier [0] is to make 'body' contextual and optional which is very different than replacing it with another keyword. The main difference is that it would make code that uses contracts cleaner and there would be no breakage. In contrast, deprecating 'body' is a breaking change.
>
> IMO, option 2 and variations of it are *the worst* way forward.
>
> [0]: http://forum.dlang.org/post/pmldhzgcpuoydllfrbei@forum.dlang.org

Yes. Our proposal is actually a variation on option 3. Added to the current DIP, it would read: "Option 6: allow omitting `body`, and also allow it as an identifier"

The two known downsides to this option so far are:

1. Different code will continue include the keyword version of `body` or not based on arbitrary programmer preferences.

2. Syntax highlighters that choose to highlight the word `body` will have to be modified to detect its different uses.

Note that in the case of 1., strong preferences have been stated here for both styles, thus increasing the feeling that it's okay to allow both. Also note that the opposition to any inclusion of contextual keywords on principle is largely countered by the fact that there is no danger of semantic ambiguity between the two uses of `body` here.

5 hours ago
On Wednesday, 17 May 2017 at 01:01:29 UTC, MysticZach wrote:
> I think there are several issues at hand, and they need to be dealt with individually:
>
> 1. `body` is a very useful identifier. It would be nice to have it available.
>
> 2. Contract syntax is too verbose.
>
> 3. a. Some people think code looks better with a keyword, e.g. `body`, `do`, etc. distinguishing the function from the contracts.
>
> 3. b. Other people think that such a keyword is unnecessarily redundant and does not justify its own existence.
>
> I think the thread will be more productive if the posters commit to answering just one of these issues, and reserve other issues for other threads. As the DIP in question is directly meant to address issue #1, it makes sense to try to solve that problem and only that problem here.

I made a related DIP discussing issue 2, contract syntax is too verbose. The thread for discussing that one is here:

http://forum.dlang.org/post/tuzdqqpcoguatepgxupq@forum.dlang.org
Next ›   Last »
1 2 3 4 5 6 7 8 9 10