From: "T. Onoma" Date: 2004-08-21T02:00:00+09:00 Subject: Re: Namespace and modules On Wednesday 19 May 2004 03:58 pm, Kevin Bullock wrote: > Modules define: > 1. namespaces, within which symbols are referenced > 2. mix-ins, which add behavior to another module or class Looking at this I think there are three uses: 1. namespaces, for grouping functionality 2. mix-ins, which add behavior to another module or class 3. service, like namespace but for accessing class-level methods and data Classes themselves can be used for purposes 1 & 3. > These two distinct uses cause some "semantic shear," to paraphrase Neal > Stephenson. > > Taking a different view, though, these two uses can be seen as the same > thing. Modules are more than namespaces, and are thereby more flexible > while still solving the same problems as namespaces. Thus it may not be > Ruby that needs to change (to add explicit namespaces), but our > perspective of it. Perhaps, though I tend to think separation might make for better code. It seems strange when a class is defined within a class. It has no functional significance. Its just something you can do if you'd like. Barring this, I'd rather go in the other direction and have module and class be the same thing. > I haven't fully thought through the module v. namespace distinction, > but these are my current thoughts. Discuss :) Better late than never :) -- T.