syntax sugar: std.path::buildPath instead of from!"std.path".buildPath

Nick Treleaven via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 15 12:21:45 PST 2017


On Wednesday, 15 February 2017 at 20:09:46 UTC, Timothee Cour 
wrote:
> This thread completely diverged from the original post, which 
> was propsing `::` instead of `from!`:
>
> ```
> void fun(T)(std.stdio::File input, T value) if 
> (std.traits::isIntegral!T)
> {...}
> ```
>
> instead of:
>
> ```
> void fun(T)(Module!"std.stdio".File input, T value) if
> (Module!"std.traits".isIntegral!T)
> {...}
> ```
>
> I see it as a clear improvment in readability (see original 
> post for details along with shortcomings of `from!` approach )

I really think allowing `with (module_!"std.foo")` before 
declarations is a better solution from a DRY perspective, plus it 
works for UFCS. This is a more general change that has other 
benefits that apply to any static aggregate e.g. enum names - 
`with(Enum)`, not just imports.


More information about the Digitalmars-d mailing list