Discussion on using module-scoped variables (was 'with' bug?)

Faux Amis faux at amis.com
Tue Nov 6 14:17:11 PST 2012


On 06/11/2012 21:12, Chris Cain wrote:
>
> ... I looked over what you said, and I'm more curious as to what
> you might be using modules for. It seems to me like you're using
> modules similar to a singleton. Would this be correct? Or am I
> missing something?

No, you are correct.
I was annoyed with a lone struct in a module which needed only one 
instantiation and I thought: why not just drop drop the struct 
encapsulation. Static import the module and viola no difference. Also 
makes the code very clean and easy to read.



More information about the Digitalmars-d mailing list