Re: Proposal: New Bignum

From: Dave Thomas <dave@...>
Date: 2004-04-06 18:20:36 UTC
List: ruby-core #2757
On Apr 6, 2004, at 12:58, Evan Webb wrote:

> My suggestion is that we use the preserve-type model wherever 
> possible, but
> it is most likely what the programmer is expecting.

An alternative, which is more compatible with the existing scheme, 
would be to have MBignum - MBignum potentially return a Fixnum, but 
then have Fixnum handle undefined methods that _are_ defined by bignum 
by converting self to a MBignum and then re-dispatching the message, so

    2.exptmode(e,p)

would always work (by converting '2' to a MBignum and then using 
MBignum's method)


> Cheers

Dave


In This Thread