Skip to content

Comment on Access Control in Swiftparent

Comments

It's like "protected" access, in Java's terms. Subclasses can't access the default members in Java. That is why it is so rarely used. It was oddly restrictive, and didn't seem like it made much sense in most cases. I don't find this as a bad decision, in Swift. Since you don't normally want to expose the internals of your classes, this was a good choice.

http://docs.oracle.com/javase/tutorial/java/javaOO/accesscon...

I think you might have gotten it wrong?

I think it (Swift's internal/default) is more like "package-private" in Java.

It looks almost exactly like C#'s internal:

http://msdn.microsoft.com/en-us/library/ms173121.aspx

ChrisLattner talks about the java in this recent post if you have access to the apple dev site.

https://devforums.apple.com/message/1010693#1010693

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.