Re: Capturing Caller UDAs as CT Template Function Parameters

2015-05-18 Thread via Digitalmars-d-learn
On Monday, 18 May 2015 at 21:00:20 UTC, Per Nordlöw wrote: Is this doable somehow? To clarify: Instead of *string* `__FUNCTION__` I instead want a reference to the *symbol* of the calling function scope typically passed as an alias parameter. We could of course always solve it with a mixin

Capturing Caller UDAs as CT Template Function Parameters

2015-05-18 Thread via Digitalmars-d-learn
As a follow up to the most http://forum.dlang.org/thread/miri9k$2p5$1...@digitalmars.com I'm now very much interested in finding a way to make yield() capture the UDAs of its caller. That is instead of void yield(T)(ref T value) I want it to get a hold of the UDAs of the calling function

Re: Capturing Caller UDAs as CT Template Function Parameters

2015-05-18 Thread anonymous via Digitalmars-d-learn
On Monday, 18 May 2015 at 21:35:44 UTC, Per Nordlöw wrote: void yield(T)(ref T value) { mixin(alias caller = ~ caller ~ ;); } doesn't work across module boundaries not even for `__PRETTY_FUNCTION__`. Do we need need to fix the compiler, Walter?! ;) You have to import

Re: Capturing Caller UDAs as CT Template Function Parameters

2015-05-18 Thread via Digitalmars-d-learn
On Monday, 18 May 2015 at 21:04:19 UTC, Per Nordlöw wrote: To clarify: Instead of *string* `__FUNCTION__` I instead want a reference to the *symbol* of the calling function scope typically passed as an alias parameter. We could of course always solve it with a mixin but that is 6+1 characters

Re: Capturing Caller UDAs as CT Template Function Parameters

2015-05-18 Thread via Digitalmars-d-learn
On Monday, 18 May 2015 at 21:30:23 UTC, Per Nordlöw wrote: On Monday, 18 May 2015 at 21:04:19 UTC, Per Nordlöw wrote: To clarify: Instead of *string* `__FUNCTION__` I instead want a reference to the *symbol* of the calling function scope typically passed as an alias parameter. We could of