Mauricio FernáÏdez wrote: > On Sun, Jul 20, 2003 at 02:22:37PM +0900, Joel VanderWerf wrote: > >>As you say, there is only one true; but you still can save state in it: >> >>irb(main):001:0> true.instance_eval {@x = 1} >>1 >>irb(main):002:0> true.instance_eval {@x} >>1 > > > It's hard to achieve thread-safety that way. No worse than a global var, anyway. It wasn't a serious suggestion, just a statement of surprise that it was even possible to set attributes of literals. You can do it for Fixums, too. (From reading the source, I seem to remember that it's not done by storing anything within the object, which is impossible with a Fixnum, but by a big hash mapping objects and instance var names to values.)