<div dir="ltr">So what if you have a struct containing a 100 element fixed-sized array/tuple? To have that struct conform to Equatable, etc., would you have to explicitly equate the elements?:<div><br></div><div>self.data.0 == other.data.0 && self.data.1 == other.data.1 && ...</div><div><br></div><div>Given that large element fixed-sized arrays are common in C, this seems like a huge burden.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 29, 2016 at 2:17 PM, Joe Groff <span dir="ltr"><<a href="mailto:jgroff@apple.com" target="_blank">jgroff@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><span><blockquote type="cite"><div>On Jan 29, 2016, at 11:14 AM, Trent Nadeau <<a href="mailto:tanadeau@gmail.com" target="_blank">tanadeau@gmail.com</a>> wrote:</div><br><div><div dir="ltr">Is having fixed arrays with large numbers of elements (256, 1024, etc.) going to cause issues with protocol conformance of tuples? I believe that since the type system doesn't currently have type-level integers, tuple protocol conformance is done via a hard-coded limit.</div></div></blockquote><div><br></div></span>Tuples still don't really conform to protocols, we just provide overloads for the <>== operators for small tuples now. Proper language support for tuple protocol conformance ought to account for arbitrary variadic-ness.</div><span><font color="#888888"><div><br></div><div>-Joe</div></font></span><span><div><br><blockquote type="cite"><div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 29, 2016 at 1:30 PM, Austin Zheng via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That makes sense, thanks. I'm wondering if the N x T syntax might 'naturally fall out' of such a system for any other use cases.<br>
<br>
Daydreaming aside, I think this is a great proposal and it'll make 256-member C array tuples less awful to work with.<br>
<br>
Austin<br>
<div><div><br>
> On Jan 29, 2016, at 10:29 AM, Joe Groff <<a href="mailto:jgroff@apple.com" target="_blank">jgroff@apple.com</a>> wrote:<br>
><br>
><br>
>> On Jan 29, 2016, at 10:22 AM, Austin Zheng via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
>><br>
>> I like the (Count x Type) design, but if Swift got integer generic parameters in the future is this what tuple shorthand syntax would still look like (not rhetorical, actually asking)? It would be nice to future-proof whatever design we come up with, to a reasonable extent.<br>
><br>
> You'd still need something to define FixedArray<N> in terms of:<br>
><br>
> struct FixedArray<T,N: Int> { var values: (N x T) }<br>
><br>
> -Joe<br>
<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>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Trent Nadeau</div>
</div>
</div></blockquote></div><br></span></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Trent Nadeau</div>
</div></div>