<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div>On Dec 23, 2016, at 03:13, Tino Heth <<a href="mailto:2th@gmx.de">2th@gmx.de</a>> wrote:<br><br></div><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=utf-8">My personal theory of the whole phase-one construct is that it's just a way to calm everyone down, so that there is more time to actually do some work on the code ;-)<div class=""><br class=""></div><div class="">Afair, the conversation about this didn't fade out slowly, but was stopped by someone saying "that addition is to big to be considered now".</div><div class="">I'm to lazy to fight with the medium to find a reference, but there is a draft for a proposal:</div><div class=""><a href="https://github.com/SwiftInofficialEvolution/Home/wiki/compile-time parameters" class="">https://github.com/SwiftInofficialEvolution/Home/wiki/compile-time%20parameters</a></div><div class=""><br class=""></div><div class="">I think the idea is quite useful, but it might be confusing for some people that they can create Vector<Int, size: 4> but not Vector<Int, size: myIntValue>.</div><div class="">The issue with the latter is obvious when you fully understand the concept, but if myIntValue is known to be a constant at compile time (or a fixed case of an enum…), it's harder to decide wether the compiler should accept it.</div><div class=""><br class=""></div><div class="">In some aspect, the parameters have requirements that are opposite to "inout" — but that's a very fresh thought, and I've no idea if that duality might help.</div></blockquote><br><div>Yes, that's one of the proposals I was thinking of!</div><div><br></div><div>I think if the type was specifically an "IntegerLiteral", the restriction would be more obvious. <span style="background-color: rgba(255, 255, 255, 0);">'IntegerLiteralType' would be better, but it's just typealiased to 'Int', so maybe not better enough.</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div>It occurs to me that it <i>might</i> be possible to create a 'Vector<Int, size: myIntValue>' by considering 'Vector<Int, size:_>' to be a kind of "implicit protocol" (and one with a generic parameter, "Int", no less!) to which all concrete instances of Vector would conform. Then we could write "func foo(x:Int)->Vector<Int, Size:_> {...}" and it'd just work. I think... maybe not... I haven't thought about it longer than it's taken to write out.</div><div><br></div><div>That "opposite of inout" thought is quite interesting... I'll have to think about it for a while.</div><div><br></div><div>- Dave Sweeris</div></body></html>