But I mean... somehow every other language solved this.
But I mean... somehow every other language solved this.
Did they? C, Lisp, Rust, Python, Ada, Go, Java, C#, ...
They all require you to qualify conflicting names if some other characteristics (for instance the number or types of arguments) don't provide enough information, or outright don't permit it (C, since it has no notion of name spaces).
Can you point to the "every other language[s]" which have solved this problem?
def foo(n):
return n + 2
def foo(n):
return n * 2
foo(3) # which one is called?
(I don't know Unison syntax so using Python for the example)It's still a name clash at compile time.
import {vector} from 'std';
Which I think is a reasonable compromise, you're only bringing vector into scope rather than all of the standard library.
using std::vector;
https://en.cppreference.com/w/cpp/language/namespace#Using-d...And with those C++ namespaces you can do `using some_namespace::some_specific_name;`. Which resolves the issue just like in those other languages.