@mjtsai I think you can consider a Generator to be the equivalent of NSFastEnumerationState.
Is there any optimization like NSFastEnumeration (batch fetching, detecting mutations) in Swift? SequenceType doesn’t seem to do that.
-
-
-
@rob_rix So no batching. -
@mjtsai The generator can batch & detect mutations. Often it’ll live on the stack, so .next() is not much worse than incrementing the ptr. - View other replies
-
@rob_rix that slow or that the batching isn’t that worth it. -
@mjtsai As I understand it, it doesn’t necessarily have to send a message. It may not even need indirection through a vtable. - View other replies
-
@mjtsai And if it’s dispatched statically it can be inlined. - View other replies
-
@rob_rix Wonder how often that is. I would think you’re usually passed in a collection and don’t know its type. -
@mjtsai Technically that _can_ be specialized at compile time (and IIRC the compiler has begun to in some cases). - Show more
-
-
-
@mjtsai Why would you want that‽ Swift is Functional! Forget that old stuff. - View other replies
-
@jeffwatkins If they introduce the interrobang operator into Swift, I’m blaming you! /cc@mjtsai -
-
@jeffwatkins The custom-operator portion of my brain was fried by C++ back in the day, like looking at the sun & burning retinas.@mjtsai -
@pgor As well it should be. People who write custom operators are BAD people.
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Michael Tsai
Rob Rix
Jeff Watkins
Paul Goracke