August 16, 2014
On 08/16/2014 01:41 AM, ketmar via Digitalmars-d wrote:
> On Sat, 16 Aug 2014 01:31:42 +0200
> Timon Gehr via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
>> What is the problem? This passes DMD's parser.
> that is the problem: it shouldn't.

That's not what you said.

On 08/16/2014 12:21 AM, ketmar via Digitalmars-d wrote:
> and we'll find some more bugs there:
> ...
> so we can see that things like 'case n+=5:' should be allowed, while
> they are not.


> this has no sense, and it's easy to
> fix this in grammar itself.
>

There is nothing to be 'fixed'. The code is still rejected when it is analysed.
August 16, 2014
On Sat, 16 Aug 2014 02:20:27 +0200
Timon Gehr via Digitalmars-d <digitalmars-d@puremagic.com> wrote:

> >> What is the problem? This passes DMD's parser.
> > that is the problem: it shouldn't.
> That's not what you said.
that's what i mean. ok, i should write it clear.

> There is nothing to be 'fixed'. The code is still rejected when it is analysed.
there is no sense to accept such code in parser anyway, and it can be easily fixed in grammar.

ok, there is some sense with overloaded opAssign() and friends, but such code is awful and i believe that there is no sane reasons to allow such abomination.


August 18, 2014
Also two more errors in documentation:
1. One member of an anonymous enum
On page http://dlang.org/enum.html in "Manifest Constants" section there is an example of anonymous enum with a single member. But top rules on the same page don't have description of this case. Rules says that members are always enclosed with braces '{' and '}'. I think documentation must be updated.

2. Functions with "in" and "out" contracts
On function declaration page http://dlang.org/function.html there is mention of "in" keyword with some code block and "out" block with some arguments and code block. This documentation page doesn't describe what this "in" and "out" sections mean. It's impossible to understand that these blocks are called "contracts". I downloaded DMD sources to find test where this contracts are described. I this this page need a link to "Contracts" documentation (http://dlang.org/contracts.html).
August 18, 2014
On Monday, 18 August 2014 at 09:36:39 UTC, Sergey Kozyr wrote:
> Also two more errors in documentation:
> ...

Check the list of bugs that I've already filed here: https://issues.dlang.org/show_bug.cgi?id=10233. If you find one that hasn't been filed, file it and add "spec" to the "Keywords" field and "10233" to the "Blocks" field. I plan on updating or rewriting a lot of the language specification based on these issues, so any that you identify will help me make the specification more accurate.

August 18, 2014
On Monday, 18 August 2014 at 17:54:07 UTC, Brian Schott wrote:
> On Monday, 18 August 2014 at 09:36:39 UTC, Sergey Kozyr wrote:
>> Also two more errors in documentation:
>> ...
>
> Check the list of bugs that I've already filed here: https://issues.dlang.org/show_bug.cgi?id=10233. If you find one that hasn't been filed, file it and add "spec" to the "Keywords" field and "10233" to the "Blocks" field. I plan on updating or rewriting a lot of the language specification based on these issues, so any that you identify will help me make the specification more accurate.

I've created three issues in bug tracker: 13326, 13327, 13328.
As far as I can see these issues could be fixed with pull requests to github repository https://github.com/D-Programming-Language/dlang.org . Am I right?
August 20, 2014
One more documentation issue. I've took sample from http://dlang.org/template.html

> interface Addable(T)
> {
>     final R add(this R)(T t)
>     {
>         return cast(R)this;  // cast is necessary, but safe
>     }
> }
> 
> class List(T) : Addable!T
> {
>     List remove(T t)
>     {
>         return this;
>     }
> }
> 
> void main()
> {
>     auto list = new List!int;
>     list.add(1).remove(1);  // ok
> }

I want to pay attention at line 9:
> class List(T) : Addable!T

As ClassDeclaration rule (http://dlang.org/class.html#ClassDeclaration) says after ':' you can see list of base classes. But "BaseClassList" rule allows only Identifier separated with comma. But here we have TemplateInstance instead of Identifier.
This sample code is compiled by DMD2 compiler (but interface must be replaced with class previously). So I think specification must be updated in "SuperClass" and "Interface" rules.

> SuperClass:
>    Identifier
>    TemplateInstance
>
> Interface:
>    Identifier
>    TemplateInstance

Do you want me to create a bug under issue 10233?
August 20, 2014
One more thing in specification. "AutoDeclarationX" rule (http://dlang.org/declaration.html#AutoDeclarationX) seems broken.

> AutoDeclarationX:
>     Identifier = TemplateParameters Initializer
>     AutoDeclarationX , Identifier TemplateParameters = Initializer

In second line equal sign is between "Identifier" and "TemplateParameters". While in third line equal sign is between "TemplateParameters" and "Initializer". I think second line contains error.

Do you want me to create a bug at issues.dlang.org?
1 2
Next ›   Last »