Show HN: Dollar and Cent – A functional tool belt for Swift
github.com
github.com
second Returns the second element in the array and terminated the chain
third Returns the third element in the array and terminated the chain
fourth Returns the fourth element in the array and terminated the chain
fifth Returns the fifth element in the array and terminated the chain
sixth Returns the sixth element in the array and terminated the chain
seventh Returns the seventh element in the array and terminated the chain
eighth Returns the eighth element in the array and terminated the chain
ninth Returns the ninth element in the array and terminated the chain
tenth Returns the tenth element in the array and terminated the chain
... is this a joke?
https://github.com/rails/rails/blob/a31277011814b7bdb6be41a8...
http://www.quora.com/Why-is-Array-forty_two-called-the-reddi...
arr.first is more immediately expressive to me than arr[0] - but this is a matter of opinion :)
1. http://docs.racket-lang.org/reference/pairs.html
2. http://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node149.html
Cent is a library that extends certain Swift object types using the extension feature like ActiceSupport in ruby and gives its two cents to Swift language.
But really functions are first class citizens in Swift and it is designed to be a hybrid between OO and functional programming language. It doesn't implement some of the common helper functions like pluck, difference, intersection, etc. This is where this or another library comes in.
Though dollar swift is a little bit cheesy for my taste.
People should file Apple radars if they there's functionality missing in a Beta Language. Not just try to catch attention and stars in Github with useless (at least in this stage) projects.
PS: I insist, an expressive language like Swift doesn't need '$.'
Cheers.
Before calling this project useless please consider the alternative which is none. Apple will take its time even if you tell them to implement these. You can either implement these helper methods yourself or you can use this or another library.
Out of the thousands of people who saw this and liked it I expect few haters like you cause "If people don't hate then it won't be right"
Talking about Swift's expressiveness. After skimming through Apple's Swift book I tend to agree with you. I misunderstood your first comment having a thought you wanted Swift code to be more like Objective C.