[swift-build-dev] Namespacing SPM modules (was Re: [swift-dev] Right list?)
Erica Sadun
erica at ericasadun.com
Wed Mar 2 11:46:02 CST 2016
Practical answer: module collision is expected to be a very rare event. Even the need to differentiate NSView.print and Swift.print almost never happens.
Philosophical answer: It is not the role of a language or package manager to interfere with a developer's ability to make bad naming choices.
With regard to your example: I think it's unlikely that anyone would use more than one Alamofire implementation, and if they do, they have control over what name that is given, whether it is Alamofire_1, Alamofire_Network, Network, etc. Renaming is not going to be a common or recommended event.
I'd even go as far as to recommend that the SPManager warn when names are given to packages where there is not a collision.
-- E
> On Mar 2, 2016, at 9:09 AM, Kostiantyn Koval <konstantin.koval1 at gmail.com> wrote:
>
> This looks good but I have 1 concern
> With this functionality the users of a package can change the package name given by author, to own custom.
>
> Example:
> let package = Package(
> name: “MyApp”
> dependencies: [
> .Package(url: "https://github.com/Alamofire/Alamofire <https://github.com/Alamofire/Alamofire>", localName: “Network")
> ]
> )
>
> //App.Swift
> import Network
> …
>
> When reading this code it’s not clear that Network is just name alias for Alamofire without looking at Manifest.swift file.
>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-build-dev/attachments/20160302/ce45239b/attachment.html>
More information about the swift-build-dev
mailing list