Autoclosure is a super interesting trick Swift has for solving problems usually reserved for macros: https://developer.apple.com/swift/blog/?id=4 …
-
-
Replying to @Gankra_
My friends who work on Rust should actually check out all the cool stuff Swift does to make closures SO MUCH better to work with.
3 replies 0 retweets 1 like -
Replying to @Gankra_
Some thoughts https://internals.rust-lang.org/t/autoclosures-via-swift/3616/5?u=aturon … -- curious where this gets used that makes it feel so great in Swift?
2 replies 0 retweets 0 likes -
Replying to @aaron_turon
assert and operators use them without having to use macros or give them special evaluation semantics. e.g. the RHS of && and ||
1 reply 0 retweets 0 likes -
Replying to @Gankra_ @aaron_turon
autoclosures were more "cute" in my experience -- more aggressive sugar for passing closures is the bigger win IMO.
1 reply 0 retweets 0 likes -
-
Replying to @Gankra_
Ah OK! I've long wanted that. Again, Scala has something similar: `array.sort { _ < _ }`
1 reply 0 retweets 0 likes -
Replying to @aaron_turon
Heh, swift has `array.sort(<)` :P
#GetOnApplesLevel1 reply 0 retweets 0 likes -
-
Replying to @aaron_turon
Anyway I'm all for ergonomic improvements here! Actually hoping to launch a major ergo initiative in the near future!
2 replies 0 retweets 2 likes
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.