> On May 20, 2016, at 11:16 AM, Adrian Zubarev via swift-evolution > <[email protected]> wrote: > >>> >>> On May 20, 2016, at 10:54 AM, Adrian Zubarev via swift-evolution >>> <[email protected] <mailto:[email protected]>> wrote: >>> >>> Can submodules enforce the developer to use its name ’Submodule.SomeClass’? >> >> Ideally we would have flexible import syntax that allows for control over >> *how* names are imported into a lexical context (including the ability to >> import names within a very specific scope if desired). > > Ok fine. > >>> Do I have to re-build submodules when I made any changes to them before >>> building the outside code base? >> >> All submodules are part of the same target as the module that contains them. >> >>> Can they efficiently used for cross decencies between different >>> modules/submodules? >> >> Cross decencies? I don’t understand. > > Sorry it’s me again: "cross dependencies“ > > MainProject (module/package) > > |__Submodule > | |__SubSubmodule > |__AnotherSubmodule > > Can I enforce usage of `AnotherSubmodule.Someclass` inside of > `SubSubmodule`???
With a sufficiently flexible import mechanism you could import `AnotherSubmodule` such that `Someclass` is referenced in the way that you see fit in a specific scope. You could not require all uses to use the full name `AnotherSubmodule.Someclass`. That is a stylistic choice. However, namespaces usually allow for similar flexibility so I don’t see this as a distinction between namespaces and submodules. >>> Empty enums is an abuse of the language! >> >> But it is a practical and effective one. Introducing a new construct like >> namespaces must carry significant advantages over what is already possible. > > Still abuse of the language no matter how you turn it. I don’t say > `namespaces` should only do the same enums do (in my case it would be > enough), if there is more they could solve sure why not. Thats a discussion > is for isn’t it? I’m not an expert so I want to learn from people that might > provide good examples and reasons why namespaces are good or not. Yes, as I mentioned elsewhere, I agree that we need more. But I want us to be clear on what problems we are solving and what capabilities we need. Empty enums are a good point of reference for that discussion as they are what we have today. > > -- > Adrian Zubarev > Sent with Airmail > _______________________________________________ > swift-evolution mailing list > [email protected] <mailto:[email protected]> > https://lists.swift.org/mailman/listinfo/swift-evolution > <https://lists.swift.org/mailman/listinfo/swift-evolution>
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
