3 ms·
What features of Swift do you find functional? What kind of functional features are you using? I'm asking out of genuine curiosity, not to put you on the spot.
by rubiquity 12y ago
What features of Swift do you find functional? What kind of functional features are you using? I'm asking out of genuine curiosity, not to put you on the spot. Thanks!
- bitpew 12y agoNot to speak for the OP, but two features bear resemblance to functional programming languages: 1) Function Types ( = higher order functions) This allows functions to be passed around as function parameters or return values. 2) Immutable variables via let let a = 1 // a is always bound to the constant 1 a = 2 // error
- emsy 12y agoI couldn't find any built in list/map/set comprehension. Did they leave it out or did I just miss it?
- deleted 12y ago[deleted]
- ktran03 12y ago“The value of a constant doesn’t need to be known at compile time, but you must assign it a value exactly once.” Excerpt From: Inc, Apple. “The Swift Programming Language.” Apple Inc. Check out this book on the iBooks Store: https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewBook?id=881256329 https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewBook?...
- rubiquity 12y agoThanks for clearing that up. I misread the example in the Swift Programming Language reference.
- deleted 12y ago[deleted]
- dilap 12y agoA big one is sum types (which it calls enum, a la rust), which come from ML.