News for hackers. Stuff that matters.
Re:Introducing Swift by solutionyogi on Monday June 02, 2014 @04:27PM (#7836113)
Enumerations (from: https://developer.apple.com/library/prerelease/ios/documenta...):

Unlike C and Objective-C, Swift enumeration members are not assigned a default integer value when they are created. In the CompassPoints example above, North, South, East and West do not implicitly equal 0, 1, 2 and 3. Instead, the different enumeration members are fully-fledged values in their own right, with an explicitly-defined type of CompassPoint.

+100 for that. This will help developer avoid whole class of bugs.

Enumerations also support associated values. Enums in .NET are very poorly defined. Looks like Swift got it right.

Re:Introducing Swift by jevinskie on Monday June 02, 2014 @04:38PM (#7836194)
Indeed. Luckily C++11 took care of the issue on the C++ side.

http://en.wikipedia.org/wiki/C++11#Strongly_typed_enumeratio...

Re:Introducing Swift by platz on Monday June 02, 2014 @06:03PM (#7836779)
Do Swift's enumerations allow recursive definitions?
Re:Introducing Swift by oldguysrule on Sunday June 08, 2014 @04:16AM (#7864256)
>Unlike C and Objective-C, Swift enumeration members are not assigned a default integer value when they are created

Well that’s gonna make storing persistent values tricky.