> A bonus is if we can use this same thing for globals. We have a problem today 
> where “Foo.Bar” can’t refer to a member of a module if there’s also a type 
> named “Foo”; changing the syntax to “Foo::Bar” or “Bar from Foo” (or adding 
> it as an alternative) would solve that problem and provide consistency.

So you mean the syntax for module namespacing would be “::” for everything? 
Yeah that would probably solve some other related problems as well. I’m not 
very fond of the “::” separator. But yeah, I think a different separator would 
be better than the “from” keyword, then. Maybe we can come up with a nicer 
separator? the options I can think of are (in order of preference):

Foo:Bar
Foo::Bar
Foo#Bar
Foo@Bar

Anything too different from this would be too exotic. Would there be too much 
problem with a single colon “:”?

struct Baz: Foo:Bar {
  ...
}

let dictionary: [Swift:String: Foo:Bar] = [:]

I’m sensing yes. :(
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to