digitalmars.D - DIP 1007 - keywords as identifiers with an escape symbol - feedback
- Basile B. (10/10) Dec 19 2016 I know that there is other hot stuffs since a few days but this
- Stefan Koch (2/12) Dec 19 2016 If you are prepending # you might as well prepend _
- default0 (4/19) Dec 19 2016 That doesn't solve the complications this introduces if you want
- Basile B. (6/26) Dec 19 2016 Yes it does. See my answer to Stefan.
- Basile B. (7/16) Dec 21 2016 Actually the second example didn't work. I've updated the DIP and
- Chris Wright (13/19) Dec 21 2016 Sure, but then we could argue that there should be a way to make any
- Basile B. (2/4) Dec 22 2016 RIP DIP 1007. It was too simple to be true.
- Basile B. (16/22) Dec 22 2016 I see something to do to continue the DIP
- Basile B. (4/19) Dec 22 2016 no...it's dead, obviously whatever is the amount of #, they'll be
- Piotrek (11/12) Dec 22 2016 This was worth trying anyway. Especially for the "body" keyword.
- Chris Wright (5/8) Dec 22 2016 If it's changed to `# identifier` instead of `# keyword`, you can
- Andrei Alexandrescu (2/6) Dec 22 2016 If that's the case please mark it as "Retired". -- Andrei
- Basile B. (2/4) Dec 22 2016 http://imgur.com/NHe6k2p
- Basile B. (6/21) Dec 19 2016 No, because # is not an identifier char while _ is.
- Basile B. (6/13) Dec 19 2016 issue for the form of the DIP:
I know that there is other hot stuffs since a few days but this is a really simple DIP, that has no effect on the grammar and no effect on the semantic. It was drafted after the announce of DIP 1003 last week. During a discussion I've proposed to take a radically different approach. This approach is DIP 1007. The DIP: https://github.com/dlang/DIPs/pull/52 The implementation: https://github.com/dlang/dmd/pull/6324 p.s: about DIP methodology it's not clearly explained when & how a manager is introduced, apologies if this topic should be opened by someone else !
Dec 19 2016
On Monday, 19 December 2016 at 08:14:44 UTC, Basile B. wrote:I know that there is other hot stuffs since a few days but this is a really simple DIP, that has no effect on the grammar and no effect on the semantic. It was drafted after the announce of DIP 1003 last week. During a discussion I've proposed to take a radically different approach. This approach is DIP 1007. The DIP: https://github.com/dlang/DIPs/pull/52 The implementation: https://github.com/dlang/dmd/pull/6324 p.s: about DIP methodology it's not clearly explained when & how a manager is introduced, apologies if this topic should be opened by someone else !
Dec 19 2016
On Monday, 19 December 2016 at 08:30:07 UTC, Stefan Koch wrote:On Monday, 19 December 2016 at 08:14:44 UTC, Basile B. wrote:That doesn't solve the complications this introduces if you want to serialize to/from members with these names, as seen in the Examples section of the DIP.I know that there is other hot stuffs since a few days but this is a really simple DIP, that has no effect on the grammar and no effect on the semantic. It was drafted after the announce of DIP 1003 last week. During a discussion I've proposed to take a radically different approach. This approach is DIP 1007. The DIP: https://github.com/dlang/DIPs/pull/52 The implementation: https://github.com/dlang/dmd/pull/6324 p.s: about DIP methodology it's not clearly explained when & how a manager is introduced, apologies if this topic should be opened by someone else !
Dec 19 2016
On Monday, 19 December 2016 at 09:58:28 UTC, default0 wrote:On Monday, 19 December 2016 at 08:30:07 UTC, Stefan Koch wrote:Yes it does. See my answer to Stefan. In the code you write #delegate, but the identifier is, as known by the compiler, just "delegate". See the unit tests that passed already several times: https://github.com/dlang/dmd/pull/6324/files#diff-60ac3d231ebb78f79477cc2520a37200R19On Monday, 19 December 2016 at 08:14:44 UTC, Basile B. wrote:That doesn't solve the complications this introduces if you want to serialize to/from members with these names, as seen in the Examples section of the DIP.I know that there is other hot stuffs since a few days but this is a really simple DIP, that has no effect on the grammar and no effect on the semantic. It was drafted after the announce of DIP 1003 last week. During a discussion I've proposed to take a radically different approach. This approach is DIP 1007. The DIP: https://github.com/dlang/DIPs/pull/52 The implementation: https://github.com/dlang/dmd/pull/6324 p.s: about DIP methodology it's not clearly explained when & how a manager is introduced, apologies if this topic should be opened by someone else !
Dec 19 2016
On Monday, 19 December 2016 at 10:28:31 UTC, Basile B. wrote:On Monday, 19 December 2016 at 09:58:28 UTC, default0 wrote:Actually the second example didn't work. I've updated the DIP and added (and this time tested...) an archaic serialization system that shows more clearly what's the point. It should be quite straightforward to test. The lexer is rarely modified so I doubt there's ever be any conflict when rebasing to master.That doesn't solve the complications this introduces if you want to serialize to/from members with these names, as seen in the Examples section of the DIP.Yes it does. See my answer to Stefan. In the code you write #delegate, but the identifier is, as known by the compiler, just "delegate". See the unit tests that passed already several times: https://github.com/dlang/dmd/pull/6324/files#diff-60ac3d231ebb78f79477cc2520a37200R19
Dec 21 2016
On Mon, 19 Dec 2016 09:58:28 +0000, default0 wrote:On Monday, 19 December 2016 at 08:30:07 UTC, Stefan Koch wrote:Sure, but then we could argue that there should be a way to make any sequence of characters an identifier. There are systems that expect serialized field names with hyphens, for instance. Or if I'm writing code to interoperate with a Cherokee system, I might need to produce JSON with Jsonizer does this the only way you can: you can use an attribute to specify the serialized name for a field. While we're talking about this, this proposal breaks any string mixin that mixes in an identifier detected with reflection. Address that There are usually ways around using string mixins, but we haven't even proposed starting a deprecation process for them.That doesn't solve the complications this introduces if you want to serialize to/from members with these names, as seen in the Examples section of the DIP.
Dec 21 2016
On Thursday, 22 December 2016 at 04:11:54 UTC, Chris Wright wrote:While we're talking about this, this proposal breaks any string mixin that mixes in an identifier detected with reflection.RIP DIP 1007. It was too simple to be true.
Dec 22 2016
On Thursday, 22 December 2016 at 10:11:19 UTC, Basile B. wrote:On Thursday, 22 December 2016 at 04:11:54 UTC, Chris Wright wrote:I see something to do to continue the DIP SpecialTokenSequence: SpecialTokenSequencePrefix line IntegerLiteral EndOfLine SpecialTokenSequencePrefix line IntegerLiteral Filespec EndOfLine SpecialTokenSequencePrefixes Keyword SpecialTokenSequencePrefix: SpecialTokenSequencePrefixes: SpecialTokenSequencePrefix SpecialTokenSequencePrefixes keyword. Mixins cannot introspect themselves so basically 'pound pound' will always work. And this is still a simple thing that can be done in the lexer.While we're talking about this, this proposal breaks any string mixin that mixes in an identifier detected with reflection.RIP DIP 1007. It was too simple to be true.
Dec 22 2016
On Thursday, 22 December 2016 at 10:35:23 UTC, Basile B. wrote:On Thursday, 22 December 2016 at 10:11:19 UTC, Basile B. wrote:removed when the token is patched for the first time. This just doesn't work with mixins. End of story.On Thursday, 22 December 2016 at 04:11:54 UTC, Chris Wright wrote:I see something to do to continue the DIP [...] keyword. Mixins cannot introspect themselves so basically 'pound pound' will always work. And this is still a simple thing that can be done in the lexer.While we're talking about this, this proposal breaks any string mixin that mixes in an identifier detected with reflection.RIP DIP 1007. It was too simple to be true.
Dec 22 2016
On Thursday, 22 December 2016 at 10:47:37 UTC, Basile B. wrote:End of story.This was worth trying anyway. Especially for the "body" keyword. Personally I don't need it anymore, but it is substantial issue for newcomers wanting to use it badly for web/sci dev. This is probably the most controversial keyword. It is a big pain for a pedant person but on the other hand it is really a non-issue among other programming problems. I bet this case will be brought up continuously. So be prepared. It could have been called something like "fbody" or "def". ;) Cheers, Piotrek
Dec 22 2016
On Thu, 22 Dec 2016 10:47:37 +0000, Basile B. wrote:removed when the token is patched for the first time. This just doesn't work with mixins. End of story.defensively add an octothorp to any identifier you mix in. However, that would fail if someone has an identifier named `line`. And in any case it breaks existing string mixins.
Dec 22 2016
On 12/22/2016 05:11 AM, Basile B. wrote:On Thursday, 22 December 2016 at 04:11:54 UTC, Chris Wright wrote:If that's the case please mark it as "Retired". -- AndreiWhile we're talking about this, this proposal breaks any string mixin that mixes in an identifier detected with reflection.RIP DIP 1007. It was too simple to be true.
Dec 22 2016
On Thursday, 22 December 2016 at 04:11:54 UTC, Chris Wright wrote:While we're talking about this, this proposal breaks any string mixin that mixes in an identifier detected with reflection.http://imgur.com/NHe6k2p
Dec 22 2016
On Monday, 19 December 2016 at 08:30:07 UTC, Stefan Koch wrote:On Monday, 19 December 2016 at 08:14:44 UTC, Basile B. wrote:* _delegate is 1 token (_delegate) * #delegate Then you can determine that the intention is to have "delegate" as identifier, while with _ you cant.I know that there is other hot stuffs since a few days but this is a really simple DIP, that has no effect on the grammar and no effect on the semantic. It was drafted after the announce of DIP 1003 last week. During a discussion I've proposed to take a radically different approach. This approach is DIP 1007. The DIP: https://github.com/dlang/DIPs/pull/52 The implementation: https://github.com/dlang/dmd/pull/6324 p.s: about DIP methodology it's not clearly explained when & how a manager is introduced, apologies if this topic should be opened by someone else !
Dec 19 2016
On Monday, 19 December 2016 at 10:24:08 UTC, Basile B. wrote:On Monday, 19 December 2016 at 08:30:07 UTC, Stefan Koch wrote:issue for the form of the DIP: "must explain what is an identifier character and what is not". I'm a bit surprised that the two first comments are related to char. I must be be biased by the work on CE highlighter.* _delegate is 1 token (_delegate) * #delegate Then you can determine that the intention is to have "delegate" as identifier, while with _ you cant.
Dec 19 2016