by comex on 7/24/14, 3:01 AM
Note that as seems to be in vogue these days (Go, Rust), access to a class's methods and fields is never directly tied to code being "inside" the class; even `private` entities are accessible from anywhere in the same source file. I guess this is a good thing, as it avoids awkwardness with anything implemented as a function rather than a method, and works as a substitute for most cases where "friend" would be acceptable coding style in C++.
by austinz on 7/24/14, 1:34 AM
There's also a blog post preceding this one that talks about call-by-name-esque semantics using "@auto_closure"; it's definitely worth a look.
by jackjeff on 7/24/14, 7:11 AM
Anybody else missing "protected" access? Looking at the semantics of "private" I doubt it's coming...
by icodestuff on 7/24/14, 3:11 AM
It's an interesting choice, but I think I'd have rather had a sensible default for each type category than one (internal) for everything. For instances: public classes, public enums, private or internal ivars, public methods, etc. Just to cut down on the boilerplate.
by Dewie on 7/24/14, 2:10 AM
It seems that they have chosen a default (internal, though I don't know how to interpret how "most of the time" works) which is similar to the default modifier in Java. It seems, though, that java's default modifier was maybe ill-chosen, as private and public modifiers seem far more prevalent than no modifier (which means that the default modifier is used) in java code.
by voidlogic on 7/24/14, 2:22 AM
I think its pretty unfortunate Apple chose the name used by OpenStack's Object Storage (Swift)...
by fjcaetano on 7/24/14, 2:09 AM
Finally! If they implement multiple inheritance I think I'll have a nerdgasm!
by keyle on 7/24/14, 2:31 AM
This language feels very unfinished... I've seen 0.8 languages being far more polished. Maybe I'm just biased? Swift looks good though. But it's only as good as the Cocoa framework bindings really.