On 17/03/2025 10:37, Alexandru Pătrănescu wrote:

    From what I understand of the proposal, the calling code won't
    know anything different based on it being "nested" or
    "namespaced", it will just see a class with a long name with some
    punctuation in.


The problem for me is not autoloading, but that you can't have the two classes defined at the same time, while using some other punctuation it would allow it.
I believe that there are other operators that we can use, to allow this.


Again, I challenge the premise: why would you want to have both defined at the same time?

Do developers in Java, C#, Kotlin, or Swift complain about this limitation?

Is there any other language which makes a syntax distinction between "class Foo in namespace Bar" and "class Foo nested in class Bar"?



(As a note, and this might have been discussed already, but I would prefer to use the term nested class instead of inner class, as in java the inner classes means non-static classes, and I don't think we should go that way.)

100% agree.

If we did implement something more like "inner classes", a special syntax might make more sense - there would be a very specific relationship between the inner and outer classes. I don't think "has special visibility of members, like a friend-class or file-private feature" needs to be highlighted in the syntax that way.


--
Rowan Tommins
[IMSoP]

Reply via email to