www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - D grammar is Wild

reply =?UTF-8?B?THXDrXM=?= Marques <luis luismarques.eu> writes:
There's lots of stuff I don't understand in the D grammar, or I 
only understand after a very significant effort. What's, say, 
this stuff with `Wild: Ng`?

https://dlang.org/spec/grammar.html#Wild

Shouldn't the meaning of the bold be specified? D could really 
use a proper spec.
Feb 14
parent reply Stefan Koch <uplink.coder googlemail.com> writes:
On Thursday, 14 February 2019 at 22:12:22 UTC, Luís Marques wrote:
 There's lots of stuff I don't understand in the D grammar, or I 
 only understand after a very significant effort. What's, say, 
 this stuff with `Wild: Ng`?

 https://dlang.org/spec/grammar.html#Wild

 Shouldn't the meaning of the bold be specified? D could really 
 use a proper spec.
Wild stands for wildcard, an is what people know as `inout`. I agree though that it should be renamed.
Feb 14
parent reply =?UTF-8?B?THXDrXM=?= Marques <luis luismarques.eu> writes:
On Thursday, 14 February 2019 at 22:14:03 UTC, Stefan Koch wrote:
 Wild stands for wildcard
Yeah, that part I had kinda guessed. What's the Ng?
Feb 14
parent reply Adam D. Ruppe <destructionator gmail.com> writes:
On Thursday, 14 February 2019 at 22:18:43 UTC, Luís Marques wrote:
 Yeah, that part I had kinda guessed. What's the Ng?
This section specifies name mangling. Ng is what goes into the mangled name for the inout() type constructor.
Feb 14
parent =?UTF-8?B?THXDrXM=?= Marques <luis luismarques.eu> writes:
On Thursday, 14 February 2019 at 22:22:51 UTC, Adam D. Ruppe 
wrote:
 This section specifies name mangling. Ng is what goes into the 
 mangled name for the inout() type constructor.
That's easy to overlook. The grammar is big enough that I need to search the web page for occurrences of productions, to try to make sense of it. Then things like "Type" appear but it's not actually related to the normal grammar, it's the ABI stuff. I mean, other than being specified in the form of a grammar, it doesn't really have any relation to the regular D grammar, does it? (Honest question, not a rhetorical one). I would argue it should be moved to its own page, to lessen the confusion.
Feb 14