Re:Dictionary and Set Improvements in Swift 4.0
by smitherfield on Thursday October 05, 2017 @12:45AM
(#15406723)
I prefer Ruby's syntax too, but Swift also has a shorthand version which is, IMO, usually nicer.
[ Parent
| on HN ]
Re:Dictionary and Set Improvements in Swift 4.0
by Groxx on Monday October 09, 2017 @06:41PM
(#15438032)
stuff like this always makes me miss Ruby's even-shorter-hand version though :)
groceriesByDepartment.mapValues(&:count) # not ruby, but meh
Re:Dictionary and Set Improvements in Swift 4.0
by jakobegger on Thursday October 05, 2017 @03:56AM
(#15407340)
The shorthand version doesn‘t let you specify argumen types (only works when they can be inferred)