Re: Smooth numeric upgrades?

2008-10-04 Thread Darren Duncan
Mark Biggar wrote: Handling promotion (and demotion) between single and multi-precision integers is fairly easy. And once you have that doing it for rationals is basically free. Likewise promoting an Integer up to rational is trivial and vice versa. But promotion (or demotion) between IEEE flo

Re: Smooth numeric upgrades?

2008-10-04 Thread Mark Biggar
Handling promotion (and demotion) between single and multi-precision integers is fairly easy. And once you have that doing it for rationals is basically free. Likewise promoting an Integer up to rational is trivial and vice versa. But promotion (or demotion) between IEEE floats and rationals i

Re: Smooth numeric upgrades?

2008-10-04 Thread Bob Rogers
From: Bob Rogers <[EMAIL PROTECTED]> Date: Sat, 4 Oct 2008 22:08:10 -0400 From: "Patrick R. Michaud" <[EMAIL PROTECTED]> Date: Sat, 4 Oct 2008 18:15:57 -0500 . . . All of the mechanisms I've been able to find in Parrot for converting an arbitrary PMC to a num

Re: Smooth numeric upgrades?

2008-10-04 Thread Patrick R. Michaud
On Sat, Oct 04, 2008 at 10:08:10PM -0400, Bob Rogers wrote: > Hmm. My instinct would be to rely on MMD: > > .sub 'infix:*' :multi(Perl6Array,_) > .param pmc a > .param pmc b > $P0 = new 'Integer' > $P0 = a > .return 'infix:*'($P0, b) >

Re: Smooth numeric upgrades?

2008-10-04 Thread Darren Duncan
Patrick R. Michaud wrote: Correct. I suspect that eventually the Rakudo developers will have to develop a custom set of PMCs for Perl 6 behaviors rather than relying on the Parrot ones. I think it would be better for things like unlimited-precision integers and rationals to be Parrot generic

Re: Smooth numeric upgrades?

2008-10-04 Thread Bob Rogers
From: "Patrick R. Michaud" <[EMAIL PROTECTED]> Date: Sat, 4 Oct 2008 18:15:57 -0500 One of the big problems with Parrot's n_* opcodes is that they often assume that the type of the result should be the same as the type of the first operand . . . I kinda thought it wouldn't be that

Re: Smooth numeric upgrades?

2008-10-04 Thread Patrick R. Michaud
On Sat, Oct 04, 2008 at 05:09:47PM -0400, Bob Rogers wrote: Content-Description: message body text >From: "Patrick R. Michaud" <[EMAIL PROTECTED]> >Date: Sat, 4 Oct 2008 09:41:22 -0500 > >On Fri, Oct 03, 2008 at 09:47:38PM -0700, Larry Wall wrote: >> On Fri, Oct 03, 2008 at 11:57:3

Re: Smooth numeric upgrades?

2008-10-04 Thread Bob Rogers
From: "Patrick R. Michaud" <[EMAIL PROTECTED]> Date: Sat, 4 Oct 2008 09:41:22 -0500 On Fri, Oct 03, 2008 at 09:47:38PM -0700, Larry Wall wrote: > On Fri, Oct 03, 2008 at 11:57:30PM -0400, Michael G Schwern wrote: > : What's the status of numeric upgrades in Perl 6? Is see the >

Re: Smooth numeric upgrades?

2008-10-04 Thread Patrick R. Michaud
On Fri, Oct 03, 2008 at 09:47:38PM -0700, Larry Wall wrote: > On Fri, Oct 03, 2008 at 11:57:30PM -0400, Michael G Schwern wrote: > : What's the status of numeric upgrades in Perl 6? Is see the > : docs say "Perl 6 intrinsically supports big integers and rationals > : through its system of type d

Re: Smooth numeric upgrades?

2008-10-04 Thread Tom Christiansen
In-Reply-To: Message from Michael G Schwern <[EMAIL PROTECTED]> of "Sat, 04 Oct 2008 02:06:18 EDT." <[EMAIL PROTECTED]> > Larry Wall wrote: >> The status of numeric upgrades in Perl 6 is fine. It's rakudo that >> doesn't do so well. :) >> >> As another datapoint: >> >> $ pugs -e 'say 2**40'