From: Hugh Sasse Staff Elec Eng Date: 2004-12-02T23:44:08+09:00 Subject: nested defs, what if... This is too half-baked to be an RCR, but here goes... At the moment we cannot write class Thingy def somefunc def newfunc ... end end end OK, fair enough, somefunc is an instance method, so what would newfunc get defined as? It could not be an instance method because it might depend on variables having values which differ in another instance. So, my half-baked idea: let the above code be a shorthand for class Thingy def somefunc class << self def newfunc ... end end end end This would have the [questionable] advantage that it would hide that relatively obscure class << self syntax used in constructing singletons, and it would be better tnan passing a string to instance eval because it would get syntax highlighted by the editor. It is not legal now, so old code would not break. So, now I'll push this idea out and see if it sinks... Hugh