by CodeMage · 13y ago · 0 comments
Modules (at least in Python) are singletons.
struct foo {
int bar;
float baz;
};
int get_bar(foo);
float get_baz(foo);
Which would emulate this: class foo {
public:
int get_bar();
float get_baz();
private:
int bar;
float baz;
};
If you're interested, I wrote more about that here: http://loup-vaillant.fr/articles/classes-as-syntactic-sugar