Swift generics: copying and pasting my code for T? so that it can also work for [T], instead of writing it once with id.
-
-
@jckarter Is there a way to compare to Anys that I know are both Equatable inside? - View other replies
-
@mjtsai The generics features we're planning for after 3.0 should make it easier to work with Any and other dynamic types. -
@jckarter That would be nice. Right now, Any is hard to do much with. -
@mjtsai With some helper functions, you can get pretty lightweight syntax for forcing Any into static contexts: https://gist.github.com/jckarter/2762c4fe91d8eba4b1ce27060b4c601d … -
@jckarter That is wild. How is it that if x is a Derived and I do (x=>Base.f)() it ends up calling Derived.f()? -
@mjtsai Base.f doesn't pick a method implementation until you give it a `self` parameter. -
@jckarter Aha, I was used to the way Python does it. Good to know. Can you do that with an operator or only a named method? - View other replies
-
@mjtsai The way method references are "curried" means you'd need a separate overload for => taking (T, U) -> V functions… - Show more
-
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
Joe Groff