From: Wilson Bilkovich Date: 2008-05-23T23:43:59+09:00 Subject: Re: [RCR] removal of magical definition of name for some class definition idioms On 5/23/08, Robert Dober wrote: > > Proposal: > > The following behavior should be implemented > > 535/35 > cat classes.rb && ruby1.9 classes.rb > # vim: sw=2 ts=2 ft=ruby expandtab tw=0 nu syn=on: > # file: classes.rb > class K; end > p K.name > classes.rb:5:in `remove_method': method `name' not defined in Class (NameError) > from classes.rb:5:in `' > from classes.rb:4:in `
' > Unfortunately Class#name is very popular in Ruby code. Here, for example, is test/unit's TestCase definition: class TestCase include Assertions include Util::BacktraceFilter attr_reader :method_name STARTED = name + "::STARTED" FINISHED = name + "::FINISHED" What would people use, with your change, to implement such things?