On 02.01.2017 01:47, pineapple wrote:
On Saturday, 31 December 2016 at 17:02:55 UTC, Chris Wright wrote:
This extension removes an unforced limitation of the current with
syntax (allows it to occur at top level)
In other words, another aspect of this DIP is that I can write:
module foo;
static import std.traits;
static import bar;
with (std.traits)
{
template Foo(T) if (isAbstractClass!T) {}
}
with (bar.SomeEnum)
{
enum something = SomeEnumValue;
}
This is the only expression of the feature I've seen so far that makes
intuitive sense to me.
I'm still not sold on it being a worthy addition but, if it were, then
this is the most promising syntax I've seen so far.
Should be 'static with'. ('with' already has a meaning.)