@AirspeedSwift Using node identity for index equality also violates the requirement that indexes be equal for equal collection values.
-
-
-
@jckarter across two independently-constructed collections? - View other replies
-
@AirspeedSwift Yeah. Equal values should be indistinguishable. -
@jckarter Equal collection values as in Equatable.==? Or bitwise? - View other replies
-
@AirspeedSwift@jckarter Element-wise, I believe. - View other replies
-
- View other replies
-
@AirspeedSwift@rob_rix@jckarter isn't that why String isn't a collection anymore? -
@johannesweiss@rob_rix@jckarter 180 chars too short to write String.CharacterView :) - View other replies
- Show more
-
-
-
@AirspeedSwift Do you have a full playground of the final form? Slight error here trying to rebuild it: https://gist.github.com/rnapier/07b1b176cf66edd357f4 … - View other replies
-
@cocoaphony Here’s the full implementation, including a fix for the count, thanks for the spot on that.https://gist.github.com/airspeedswift/a3ac828ce794613f2b53 …
-
-
-
@airspeedswift awesome post, as always :) I was surprised you didn't mention constraining Element to Equatable to deal with ForwardIndexType - View other replies
-
@NachoSoto you mean, two indices are equal if they point to two equal lists? Yeah, though this leads to index equality being O(n) :) -
@AirspeedSwift isn't that normal for a linked list? -
@NachoSoto@AirspeedSwift Yep. Pretty sure most CollectionType algos assume O(1) index equality, tho.
-
-
@airspeedswift
I like how the non-constructible index follows String's use of same -
@AirspeedSwift amazing post, thank you!
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.

Airspeed Velocity
Joe Groff
Rob Rix
Johannes Weiß
Rob Napier
Nacho Soto
Nate Cook
Kaan Dedeoglu