Relative Aliases?

2017-05-28 Thread Jonathan Marler via Digitalmars-d
Is there a way to get an alias to a symbol relative to the current location? I'm looking for a general solution but I'll show an example to demonstrate one use case. Say we want to access the alias to the current function symbol. Obviously we can use the name of the current function, i.e.

Re: Relative Aliases?

2017-05-28 Thread Timon Gehr via Digitalmars-d
On 28.05.2017 17:04, Jonathan Marler wrote: Is there a way to get an alias to a symbol relative to the current location? I'm looking for a general solution but I'll show an example to demonstrate one use case. Say we want to access the alias to the current function symbol. ... __traits(pa

Re: Relative Aliases?

2017-05-28 Thread Jonathan Marler via Digitalmars-d
On Sunday, 28 May 2017 at 15:07:55 UTC, Timon Gehr wrote: On 28.05.2017 17:04, Jonathan Marler wrote: Is there a way to get an alias to a symbol relative to the current location? I'm looking for a general solution but I'll show an example to demonstrate one use case. Say we want to access th

Re: Relative Aliases?

2017-05-28 Thread tsbockman via Digitalmars-d
On Sunday, 28 May 2017 at 15:04:15 UTC, Jonathan Marler wrote: I'm also looking for the ability to get an alias to the current type, i.e. struct Foo { void foo() { alias TheAliasWeWant = Foo; alias TheAliasWeWant = currentTypeAlias(); // possible? } } For types, yo