Autoclosure is a super interesting trick Swift has for solving problems usually reserved for macros: https://developer.apple.com/swift/blog/?id=4 …
-
-
Although it's not clear to me that expression-orientation plays well with their trailing-closure-arg thing -- foo.map |x| { x + 1 }; ???
-
Rust had this syntax for a while...
-
worth revisiting, I think! (assuming it's not a huge parsing disaster...)
End of conversation
New conversation -
-
-
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?
-
assert and operators use them without having to use macros or give them special evaluation semantics. e.g. the RHS of && and ||
-
autoclosures were more "cute" in my experience -- more aggressive sugar for passing closures is the bigger win IMO.
-
e.g. `array.sort { $0 < $1 }`
-
Ah OK! I've long wanted that. Again, Scala has something similar: `array.sort { _ < _ }`
-
Heh, swift has `array.sort(<)` :P
#GetOnApplesLevel -
Haskell too :)
-
pretty sure "you can do this in haskell" borders on vacuous. Although upon reflection the two have similar operator overloading
End of conversation
New conversation -
-
-
YOU'RE NOT MY SUPERVISOR
-
MY NAME IS HIGHER UP ON https://www.rust-lang.org/team.html SO YUH HUH
End of conversation
New conversation -
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.