<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><br></div><div>On Jul 23, 2017, at 09:08, Taylor Swift <<a href="mailto:kelvin13ma@gmail.com">kelvin13ma@gmail.com</a>> wrote:<br><br><div><blockquote type="cite"><div><div dir="ltr"><span class="gmail-im"><span style="font-family: monospace, monospace;">let fsa:[2 * Int] = [2 * 5, 3</span><span style="font-family: monospace, monospace;">] // [10, 3] ???</span></span></div></div></blockquote><div><br></div><div>Correct. If you wanted a multidimensional array, that'd be written "let nestedFSA: [2*[5*Int]]". Or, speculating a bit, I suppose maybe "<span style="background-color: rgba(255, 255, 255, 0);">let nestedFSA: [[5*Int]*2]", if we wanted there to be a column-major option</span>. IMHO all those read better than this proposal's syntax.</div></div><div><br></div><div><br></div><br></div><blockquote type="cite"><div><div dir="ltr">Using the <i>multiplication operator</i> as a <i>separator</i> character seems like an extraordinarily bad idea.</div></div></blockquote><div><br></div><div><span style="background-color: rgba(255, 255, 255, 0);">Well, much to the dismay of my occasionally-inner Unicode fanboy, we decided that we didn't want to make everyone have to figure out how to type "×" to use a stdlib type (to the further dismay of my O-IUF, this is actually a really good argument, especially since a likely use for FSA is in embedded or systems programming, where you might need to use an editor that doesn't support Unicode).</span></div><div><br></div><div>I think another contender might've been "let fsa: [2 of Int]", but if you want a complete list, I'll have to go back and reread the quarter-dozen or so threads on FSAs that pop up whenever we lift the "out of scope" thing (but before they get ruled out of scope again). <span style="background-color: rgba(255, 255, 255, 0);">Semantically speaking, "count * MemoryLayout<Type>.stride" is a pretty much exactly what we're doing at the storage level, so "count * Type" fits well in that regard (IMHO, anyway, since we want the syntax to be concise). It also works as syntactic sugar for declaring homogeneous tuples.</span></div><div><br></div><div><span style="background-color: rgba(255, 255, 255, 0);">Speaking of which, IIRC, at one point we were considering adding subscripts to tuples and using that for FSAs. I think the hangups were pretty much just that tuples can't conform to protocols and the iffy semantics of subscripting heterogeneous tuples. The former is a bit of a pain point anyway, and unless I've forgotten about some deal-breaker that was brought up in one of those threads, I think it's somewhat likely that we'll eventually do something about it. Unrelated to FSAs and subscripting tuples, we've also discussed variadic generic arguments... My recollection is that there was broad support for the idea; it's just a matter of it being in-scope so that we can figure out the syntax. Once we get that done, if we make tuples extendable we could just say (hand-wavey straw-man syntax, of course):</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"> extension (Ts: _...) where Ts.count > 0, Ts.reduce(true) { $0 = Ts.Head.self == $1.self } == true {</span></div><div><div><span style="background-color: rgba(255, 255, 255, 0);"> subscript(_ i: Int) -> Ts.Head {...}</span></div><div><span style="background-color: rgba(255, 255, 255, 0);"> }</span></div></div><div><span style="background-color: rgba(255, 255, 255, 0);"><br></span></div><div><span style="background-color: rgba(255, 255, 255, 0);">... and just do it all through tuples. Is this a <i>better</i> than having a dedicated FSA type? Dunno. In large part, it depends on how difficult the various ideas will be to implement, and how useful the extra bits of functionality would be to the rest of the language. Unfortunately, the people who have those answers are busy working with the Swift 4.0 release, and likely don't have time to really weigh in on out of scope topics (which we all agree can be frustrating, but there are practical realities in life, and staying focused enough to meet deadlines is one of theirs).</span></div><div><br></div><div>- Dave Sweeris </div></body></html>