DIP 1003 Formal Review

Random D user via Digitalmars-d digitalmars-d at puremagic.com
Tue May 16 10:59:19 PDT 2017


On Sunday, 14 May 2017 at 15:39:12 UTC, Walter Bright wrote:
> On 5/12/2017 9:17 AM, Mike Parker wrote:
>> The first stage of the formal review for DIP 1003 [1], "Remove 
>> body as a
>> Keyword", is now underway.
>
> A combination of Options 1 and 2:
>
> 1. Introduce 'function' as an alternative to 'body'.

How about using some other keyword like, with, else, scope or do, 
for example.
Would they read better than 'function' (i.e. function with vs. 
function function vs. function body)? Let's experiment a bit.

int foo()
in
{
}
out
{
}
with
{
   bar();
}

-- or

int foo()
in
{
}
out
{
}
else  // I guess this could be too confusing with template 
constraint? See below.
{
   bar();
}

int foo(T)() if(cond)
in
{
}
out
{
}
else
{
}

-- or

int foo()
in
{
}
out
{
}
scope
{
   bar();
}

-- or

int foo()
in
{
}
out
{
}
do
{
   bar();
}


More information about the Digitalmars-d mailing list