From: Ken Bloom Date: 2007-05-09T09:40:04+09:00 Subject: Re: Funny doc for setter On Sun, 06 May 2007 01:56:18 +0900, John Joyce wrote: > Is it just me or is this funny? > > > ------------------------------------------- Object#instance_variable_set > obj.instance_variable_set(symbol, obj) => obj > ------------------------------------------------------------------------ > Sets the instance variable names by _symbol_ to _object_, thereby > frustrating the efforts of the class's author to attempt to > provide > proper encapsulation. The variable did not have to exist prior to > this call. Yeah, but it doesn't expose anything that didn't already exist in Ruby. If the function didn't exist, you could write it yourself: class Object def instance_variable_set symbol, obj eval "@#{symbol}=obj" end end --Ken -- Ken Bloom. PhD candidate. Linguistic Cognition Laboratory. Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/