Thread overview
[spec] What's in a name?
May 20, 2019
Dibyendu Majumdar
May 21, 2019
Marco de Wild
May 21, 2019
Dibyendu Majumdar
May 21, 2019
Les De Ridder
May 21, 2019
Dibyendu Majumdar
May 21, 2019
Basile B.
May 21, 2019
Basile B.
May 20, 2019
Going back (at least) to Dennis Ritchie's C manual from 1975, it seems a convention to define what kind of things can be named in a language. Is there such a list for D?

May 21, 2019
On Monday, 20 May 2019 at 22:50:04 UTC, Dibyendu Majumdar wrote:
> Going back (at least) to Dennis Ritchie's C manual from 1975, it seems a convention to define what kind of things can be named in a language. Is there such a list for D?

Do you mean the style guide? https://dlang.org/dstyle.html
Or https://dlang.org/spec/lex.html ?
May 21, 2019
On Tuesday, 21 May 2019 at 04:08:13 UTC, Marco de Wild wrote:
> On Monday, 20 May 2019 at 22:50:04 UTC, Dibyendu Majumdar wrote:
>> Going back (at least) to Dennis Ritchie's C manual from 1975, it seems a convention to define what kind of things can be named in a language. Is there such a list for D?
>
> Do you mean the style guide? https://dlang.org/dstyle.html
> Or https://dlang.org/spec/lex.html ?

Neither.
May 21, 2019
On Tuesday, 21 May 2019 at 13:15:21 UTC, Dibyendu Majumdar wrote:
> On Tuesday, 21 May 2019 at 04:08:13 UTC, Marco de Wild wrote:
>> On Monday, 20 May 2019 at 22:50:04 UTC, Dibyendu Majumdar wrote:
>>> Going back (at least) to Dennis Ritchie's C manual from 1975, it seems a convention to define what kind of things can be named in a language. Is there such a list for D?
>>
>> Do you mean the style guide? https://dlang.org/dstyle.html
>> Or https://dlang.org/spec/lex.html ?
>
> Neither.

I'm not entirely sure what you're asking.
If you're trying to replicate the section from Dennis Ritchie's C
manual, you might want to look at 'VarDeclarations' in the grammar[1],
but I'm not sure such a section would be particularly useful.

[1] https://dlang.org/spec/grammar.html#VarDeclarations

May 21, 2019
On Monday, 20 May 2019 at 22:50:04 UTC, Dibyendu Majumdar wrote:
> Going back (at least) to Dennis Ritchie's C manual from 1975, it seems a convention to define what kind of things can be named in a language. Is there such a list for D?

Everything that contains the "Identifier" rule falls into the "can be named" category.
May 21, 2019
On Tuesday, 21 May 2019 at 15:35:18 UTC, Les De Ridder wrote:
> I'm not entirely sure what you're asking.

I guess I don't know how better to put it: I wanted to know what are the things that can be named in a D program.

> If you're trying to replicate the section from Dennis Ritchie's C
> manual, you might want to look at 'VarDeclarations' in the grammar[1],
> but I'm not sure such a section would be particularly useful.
>
> [1] https://dlang.org/spec/grammar.html#VarDeclarations

Firstly it is not about replicating something from the C manual. A fundamental aspect of any programming language is what things you can give a name to, and then the scope, and lifetime of named objects.

A module has a name, so looking at var declarations alone in not sufficient.

But I get it: there is no such list.
May 21, 2019
On Tuesday, 21 May 2019 at 17:15:42 UTC, Dibyendu Majumdar wrote:
> On Tuesday, 21 May 2019 at 15:35:18 UTC, Les De Ridder wrote:
> A module has a name, so looking at var declarations alone in not sufficient.

I told you. All rules containing the Identifier sub rule.
I just add 'and that is not an Expression or a Statement' (i.e only DeclDefs)