<div><div><br><div class="gmail_quote"><div>On Mon 29. May 2017 at 20:57, David Sweeris via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> On May 29, 2017, at 01:12, Tino Heth via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
><br>
> I agree strongly that the syntax looks awkward — imho<br>
> var v: Vector<Int, size: 3><br>
> would be a much better fit than<br>
> var v array 3 of Int<br>
><br>
> As much as I want to have "real" arrays, I don't think we should add new keywords for them.<br>
<br>
Yeah, a "fixed-size array" is probably the most obvious use-case for allowing literal values to be generic parameters. In fact, at that point, they'd just be another type... no special support needed, other than validating the count when assigning array literals to them.<br>
</blockquote><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
The syntax that gained some traction last time they were seriously discussed would also be better, IMHO:<br>
let x: [Int x 4]<br>
or maybe it was this?<br>
let x: [Int * 4]<br>
Either way, it's more concise, far easier to read (IMHO), and doesn't need new keyword(s).</blockquote><div><br></div><div>I have not followed all previous discussions on this (so sorry if it was already proposed and/or discussed) but from the point of view of the "standard mathematics writing", it seems to me that it should rather be [Int^4] .</div><div><br></div><div>Indeed the three dimensional space built by combining the set of real numbers R is noted R^3 or alternatively RxRxR (but for larger dimensions you certainly do not want this writing!)</div><div><br></div><div>Strictly speaking Int^4 would be mathematically speaking more correct but [Int^4] has the advantage of making clear that this is indeed an array.</div><div><br></div><div>There are many aspects in the initial proposal that certainly need a more expert eye than mine. I have one question though. It seems to me that the constant expressions as known as constexpr in C++11 would be allowed as well. Is that right? If yes, are there any differences in the proposal to what is allowed in C++11? </div><div><br></div><div>Nicolas</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
- Dave Sweeris<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div></div></div>