Can I rely on format returned by fullyQualifiedName?

Mike Parker aldacron at gmail.com
Sat Apr 24 04:09:15 UTC 2021


On Saturday, 24 April 2021 at 03:40:20 UTC, Jack wrote:
> Can I rely on this format from fullyQualifiedName? for example, 
> let's say I do:
>
> ```d
> enum s = fullyQualifiedName!f.split;
> ```
>
> where f is a function member of a class. Can I realy that s[0] 
> is the module name, s[1] is the class name and s[2] the functio 
> name? is this standard or can the compile change that? I've 
> tested on dmd, does ldc or gdc do something different?
>


You can rely on the order, but you cannot expect any of the names 
to be at a specific index. The FQN includes the symbol's entire 
hierarchy. So you could have one or more package names in front 
of the module name. Essentially:

{all.package.names.}moduleName.{struct/class/functionName}.symbolName


More information about the Digitalmars-d-learn mailing list