From: Robert Klemme Date: 2013-03-21T02:50:47+09:00 Subject: Re: Ruby tainting on primitives On Wed, Mar 20, 2013 at 6:35 PM, Nicolas V. wrote: > I'd like to use tainting to keep track of some data moving around. > > The fact that numbers are immutable isn't really relevant. The fact that > they're immutable doesn't necessitate they be singletons. But they are singletons. That is a fact. > I realize that Fixnums are implemented as singletons as an optimization, > but that's an implementation detail that shouldn't change the behavior > of tainting. It doesn't. But tainting is associated with the instance. Hence if you taint 0 all empty Arrays and Hashes will return a tainted 0 as result of #size. That doesn't make sense at all. It also won't help you with tracking "data moving around". > Ruby abstracts the implementation of Fixnums in other ways. > For example, running `123.class` suggests that 123 is an instance of > Fixnum. I don't understand why tainting should be different. See above. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/