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,
}
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
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
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