Thread overview | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
July 14, 2016 [Issue 16283] [Modules] | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16283 Steven Schveighoffer <schveiguy@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |spec URL|http://dlang.org/ |http://dlang.org/spec/modul | |e.html CC| |schveiguy@yahoo.com Severity|enhancement |normal --- Comment #1 from Steven Schveighoffer <schveiguy@yahoo.com> --- I don't think this is an enhancement, it's a bug. I'd guess that allocators also aren't allowed. It appears that the module DeclDef grammar is a cut-and-paste from classes. -- |
July 14, 2016 [Issue 16283] [Modules] | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16283 --- Comment #2 from Steven Schveighoffer <schveiguy@yahoo.com> --- (In reply to Steven Schveighoffer from comment #1) > I don't think this is an enhancement, it's a bug. Clarification: it's not a bug in the compiler, it's a bug in the spec! -- |
July 14, 2016 [Issue 16283] [Modules] | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16283 --- Comment #3 from Henry Block <webhenryblock@gmail.com> --- (In reply to Steven Schveighoffer from comment #1) > I don't think this is an enhancement, it's a bug. I suppose that's a bug in the Report Bug button on the spec site then! :-) -- |
July 14, 2016 [Issue 16283] [Modules] | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16283 --- Comment #4 from Henry Block <webhenryblock@gmail.com> --- To be honest, I might have opened a can of worms here. The spec also suggestion you can put abstract bool x; at module scope in a D file, which isn't quite right :-) I suppose I was reading it a bit to literally. I'll leave this ticket open, but now that I'm a page further into reading about D, this looks like quite a large task. -- |
July 15, 2016 [Issue 16283] [Modules] | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16283 --- Comment #5 from Sobirari Muhomori <dfj1esp02@sneakemail.com> --- Not sure if this is a bug: what's syntactically valid is not necessarily semantically valid, and you're asking for a context-sensitive and bloated grammar, you'll have to duplicate a lot of rules. -- |
July 15, 2016 [Issue 16283] [Modules] | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16283 --- Comment #6 from Sobirari Muhomori <dfj1esp02@sneakemail.com> --- Imagine a grammar that expresses this rule: "can't refer to `super` in a struct method that is not nested in a class method". -- |
July 15, 2016 [Issue 16283] [Modules] | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16283 Henry Block <webhenryblock@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #7 from Henry Block <webhenryblock@gmail.com> --- (In reply to Sobirari Muhomori from comment #6) > Imagine a grammar that expresses this rule: "can't refer to `super` in a struct method that is not nested in a class method". Haha, yes I see. Sorry, I see now that I'm misunderstanding the grammar's purpose. -- |
July 18, 2016 [Issue 16283] [Modules] | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16283 Steven Schveighoffer <schveiguy@yahoo.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED CC| |briancschott@gmail.com Resolution|INVALID |--- --- Comment #8 from Steven Schveighoffer <schveiguy@yahoo.com> --- Sorry, but that's lazy. We can easily express the grammar that a module cannot have a constructor (in contrast to your analogy, there is a separate module grammar from classes, so we have a perfect spot to outlaw it). We put up with a lot of grammar inaccuracies that result in simply ignored attributes. We can do better. Even if the actual code treats the grammar for modules and classes the same, the documentation can reflect the actual result. Right now, it looks like constructors are allowed. CC grammar guru Brian -- |
July 19, 2016 [Issue 16283] [Modules] | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16283 --- Comment #9 from Sobirari Muhomori <dfj1esp02@sneakemail.com> --- (In reply to Steven Schveighoffer from comment #8) > We put up with a lot of grammar inaccuracies that result in simply ignored attributes. We can do better. You mean you want to disallow this in grammar? --- pure: int n; --- -- |
July 19, 2016 [Issue 16283] [Modules] | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=16283 --- Comment #10 from Steven Schveighoffer <schveiguy@yahoo.com> --- (In reply to Sobirari Muhomori from comment #9) > (In reply to Steven Schveighoffer from comment #8) > > We put up with a lot of grammar inaccuracies that result in simply ignored attributes. We can do better. > > You mean you want to disallow this in grammar? > --- > pure: > int n; > --- No, I mean that the grammar allows such things, and they are nonsense (but I agree we shouldn't remove it). Here, we have something that is plainly wrong in all cases, but the grammar says it's allowed. We can't just say "well grammar can't do everything", when clearly it can reflect this case. -- |
Copyright © 1999-2021 by the D Language Foundation