Hacker News
points by Joker_vD 2 days ago | 0 comments
> I have implemented one such language, and while it is indeed doing fine, the dots-everywhere syntax really does complicate name resolution.

Can you share an example? In my experience, this only happens with serious reuse of names across both types and values, e.g. with something like

    struct a { 
        struct x {
            typedef int y;
            y x;
        };

        struct y {
            typedef double x;
            x y;
        };

        static x y;
        y x;
    };


    a a;
after which the unified syntax "a.x.y" could either mean a typedefed int from struct x, or a double field from struct y... but why would you even want to support such scenarios? C++, for example, prohibits namespaces from sharing the names with types and values in the same scope, and even though it uses "::" for namespace lookups, it still had to introduce "typename" keyword to explicitly disambiguate the type names from values anyhow so...
Aún no hay comentarios.
Hacker News