DIP 1003 Formal Review

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Tue May 16 18:43:26 PDT 2017


On Wednesday, May 17, 2017 01:01:29 MysticZach via Digitalmars-d 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.

The issues are not completely separate, because one of the suggestions of
how to make the change with regards to body is to replace it with function.
So, while we don't need to decide to completely overhaul the syntax for
contracts, we do need to decide what we're going to do with the place where
body is used now - be it remove the need for body entirely, make it a
contextual keyword so that it's still used in contracts but is also usable
as an identifier, or replace it with another keyword such as function or do.

- Jonathan M Davis



More information about the Digitalmars-d mailing list