Re: Using . notation abstractly

2018-10-12 Thread Simen Kjærås via Digitalmars-d-learn
On Friday, 12 October 2018 at 12:43:53 UTC, Paul Backus wrote: On Wednesday, 10 October 2018 at 22:56:14 UTC, James Japherson wrote: The point of all this is because D does not allow nesting of enums which allows for nice use of . to separate hiearchies: enum A { enum B { X, }

Re: Using . notation abstractly

2018-10-12 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 10 October 2018 at 22:56:14 UTC, James Japherson wrote: The point of all this is because D does not allow nesting of enums which allows for nice use of . to separate hiearchies: enum A { enum B { X, } } A.B.X, rather than having to have one large flat enum and do

Re: Using . notation abstractly

2018-10-11 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 10 October 2018 at 22:56:14 UTC, James Japherson wrote: One of the problems is connecting it with actual code that does something depending on the path in a way that is general enough to be used for a wide variety of problems. Any ideas on how this could be done? My first idea

Using . notation abstractly

2018-10-10 Thread James Japherson via Digitalmars-d-learn
struct Dispatcher(Base...) { static auto opDispatch(string name, T...)(T vals) { pragma(msg, " - ", name); return Dispatcher!(Base, name).init; } } struct Dispatch { alias X = Dispatcher!void; alias X this; } pr