Pseudo namespaces

Dicebot via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 3 12:59:59 PST 2015


On Thursday, 3 December 2015 at 20:51:02 UTC, Andrei Alexandrescu 
wrote:
> I vaguely remembered I saw something like this a while ago:
>
> http://dpaste.dzfl.pl/f11894a098c6
>
> The trick could be more fluent, but it might have merit. Has 
> anyone explored it? Is it a viable candidate for becoming a D 
> idiom?
>
> I was looking at this in conjunction with choosing a naming 
> convention for container functions. Some functions are "stable" 
> so that would be part of their name, e.g. insertStable or 
> stableInsert. With this, it's possible to write 
> lst.stable.insert.
>
>
> Andrei

This isn't any different from namespace struct idiom, is it? I 
don't like it because it forces the namespace usage even if it 
isn't needed. There is something wrong with the module system if 
one needs to resort to idioms like this.

My old finding about how it can be done on importing side : 
http://forum.dlang.org/post/pmezncogehwjnvjrxwns@forum.dlang.org


More information about the Digitalmars-d mailing list