<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div> I think we have to make some things clear. Unfortunately, I used the word stream when I meant cycle, they are very different things from an implementer's perspective. A stream is a generalized version of a cycle, where the latter admits infinite sequences of any kind or mix of data (say, the Fibonacci example here), the latter admits only infinite representations based on an initial finite input. This makes many divergent cases in the former perfectly valid in the latter through proper manipulation of an underlying finite sequence. If you want to see what a Cycle looks like, Rust has std::iter::Cycle. Swiftz, on the other hand, shows what a proper stream would look like (and having written the thing, I do not wish to see support for it in the Swift Standard Library). <br><br>~Robert Widmann</div><div><br>2015/12/29 18:39、Craig Cruden <<a href="mailto:ccruden@novafore.com">ccruden@novafore.com</a>> のメッセージ:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8">I have never tried to implement a “stream” in Swift, so I am not sure if there is an easy way to do it…. but I don’t see a collection of type stream as I have in Scala. <div class=""><br class=""></div><div class=""><a href="http://www.scala-lang.org/api/current/index.html#scala.collection.immutable.Stream" class="">http://www.scala-lang.org/api/current/index.html#scala.collection.immutable.Stream</a></div><div class=""><br class=""></div><div class=""><br class=""><div class=""><div><blockquote type="cite" class=""><div class="">On 2015-12-30, at 7:39:54, Dave Abrahams <<a href="mailto:dabrahams@apple.com" class="">dabrahams@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Dec 29, 2015, at 4:29 PM, Craig Cruden <<a href="mailto:ccruden@novafore.com" class="">ccruden@novafore.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class="">Could you define what you mean by “stream support?” Whatever it is, I doubt simply adding an infinitely-repeating sequence type is enough to get you there.</blockquote></div><div class=""><br class=""></div>I can guess — but it is only a guess. <div class=""><br class=""></div><div class="">A function defines an infinite “set” of values (like the digits of pi). A stream is just a special type of traversable (lazy) which does not evaluate until asked for the next in a sequence of the set. A function defined in a stream will thus only continue calculating next digits when asked for them. Similarly you could have a collection (head/tail) and you ask for the head and you get it, but the rest (tail) is just the tail as a whole and none of the values in it are really defined until you traverse down to the next head of the rest of the tail. Once it is evaluated it is stored in memory for future evaluations. If you were to fully evaluate the function it would never finish, and if it were to finish — you would probably run out of memory.</div></div></div></blockquote><div class=""><br class=""></div>Yes, I understand the usual concept of a “stream," but it doesn’t help me understand what stream *support* entails.</div><div class=""><br class=""></div><div class="">-Dave</div><div class=""><br class=""></div></div></div></blockquote></div><br class=""></div></div></div></blockquote></body></html>