<div dir="ltr">one more thing:<div><br></div><div>we can simplify further (while still having formatted looking code) with !q{} instead of !() :</div><div><br></div><div>```</div><div><div>// applies to next decl</div><div>@deps!q{import std.algorithm;}</div><div>void test1(){}</div><div><br></div><div>// applies to a set of decls</div><div>@deps!q{import std.stdio;}{</div><div> void test2(){}</div><div> void test3(){}</div><div>}</div><div><br></div><div>// applies to all following decls (':')</div><div>@deps!q{import std.array;}:</div><div><br></div><div>// can specify other dependencies beyond imports and have arbitrary complex logic:</div><div>@deps!q{</div><div> import std.range;</div><div> static int[100] data2;</div><div> version(linux){</div><div> enum data1=import("foo");//string import</div><div> pragma(lib, "curl");</div><div> }</div><div>}:</div><div>void test4(){}</div><div><br></div><div>// Can alias some dependencies:</div><div>alias deps1=deps!q{import std.algorithm;};</div><div><br></div><div>@deps1</div><div>void test4(){}</div></div><div>```</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 15, 2016 at 3:46 PM, ArturG 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"><span class="">On Thursday, 15 December 2016 at 19:52:50 UTC, Andrei Alexandrescu wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
On 12/15/2016 02:22 PM, Timothee Cour via Digitalmars-d wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
Some more details on my proposa based on UDA:<br>
<br></span>
...<br>
<br>
</blockquote><span class="">
I now understand the idea, thank you.<br>
<br>
My question is, doesn't this take things too far? Earlier I wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The acceptability of the proposal decays exponentially with its<br>
deviation from existing import syntax.<br>
</blockquote>
<br>
Indeed adding less syntax is better, but that's not an absolute; the optimum isn't necessarily at the "zero syntax added" point. This is because there are several things to harmonize in language design, which naturally are in tension.<br>
<br>
<br>
Andrei<br>
</span></blockquote>
<br>
Something like Timothee Cour's @deps proposal is interesting,<br>
because it adds the same options to DCD's as module level imports have.<br>
<br>
They can be applied to any symbol that supports udas which the current syntax from the dip doesnt.<br>
<br>
As he displayed, they can be used to group symbols together which makes it more dry, but that can also be a drawback when refactoring depending which version you use.<br>
<br>
And you dont have to support all shown features as that syntax is easier extendable.<br>
<br>
The initial version could support only import statements.<br>
</blockquote></div><br></div>