News for hackers. Stuff that matters.
Re:Swift 2.1 by ecopoesis on Thursday September 24, 2015 @07:52PM (#10275609)
That's not a bug. Your array reference isn't changing, just the data in the object. Scala (which uses var and val for mutable and immutable) would do exactly the same thing.

Heck, even Java (using final to mark immutable) would work like this. This is basically how every OO language works.

Re:Swift 2.1 by myko on Thursday September 24, 2015 @08:20PM (#10275733)
I think the poster understands that, it's just in Swift if you assign a Swift Array (not an NSArray) using let it is immutable both in reference and in whether or not items can be added or removed from it.

That said, it's a quirk of the interop and I don't think Apple should spend time fixing it - rather developers should avoid NSArray within Swift.

Re:Swift 2.1 by seivan on Friday September 25, 2015 @02:22AM (#10276642)
Can't avoid it for everything which is why I'm considering wrapping.