<div class="gmail_quote">On 22 January 2012 20:36, Alex Rønne Petersen <span dir="ltr"><<a href="mailto:xtzgzorex@gmail.com">xtzgzorex@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 class="im">On 22-01-2012 19:33, Andrej Mitrovic wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
A while ago there was a suggestion by Andrei to incorporate this sort of syntax:<br>
<br></div>
template ElementType(T : T[])<br>
{<div class="im"><br>
    alias ElementType = T;<br>
}<br>
<br>
struct Foo(T)<br>
{<br>
     alias Type = T;<br>
}<br>
<br>
I think people agreed it was a nice syntax, but I don't know if anyone<br>
tried to implement it.<br>
</div></blockquote>
<br>
It still feels wrong. Why am I overwriting an existing symbol?</blockquote><div><br></div><div>Was it me that raised this on IRC? I've also been discussing it on IRC the last few days, and it is very confusing.</div>
<div>I can write code that works now, but I still for the life of me find coherent logic for the syntax in my head, and whether I'm aliasing something, or producing a constant using enum... one way I'm producing a type, the other way I'm producing a value. The same syntax can produce this disconnected result; feels very unnatural to me. Types and values feel like totally different things in my mind, perhaps this is my error?</div>
<div><br></div><div>I think the problem for me is that I can't see clearly exactly what a template actually does, it feels like there's some magic involved, mainly in the result syntax, that makes it work somehow...</div>
</div>