From: Trans Date: 2005-10-07T03:16:52+09:00 Subject: Re: foo= ... the only exception to the implicit-self rule ? > Can you explain what you mean? I'm not getting it. Sure. Simply that there are very few setter methods built-in to Ruby. On top of which almost all are particular to very special contexts. So there's very little chance of surprise if setter methods were in fact to have precendence over locals. -- In other words, one would know every setter and thus know to avoid using it. OTOH, I suppose it might present some issues with dynamic methods. Here's another list by Class/Module instance_method. Between this list and the prior I think that all of them --and there's quite a bit of overlap. require 'yaml' eqmeths = {} [Module,Class].each { |mod| ObjectSpace.each_object(mod) { |c| s = [] s |= c.public_instance_methods(false).select{ |m| m.to_s =~ /=$/ } s |= c.private_instance_methods(false).select{ |m| m.to_s =~ /=$/ } s |= c.protected_instance_methods(false).select{ |m| m.to_s =~ /=$/ } s.reject!{ |e| e !~ /\w/ } eqmeths[c.name] = s unless s.empty? } } puts y eqmeths --- YAML::PrivateType: - type_id= - value= YAML::SpecialHash: - default= YAML::Syck::BadAlias: - name= YAML::BaseEmitter: - options= YAML::Stream: - documents= - options= Process::GID: - eid= YAML::Syck::PrivateType: - type_id= - value= YAML::Syck::DomainType: - type_id= - value= - domain= YAML::YPath: - segments= - flags= - predicates= Dir: - pos= YAML::Syck::Parser: - options= Thread: - priority= - abort_on_exception= Hash: - default= Process: - gid= - egid= - uid= - maxgroups= - euid= - groups= Struct::Tms: - stime= - utime= - cstime= - cutime= Process::UID: - eid= YAML::DomainType: - type_id= - value= - domain= YAML::Syck::Node: - type_id= - value= - anchor= - kind= IO: - lineno= - sync= - pos= YAML::Syck::Loader: - bufsize= - private_types= - families= - anchors= T.