On 25/09/2017 6:28 AM, WhatMeForget wrote:

This is taken exactly from the traits documentation.

------------------------------------------------

25 Traits

25.21 identifier

Takes one argument, a symbol. Returns the identifier for that symbol as a string literal.

------------------------------------------------


There are no examples. My naive brain keeps thinking that a symbol and an identifier are the same things.  Can someone give me good definitions of "symbol" and "identifier".   And maybe an example if it is not too much trouble.

```D
void main() {}

pragma(msg, __traits(identifier, main));
pragma(msg, __traits(identifier, Foo));
pragma(msg, __traits(identifier, Foo.func));

struct Foo {
        void func();    
}
```

```
main
Foo
func
```

Reply via email to