> > But they can be included from other classes/modules, where classes
> > cannot be included.
> > FYI, module inclusion is the only way to implement multiple
> > inheritance in Ruby.
> And perhaps to "simulate" the inner classes feature of Java?

well, not quite. Inner classes are a different kind of beast; an instance
of an inner class has a method fallback to its "lexical parent", which is
an instance of the outer class. an Inner class is private or protected
(never public), and its constructor attaches the caller instance of the
outer class there.

class Foo
	attr_reader :inside

	def initialize
		@inside = Bar.new(self)
	end

	class Bar
		attr_reader :_lparent
		def initialize(lparent)
			@_lparent = lparent
		end
		def method_missing(selector,*args,&proc)
			if _lparent.respond_to?(selector) then
				_lparent.send(selector,*args,&proc)
			else
				super
			end
		end
		def respond_to?(selector)
			super or _lparent.respond_to?(selector)
		end
	end
	def unf
		p "unf"
	end
end

===

the above implementation of inner classes I just wrote is far from ideal.
for instance, the 'caller' method is useless for determining the 'self' of
the caller, but I should only have to call Bar.new instead of
Bar.new(self). Another thing of that Bar should be 'protected' at least,
but (?) it seems that constants are only public (?).

===

btw, Ruby's mixins (= one role of modules) are closest to Java's
"interfaces". 


matju