From: Ryan Davis Date: 2004-11-30T09:53:38+09:00 Subject: Re: REXML::Functions.name == nil On Nov 29, 2004, at 6:30 AM, Florian Gro� wrote: > Ryan Davis wrote: > >> I found this oddity while running ParseTree over every .rb file in >> the ruby libs: >>> irb(main):003:0> REXML::Functions.name >>> => nil >> sure enough, Functions::name is defined. This seems bad to me. It >> also defines id and breaks it too: >>> irb(main):004:0> Class.id >>> => 974456 >>> irb(main):005:0> REXML::Functions.id >>> ArgumentError: wrong number of arguments (0 for 1) >> Can we get these renamed or otherwise make them work with their >> regular semantics? > > I'm not sure about .id as that should not be used anymore anyway, (use > .object_id instead) but for REXML::Functions.name a workaround is to > use Module.instance_method(:name).bind(REXML::Functions).call Until .id is removed from the vocabulary (and probably a long while afterwards so that people can assume backwards compatibility), it shouldn't be overridden. I'm not really looking for a workaround. Either I use the workaround every time I need to get the name of a class, or we get this one instance fixed. I don't find that very acceptable, so for now I have to deal with the possibility of a nil name and just fake it.