--MfFXiAuoTsnnDAfZ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 03, 2006 at 02:24:53AM +0900, Sander Land wrote: > My solution consists of two functions which generate new FWI classes > you can use. > By using coerce it supports calculations with any combination of FWI > and normal integers. > > rafb link: http://rafb.net/paste/results/We7miQ42.html > > require 'delegate' > > def UnsignedFWI(bits = 32) > Class.new(DelegateClass(Bignum)) { This is very very nice. I was unsure if DelegateClass would work with Bignum properly because of the Integer/Fixnum/Bignum hierarchy, so I went for the forwardable interface straight away without even trying this. I believe this exhibits the same semantics in respect to coercion as mine, in trying to preserve the type of the first argument. And it is certainly shorter. -Jgen -- The box said it requires Windows 95 or better so I installed Linux --MfFXiAuoTsnnDAfZ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (GNU/Linux) iQEVAwUBRKlCDPy64gyiEfXtAQImMwgAzOuYnWh/nfRa+Quyzmwb55nnREgKCU1V iI3UtKc6nACoS5L5/oa2V0IN9cCX2boZsOm975vGWdBSLF7XwmuoOHWeLJnF8hWU Gp17mAJ97M4b7INZp70LTVHG8WYdE6StaGKnXt7AU0rXKPr1sYzcNdBMpQCPNhOt eQQQqz6poP8SzoV92h56iZiLY4B6yAO51v/7BEGfr9iLgB3CGsG4vSkakw/cH9c+ CwGwYjoRoKtjyGbPrBbWPCypu9HB1LNTGZlQf1zHnw09gE4XGJ/9kDeT+WNPk1va FXSYQ+gckjERtF5rS30G1nSRBSX7dWXz0/cVTTh7BDVL+zrmYbm2jw ï»t -----END PGP SIGNATURE----- --MfFXiAuoTsnnDAfZ--