From: ts Date: 2001-07-02T00:17:15+09:00 Subject: [ruby-talk:17127] Re: Extending existing object pools >>>>> "L" == Lars Christensen writes: 2 small remarks (I've just quickly read it) L> class_eval "def #{sym}=(value); @#{sym} = value; end" class_eval "attr_writer :#{sym}" L> A note on the code: I use instance_variables.include?('@sym') instead of L> @sym.nil? in order to avoid warnings with the -w option. Is there a better L> way? instance_variables inefficiently creates a new array on each L> invokation. defined? @sym Guy Decoux