Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In terms of ruby, we may be splitting hairs when it comes to namespaces vs classes. Modules, which are typically used for namespacing, can have state and extend themselves, making them effectively singleton classes.


> Modules, which are typically used for namespacing, can have state

But there's nothing about state that makes it specific to classes. Namespaces in C++ can hold (static) state, for example. So it's actually the other way around: singleton classes can effectively be namespaces/modules.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: