C++ namespaces in Ruby

< I beg to differ: first, your statement isn’t true (if I understood you
< correctly). Second, modules are not meant to be instantiated <
directly, which is the same with C++ namespaces.

In reply to my comment that Ruby classes resemble C++ namespaces more
closely than Ruby modules do. Um… I thought that the Pick-axe book
said something along the lines of: “Ruby modules may contain only constants
and functions.” Which seemed to me to be the same as saying that
non-constant objects were not allowed in modules. However, it turns out
that non-constants are permitted in modules, which makes them much more
like C++ namespaces than I’d originally thought. Thanks for pointing this
out Robert! LOL Now all I have to do is prepare to move a number of
functions out of a class and into a module! :slight_smile:



Robert bob.news@gmx.net wrote: