yes for sequences are not immutable. I get confused.<div><br></div><div>no for sequences should be definition of lists of values. Just like Fibonacci sequence, we can calculate the values form the start of the Fibonacci sequence one by one. But we are not accessing the values of Fibonacci sequence.</div><div><br></div>A socket can be modeled as a sequence of bytes but socket(itself)<span></span> is not the sequence. It's just provide method to access the bytes sequences.<br><div><br>Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>> 於 2015年12月31日星期四 寫道:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Dec 31, 2015 at 2:01 PM, Susan Cheng via swift-evolution <span dir="ltr"><<a href="javascript:_e(%7B%7D,'cvml','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">As I know SequenceType should have behaved as immutable structure and it provides method to get a mutable GeneratorType which generates value from start of sequence.</blockquote><div><br></div><div>Sequences are not immutable. A sequence is allowed to be consumed by iterating over its generator. If the type you have is a sequence, you can only assume that you can access the elements only once. For example, a socket can be modeled as a sequence of bytes. Once the bytes are consumed from the corresponding generator, they are gone from the sequence.</div><div><br></div><div>Dmitri</div><div><br></div></div>-- <br><div>main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if<br>(j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="javascript:_e(%7B%7D,'cvml','gribozavr@gmail.com');" target="_blank">gribozavr@gmail.com</a>>*/</div>
</div></div>
</blockquote></div>