digitalmars.D.learn - since when was this valid syntax?
- Ellery Newcomer (1/1) Sep 08 2012 alias enum int e;
- Timon Gehr (6/7) Sep 08 2012 It is valid according to the grammar and DMD ignores meaningless attribu...
- bearophile (6/8) Sep 08 2012 Do you know why? Is it just a unfinished part of dmd, or Walter
- Timon Gehr (7/14) Sep 08 2012 Jonathan would say he has more important things to do.
- Jonathan M Davis (16/17) Sep 08 2012 If someone else did it and had good enough arguments why the change shou...
- Chris Cain (2/7) Sep 08 2012 Time to hold an obfuscated D contest!
- Era Scarecrow (18/19) Sep 08 2012 Hmmm... A little more difficult compared to C, since you don't
- Maxim Fomin (2/11) Sep 08 2012 How dmd's parser is written if it allows such things?
- Timon Gehr (3/16) Sep 08 2012 It's the grammar that allows this. Every parser that follows the grammar...
- Maxim Fomin (2/24) Sep 08 2012 Where is this grammar been defined? It looks more like a bug.
- Ellery Newcomer (2/5) Sep 09 2012 I don't believe you. Show me the derivation.
- Timon Gehr (4/10) Sep 10 2012 The grammar as shown on dlang.org indeed seems not to allow this, but
On 09/08/2012 04:11 PM, Ellery Newcomer wrote:alias enum int e;It is valid according to the grammar and DMD ignores meaningless attributes. scope shared disable trusted package final override deprecated extern __gshared synchronized pure nothrow ref static abstract immutable alias auto final override deprecated extern __gshared synchronized enum pure nothrow ref static abstract safe disable scope int e;
Sep 08 2012
Timon Gehr:It is valid according to the grammar and DMD ignores meaningless attributes.Do you know why? Is it just a unfinished part of dmd, or Walter believes this is an acceptable design for a compiler? In years I have never heard a comment from him on this bad situation. Bye, bearophile
Sep 08 2012
On 09/08/2012 06:44 PM, bearophile wrote:Timon Gehr:No reason.It is valid according to the grammar and DMD ignores meaningless attributes.Do you know why?Is it just a unfinished part of dmd, or Walter believes this is an acceptable design for a compiler?Jonathan would say he has more important things to do.In years I have never heard a comment from him on this bad situation.I'd design it differently as well. But this is the kind of thing that can be ignored indefinitely without hurting the programmer more than once. A similar issue is that the compiler actually won't detect clashing function overloads, leaving the error report up to the linker.
Sep 08 2012
On Saturday, September 08, 2012 20:25:38 Timon Gehr wrote:Jonathan would say he has more important things to do.If someone else did it and had good enough arguments why the change should be made, then it might make it in, but on top of Walter's time issues, this strikes me as the sort of thing that he normally lets linger and will probably disagree on with folks like Bearophile anyway (though I don't recall him ever taking a stand on the issue). David Simcha has argued in the past that it's actually better for generic code if it's left this way (since otherwise, conflicting attributes would mean that you'd have to use static ifs and the like to make the code valid). Walter may or may not agree with that and may or may not have other reasons why it should be the way that it is. But my guess is that he won't really see it as a problem. I do think that it would be nice if the situation were improved, but I also really doubt that it's going to be changed any time soon without some other than Walter doing it (and that's still assuming that they can convince Walter, which may or may not be easy). - Jonathan M Davis
Sep 08 2012
On Saturday, 8 September 2012 at 16:00:44 UTC, Timon Gehr wrote:scope shared disable trusted package final override deprecated extern __gshared synchronized pure nothrow ref static abstract immutable alias auto final override deprecated extern __gshared synchronized enum pure nothrow ref static abstract safe disable scope int e;Time to hold an obfuscated D contest!
Sep 08 2012
On Saturday, 8 September 2012 at 18:16:33 UTC, Chris Cain wrote:Time to hold an obfuscated D contest!Hmmm... A little more difficult compared to C, since you don't have the pre-processor. I recall TCC (Tiny C Compiler) was originally done in a obfuscation contest where he got the main features he wanted, then added until he ran out of space. After the contest he finished it as a full project. If we DID do it, what would the rules be? Depending on what they are it could be quite curious. Probably looking at 2-4k file; But not including whitespace you could make for an interesting look. I've seen quite often where they will make the source part of a visual display. Something like this. (Spam checker got stuck so link instead) http://dpaste.dzfl.pl/623336f9 I would think common imports of modules could be ignored from the source (but aliases afterwards would not. Anything commented (Not part of code) could be ignored. Hmmm...
Sep 08 2012
On Saturday, 8 September 2012 at 16:00:44 UTC, Timon Gehr wrote:On 09/08/2012 04:11 PM, Ellery Newcomer wrote:How dmd's parser is written if it allows such things?alias enum int e;It is valid according to the grammar and DMD ignores meaningless attributes. scope shared disable trusted package final override deprecated extern __gshared synchronized pure nothrow ref static abstract immutable alias auto final override deprecated extern __gshared synchronized enum pure nothrow ref static abstract safe disable scope int e;
Sep 08 2012
On 09/08/2012 09:25 PM, Maxim Fomin wrote:On Saturday, 8 September 2012 at 16:00:44 UTC, Timon Gehr wrote:It's the grammar that allows this. Every parser that follows the grammar would accept this.On 09/08/2012 04:11 PM, Ellery Newcomer wrote:How dmd's parser is written if it allows such things?alias enum int e;It is valid according to the grammar and DMD ignores meaningless attributes. scope shared disable trusted package final override deprecated extern __gshared synchronized pure nothrow ref static abstract immutable alias auto final override deprecated extern __gshared synchronized enum pure nothrow ref static abstract safe disable scope int e;
Sep 08 2012
2012/9/8 Timon Gehr <timon.gehr gmx.ch>:On 09/08/2012 09:25 PM, Maxim Fomin wrote:Where is this grammar been defined? It looks more like a bug.On Saturday, 8 September 2012 at 16:00:44 UTC, Timon Gehr wrote:It's the grammar that allows this. Every parser that follows the grammar would accept this.On 09/08/2012 04:11 PM, Ellery Newcomer wrote:How dmd's parser is written if it allows such things?alias enum int e;It is valid according to the grammar and DMD ignores meaningless attributes. scope shared disable trusted package final override deprecated extern __gshared synchronized pure nothrow ref static abstract immutable alias auto final override deprecated extern __gshared synchronized enum pure nothrow ref static abstract safe disable scope int e;
Sep 08 2012
On 09/08/2012 09:01 AM, Timon Gehr wrote:On 09/08/2012 04:11 PM, Ellery Newcomer wrote:I don't believe you. Show me the derivation.alias enum int e;It is valid according to the grammar
Sep 09 2012
On 09/10/2012 07:07 AM, Ellery Newcomer wrote:On 09/08/2012 09:01 AM, Timon Gehr wrote:The grammar as shown on dlang.org indeed seems not to allow this, but it is out of date as it also wouldn't allow alias extern(C) void function() fun;On 09/08/2012 04:11 PM, Ellery Newcomer wrote:I don't believe you. Show me the derivation.alias enum int e;It is valid according to the grammar
Sep 10 2012