Niall Douglas
On 17 Sep 2014 at 20:49, Louis Dionne wrote:
I had not thought about the issue because right now, name clashing is avoided simply by not having two functions with the same name. This has worked well so far. Since this is the simplest way to do things, I'd rather keep it that way. Of course, if I need to introduce a function whose name would clash, then I will strongly consider your suggestion; thank you for that.
namespaces can be used for disambiguation, but they are actually much more useful and powerful than that. You can map namespaces into other namespaces, mash up namespaces into customised variants and with template aliasing you can now easily metaprogram namespacing too, so you could have the results of a Hana operation cause one set of things to be mapped into some destination namespace as against another set of things. And then, you see, a bind() function can actually have metaprogrammed meaning and implementation which is not only neato, but very intuitive for the end user.
I'm not sure I understand you. I do understand how we can map namespaces into other namespaces: namespace A { } namespace B = A; I also understand how we can mash up namespaces: namespace A { } namespace B { } namespace mash { using namespace A; using namespace B; } But I don't understand how template aliases come into play and give me more flexibility. Would you care to give a basic example of what you meant? Thanks, Louis