<div dir="ltr">as for language change, I believe the proposed syntax (`::`) can be reduced to a minimum if we we make `fullyqualifiedName` `::` a reduction to the from/Module <span style="font-size:12.8px">inline import idiom. No complex corner case or new bug introduced, it could be done as a pure AST transformation</span><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 13, 2017 at 9:32 PM, Timothee Cour <span dir="ltr"><<a href="mailto:thelastmammoth@gmail.com" target="_blank">thelastmammoth@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class=""><span style="font-size:12.8px">> The only thing from has going for it is that it doesn't require a language change. Yours does, so it should be compared to the proposals in DIP1005 and not just from.</span><br style="font-size:12.8px"><div><span style="font-size:12.8px"><br></span></div></span><div><span style="font-size:12.8px">indeed. But just because something can be done in library code doesn't mean it should. Same exact rationale for:</span></div><div><span style="font-size:12.8px">`lazy`, `=>`, scope(exit), etc. All of these coul've been done in pure library code, but the syntax sugar makes them particularly easy to use. Syntax sugar should be used sparingly, but it makes sense if</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">* it simplifies syntax compared to best possible library code</span></div><div><span style="font-size:12.8px">* it's for a common use case</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 13, 2017 at 9:03 PM, Jack Stouffer via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_8512579508837318688HOEnZb"><div class="m_8512579508837318688h5">On Tuesday, 14 February 2017 at 03:49:28 UTC, Timothee Cour wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What about allowing syntax sugar as an alternative to relying on the new `from/Module` inline import idiom:<br>
<br>
```<br>
void fun(T)(std.stdio::File input, T value) if (std.traits::isIntegral!T)<br>
{...}<br>
```<br>
<br>
instead of:<br>
<br>
```<br>
void fun(T)(Module!"std.stdio".File input, T value) if<br>
(Module!"std.traits".isIntegra<wbr>l!T) {...}<br>
```<br>
<br>
Rationale:<br>
<br>
* this reads much better (less noise); same as `=>` syntax for lambdas<br>
<br>
* this is expected to be a very common pattern, so might as well make it as simple as possible<br>
<br>
* not particular on which symbol is used, could be something else, so long it doesn't involve writing a string such as from!"std.traits". But :: will be familiar to those coming from C++/rust etc.<br>
<br>
* from!"" is too loose and can be abused arbitrarily:<br>
<br>
```<br>
// this compiles<br>
void fun(){<br>
  from!"std.stdio; pragma(msg,`abuse...`); import std.stdio".File a;<br>
}<br>
```<br>
<br>
Furthermore this is useful in other scenarios, namely when an import is<br>
used only once in a context:<br>
```<br>
auto fun(){  return std.file::getcwd; }<br>
```<br>
is more DRY; instead of:<br>
```<br>
auto fun(){ static import std.file;  return std.file.getcwd; }<br>
auto fun(){ return Module!"std.file".getcwd; }<br>
```<br>
<br>
NOTE: if :: is not feasible for whatever reason, let's consider other symbols without prejudice to this proposal.<br>
</blockquote>
<br></div></div>
The only thing from has going for it is that it doesn't require a language change. Yours does, so it should be compared to the proposals in DIP1005 and not just from.<br>
<br>
TBQH all the the proposed syntaxes for the DIP1005 problem kind of suck, because at the end of the day there's no good way to solve the problem.<br>
<br>
Every proposed solution either<br>
<br>
1. Looks terrible (and some people highly underestimate the cost of a language looking bad), or<br>
2. Complicate our already complex function definitions even further. How is a beginner not going to look at this and feel like barfing<br>
<br>
with (import std.datetime, std.range.primitives) void fun(R)(scope R r, const ref Systime value) if (isInputRange!R && !isFinite!R)  { ... }<br>
<br>
But, I'm still of the opinion that the `with` syntax is currently the best proposal. Others have already shown the weaknesses of the `from!` approach.<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>