www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5803] New: Inaccuracies in the specification of the grammar

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5803

           Summary: Inaccuracies in the specification of the grammar
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody puremagic.com
        ReportedBy: r.sagitario gmx.de



PDT ---
The language definition has a number of smaller and larger inaccuracies. You
can find a comparison chart of the grammar in the docs and a grammar used to
parse the public test suite and the runtime library (minus some deprecated
features) here:

http://www.dsource.org/projects/visuald/wiki/GrammarComparison

This is with respect to the state of the documentation in December 2010, so a
few additions and modifications have already made it into the current
documentation.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 30 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5803


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au



One fairly big mistake in there: there seems to be confusion between
StructLiteral and StructStaticInitializer. 

Foo z = { x: 7, y: 56};
is a struct static initializer, not a struct literal.
Foo(7, 56); is a struct literal.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 31 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5803


Trass3r <mrmocool gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrmocool gmx.de



I'm already working on folding some of the changes I agree with into my github
fork   https://github.com/Trass3r/d-programming-language.org

Will push soon.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 31 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5803




PDT ---

 One fairly big mistake in there: there seems to be confusion between
 StructLiteral and StructStaticInitializer. 
Maybe I oversimplified here, but I was hoping for a generalization of the array/struct initializer and literals. IIRC the StructStaticInitializer is said to be deprecated anyway, but it might actually be possible to interpret it as a literal inside expressions with implicite conversions, similar how dmd deals with arrays, because the parser cannot decide which type of array a variable is declared as until the semantic pass. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 31 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5803






 One fairly big mistake in there: there seems to be confusion between
 StructLiteral and StructStaticInitializer. 
Maybe I oversimplified here, but I was hoping for a generalization of the array/struct initializer and literals. IIRC the StructStaticInitializer is said to be deprecated anyway, but it might actually be possible to interpret it as a literal inside expressions with implicite conversions, similar how dmd deals with arrays, because the parser cannot decide which type of array a variable is declared as until the semantic pass.
They have very different semantics. Given only a StructLiteral, you can always work out what type it is. But with a static initializer, you know nothing. This might be the only thing in the language like that. It's not implicit conversion, they don't have an initial type to convert from. So auto x = StructLiteral(); works, but auto x = structStaticInitializer cannot. Consequently, you can use a struct literal almost anywhere you can use a struct variable. I've tried to get them deprecated but I don't know if that will happen. They are one of the most complicated things in the language, and the implementation is *full* of bugs. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Mar 31 2011