www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Paging Walter Bright: Contextual Keywords

reply Meta <jared771 gmail.com> writes:
Hello Walter,

I'm currently working on a DIP on the topic of either removing or 
replacing the `body` keyword in D's contract programming syntax. 
I've found that the best possible way to do this, without any 
breaking changes to user code, would be to turn `body` into a 
contextual keyword. I know that you've expressed your opposition 
to contextual keywords in the past, but it's hard to find any 
concrete (and more important, recent) posts stating it clearly 
(as well as your reasons), other than this one: 
http://forum.dlang.org/post/npsp8a$mv4$1 digitalmars.com

Can I ask you to give a definitive statement on contextual 
keywords in D (whether support, oppose, or are neutral to their 
addition), as well as a bit of rationale? This will then give me 
something official to link to in the DIP (and we will able to 
update the D FAQ with it as well).

Link to DIP: https://github.com/dlang/DIPs/pull/48
Nov 06 2016
parent reply deadalnix <deadalnix gmail.com> writes:
On Monday, 7 November 2016 at 03:33:47 UTC, Meta wrote:
 Hello Walter,

 I'm currently working on a DIP on the topic of either removing 
 or replacing the `body` keyword in D's contract programming 
 syntax. I've found that the best possible way to do this, 
 without any breaking changes to user code, would be to turn 
 `body` into a contextual keyword. I know that you've expressed 
 your opposition to contextual keywords in the past, but it's 
 hard to find any concrete (and more important, recent) posts 
 stating it clearly (as well as your reasons), other than this 
 one: http://forum.dlang.org/post/npsp8a$mv4$1 digitalmars.com
Why not make it a plain identifier ? We give identifier special meaning in various places, like scope(exit).
Nov 06 2016
parent reply Stefan Koch <uplink.coder googlemail.com> writes:
On Monday, 7 November 2016 at 04:32:52 UTC, deadalnix wrote:
 On Monday, 7 November 2016 at 03:33:47 UTC, Meta wrote:
 Hello Walter,

 I'm currently working on a DIP on the topic of either removing 
 or replacing the `body` keyword in D's contract programming 
 syntax. I've found that the best possible way to do this, 
 without any breaking changes to user code, would be to turn 
 `body` into a contextual keyword. I know that you've expressed 
 your opposition to contextual keywords in the past, but it's 
 hard to find any concrete (and more important, recent) posts 
 stating it clearly (as well as your reasons), other than this 
 one: http://forum.dlang.org/post/npsp8a$mv4$1 digitalmars.com
Why not make it a plain identifier ? We give identifier special meaning in various places, like scope(exit).
If I am not mistaken we do not need body ay at all.
Nov 06 2016
parent reply Dicebot <public dicebot.lv> writes:
 protected-headers="v1"
From: Dicebot <public dicebot.lv>
Newsgroups: d,i,g,i,t,a,l,m,a,r,s,.,D
Subject: Re: Paging Walter Bright: Contextual Keywords
References: <ckgmowedszvevzhvsnih forum.dlang.org>
 <nbsocfsjfcsnkxrvyavh forum.dlang.org> <ayffqkcdpyzlkbmdtahk forum.dlang.org>
In-Reply-To: <ayffqkcdpyzlkbmdtahk forum.dlang.org>

--c42qSUQScaJkCMOXXNlKTbvm637SxDH9a
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 11/07/2016 08:40 AM, Stefan Koch wrote:
 Why not make it a plain identifier ? We give identifier special
 meaning in various places, like scope(exit).
=20 If I am not mistaken we do not need body ay at all.
It is matter of how smooth deprecation phase is. Completely removal of `body` is OK long-term but that would mean one have to wait several years of deprecation phase before it can be used as identifier in user code. Making it deprecated _and_ contextual results in immediate availability. --c42qSUQScaJkCMOXXNlKTbvm637SxDH9a--
Nov 07 2016
parent reply Timon Gehr <timon.gehr gmx.ch> writes:
On 07.11.2016 12:38, Dicebot wrote:
 On 11/07/2016 08:40 AM, Stefan Koch wrote:
 Why not make it a plain identifier ? We give identifier special
 meaning in various places, like scope(exit).
If I am not mistaken we do not need body ay at all.
It is matter of how smooth deprecation phase is. Completely removal of `body` is OK long-term but that would mean one have to wait several years of deprecation phase before it can be used as identifier in user code. Making it deprecated _and_ contextual results in immediate availability.
What's the new syntax for contracts if body is removed?
Nov 07 2016
parent reply Dicebot <public dicebot.lv> writes:
On Monday, 7 November 2016 at 13:24:20 UTC, Timon Gehr wrote:
 On 07.11.2016 12:38, Dicebot wrote:
 On 11/07/2016 08:40 AM, Stefan Koch wrote:
 Why not make it a plain identifier ? We give identifier 
 special
 meaning in various places, like scope(exit).
If I am not mistaken we do not need body ay at all.
It is matter of how smooth deprecation phase is. Completely removal of `body` is OK long-term but that would mean one have to wait several years of deprecation phase before it can be used as identifier in user code. Making it deprecated _and_ contextual results in immediate availability.
What's the new syntax for contracts if body is removed?
Currently https://github.com/dlang/DIPs/pull/48 (https://github.com/MetaLang/DIPs/blob/8f3ac3a133cd1f9095dd992f38ae377f5987c a4/DIPs/DIP1003.md) proposes either use `function` keyword instead of `body` or simply omit it with two blocks following each other.
Nov 07 2016
parent Meta <jared771 gmail.com> writes:
I'm not sure if there's a point as Walter exclusively uses a mail 
client, but I'm bumping this back to the first page anyway.
Nov 09 2016