At 11:24 AM 12/1/00 +0000, David Mitchell wrote:
>and Buddha Buck <[EMAIL PROTECTED]> wrote:
>
> > I seem to remember a suggestion made a long time ago that would have the
> > vtable include methods to convert to the "standard types", so that if the
> > calls were b->vtable->add(b,a) (and both operands had to be passed in; 
> this
> > is C we're talking about, not C++ or perl.  OO has to be done manually),
> > then the add routine would do a->vtable->fetchint(a) to get the 
> appropriate
> > value.  Or something like that.  Have I confused something?
>
>That was probably me. (Which means it was probsbly a daft proposal,
>and everyone rightly ignored it ;-)
>The basic idea was that all numeric SV types must provide methods
>that extract their vlaue as an integer or float of a size (abitrarily large)
>specified by the caller, the format of which is a Perl standard.
>For example, one might say:

While nifty, I don't know that perl's going to support numerics with that 
much control over them. (That one's up to Larry) Most likely any 
non-CPU-native numeric support will get tossed into the generic 
bigint/bigfloat/bigcomplex bin and be done with it. (Complex and imaginary 
numbers are part of the C99 standard, FWIW--I just installed a new version 
of Dec C that has preliminary support for it too. Looks nifty...)

How to handle math on objects that aren't on the mainline (int/bigint or 
float/bigfloat) path is a rather dicey thing, and a part of me is really 
tempted to just punt. That's something that'll have to wait for Larry, 
though, since it revolves around what the defined behavior there is.

All the math is easy if the scalars are of known types. Addition and 
multiplication are easy if only one of the scalars involved is of known 
type. Math with both of unknown type, or subtraction and division with the 
right-hand operand of unknown type, is rather more difficult. :(

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to