digitalmars.D.learn - alias for regular expressions
- Thunderbird (5/5) Sep 13 2015 Some special interest thingamabob:
- anonymous (2/9) Sep 13 2015 no
- Thunderbird (2/11) Sep 13 2015 Thanks for your quick reply :)
- Meta (16/17) Sep 14 2015 To expand on that, alias in D is nothing like the C macro
- Thunderbird (2/20) Sep 15 2015 Thanks for elaborating!
Some special interest thingamabob: I've tried to redefine "else if" as "elif" using "alias elif = else if;". No matter what to no avail. I know this is probably useless fancy stuff, but is there any way to get this done without much ado?
Sep 13 2015
On Sunday 13 September 2015 21:47, Thunderbird wrote:Some special interest thingamabob: I've tried to redefine "else if" as "elif" using "alias elif = else if;". No matter what to no avail. I know this is probably useless fancy stuff, but is there any way to get this done without much ado?no
Sep 13 2015
On Sunday, 13 September 2015 at 19:51:38 UTC, anonymous wrote:On Sunday 13 September 2015 21:47, Thunderbird wrote:Thanks for your quick reply :)Some special interest thingamabob: I've tried to redefine "else if" as "elif" using "alias elif = else if;". No matter what to no avail. I know this is probably useless fancy stuff, but is there any way to get this done without much ado?no
Sep 13 2015
On Sunday, 13 September 2015 at 19:52:20 UTC, Thunderbird wrote:Thanks for your quick reply :)To expand on that, alias in D is nothing like the C macro preprocessor. D specifically disallows tricks like `#define true false`. In D, aliases are just another name for a symbol. Ex: struct Test { int n; float f; } alias IntFloat = Test; //IntFloat is just another name for Test Test t = Test(0, 1.0); IntFloat inf = IntFloat(0, 1.0); //Test and IntFloat are NOT separate types. //Use std.typecons.Typedef for that assert(t == inf); assert(is(typeof(t) == typeof(inf));
Sep 14 2015
On Monday, 14 September 2015 at 07:11:38 UTC, Meta wrote:On Sunday, 13 September 2015 at 19:52:20 UTC, Thunderbird wrote:Thanks for elaborating!Thanks for your quick reply :)To expand on that, alias in D is nothing like the C macro preprocessor. D specifically disallows tricks like `#define true false`. In D, aliases are just another name for a symbol. Ex: struct Test { int n; float f; } alias IntFloat = Test; //IntFloat is just another name for Test Test t = Test(0, 1.0); IntFloat inf = IntFloat(0, 1.0); //Test and IntFloat are NOT separate types. //Use std.typecons.Typedef for that assert(t == inf); assert(is(typeof(t) == typeof(inf));
Sep 15 2015