27-Apr-2014 13:04, Andrej Mitrovic via Digitalmars-d пишет:
On 4/27/14, Walter Bright via Digitalmars-d <[email protected]> wrote:
On 4/27/2014 1:16 AM, Andrej Mitrovic via Digitalmars-d wrote:
There's a need for scoping symbols other than in modules,
What is that need?
Here's some examples from Phobos:
std.uni.unicode is a lowercase-named struct because it's supposed to
be used as a namespace:
-----
auto ascii = unicode.ASCII;
-----
Technically it's a functor that works like this:
auto ascii = unicode("ASCII");
Then opDispatch is just a nice bonus to go with it, and struct is the
only shop to offer such goodies.
--
Dmitry Olshansky