digitalmars.D - Mixin function names
- Moinak Bhattacharrya (7/7) Jul 18 2017 Is it possible to mixin function names? IE something like this:
- Moinak Bhattacharrya (3/10) Jul 18 2017 Or, just something like this for any variable name.
- Adam D. Ruppe (7/8) Jul 18 2017 Only if you mixin the entire function.
- Timon Gehr (4/13) Jul 18 2017 The suggestion has been made, but there was no extensive discussion so f...
- Moinak Bhattacharrya (3/17) Jul 18 2017 That's the DIP for static foreach. Is there a separate DIP for
- Timon Gehr (2/24) Jul 18 2017 Not yet.
- Moinak Bhattacharrya (3/28) Jul 18 2017 :( I might look into making one, then. This feature would scratch
Is it possible to mixin function names? IE something like this: template strFunc(string s){ int mixin(s)(int a){ return a+1; } } If not, is something like this being looked at?
Jul 18 2017
On Tuesday, 18 July 2017 at 20:57:51 UTC, Moinak Bhattacharrya wrote:Is it possible to mixin function names? IE something like this: template strFunc(string s){ int mixin(s)(int a){ return a+1; } } If not, is something like this being looked at?Or, just something like this for any variable name.
Jul 18 2017
On Tuesday, 18 July 2017 at 20:57:51 UTC, Moinak Bhattacharrya wrote:Is it possible to mixin function names? IE something like this:Only if you mixin the entire function. But what I like to do is to write the function with some internal name, then do `mixin("alias "~ new_name ~ " = your_internal_name;");` so it is available as new name but still written normally.
Jul 18 2017
On 18.07.2017 22:57, Moinak Bhattacharrya wrote:Is it possible to mixin function names? IE something like this: template strFunc(string s){ int mixin(s)(int a){ return a+1; } } ...No.If not, is something like this being looked at?The suggestion has been made, but there was no extensive discussion so far. https://github.com/dlang/DIPs/blob/master/DIPs/DIP1010.md#mixin-identifiers
Jul 18 2017
On Tuesday, 18 July 2017 at 21:22:47 UTC, Timon Gehr wrote:On 18.07.2017 22:57, Moinak Bhattacharrya wrote:That's the DIP for static foreach. Is there a separate DIP for mixin identifiers?Is it possible to mixin function names? IE something like this: template strFunc(string s){ int mixin(s)(int a){ return a+1; } } ...No.If not, is something like this being looked at?The suggestion has been made, but there was no extensive discussion so far. https://github.com/dlang/DIPs/blob/master/DIPs/DIP1010.md#mixin-identifiers
Jul 18 2017
On 18.07.2017 23:28, Moinak Bhattacharrya wrote:On Tuesday, 18 July 2017 at 21:22:47 UTC, Timon Gehr wrote:Not yet.On 18.07.2017 22:57, Moinak Bhattacharrya wrote:That's the DIP for static foreach. Is there a separate DIP for mixin identifiers?Is it possible to mixin function names? IE something like this: template strFunc(string s){ int mixin(s)(int a){ return a+1; } } ...No.If not, is something like this being looked at?The suggestion has been made, but there was no extensive discussion so far. https://github.com/dlang/DIPs/blob/master/DIPs/DIP1010.md#mixin-identifiers
Jul 18 2017
On Tuesday, 18 July 2017 at 21:29:05 UTC, Timon Gehr wrote:On 18.07.2017 23:28, Moinak Bhattacharrya wrote::( I might look into making one, then. This feature would scratch a rather sizable itch.On Tuesday, 18 July 2017 at 21:22:47 UTC, Timon Gehr wrote:Not yet.On 18.07.2017 22:57, Moinak Bhattacharrya wrote:That's the DIP for static foreach. Is there a separate DIP for mixin identifiers?Is it possible to mixin function names? IE something like this: template strFunc(string s){ int mixin(s)(int a){ return a+1; } } ...No.If not, is something like this being looked at?The suggestion has been made, but there was no extensive discussion so far. https://github.com/dlang/DIPs/blob/master/DIPs/DIP1010.md#mixin-identifiers
Jul 18 2017