From: "Nicolas V." Date: 2013-03-21T19:00:07+09:00 Subject: Re: Ruby tainting on primitives Hans Mackowiak wrote in post #1102567: > did you image how to "upgrade the Fixnum into a Bignum."? Fair enough, I was wrong. > > it does not make sense, cause the world of Integer is parted ... little > ones are Fixnum, big ones are Bignum. > > you cant "upgrade" them so that you get an Bignum with the same value as > a fixnum, you need a Holder Class for that, and if you use a > HolderClass, you already have something that can be tainted Which brings me to this point. I think it would be nice if we could use Bignum as HolderClass for Fixnum. For example, `123.to_fixnum` would return a Bignum of value 123. Operations involving a tainted Bignum would preserve the semantics. For example with an addition: BignumTainted + Fixnum -> BignumTainted. Would it be preferable to implement that HolderClass in userland? or in Ruby? -- Posted via http://www.ruby-forum.com/.