Re: Smooth numeric upgrades?

2008-10-05 Thread Michael G Schwern
So, the concrete use-case I'm thinking of here is currency. Darren Duncan wrote: >> [2] "Num" should have an optional limit on the number of decimal places >> it remembers, like NUMERIC in SQL, but that's a simple truncation. > > I disagree. > > For starters, any "limit" built into a type d

Re: Smooth numeric upgrades?

2008-10-05 Thread Darren Duncan
Nicholas Clark wrote: If one has floating point in the mix [and however much one uses rationals, and has the parser store all decimal string constants as rationals, floating point enters the mix as soon as someone wants to use transcendental functions such as sin(), exp() or sqrt()], I can't see

Re: Smooth numeric upgrades?

2008-10-05 Thread Darren Duncan
Michael G Schwern wrote: TSa (Thomas Sandlaß) wrote: I want to stress this last point. We have the three types Int, Rat and Num. What exactly is the purpose of Num? The IEEE formats will be handled by num64 and the like. Is it just there for holding properties? Or does it do some more advanced n

Re: [svn:perl6-synopsis] r14586 - doc/trunk/design/syn

2008-10-05 Thread Larry Wall
On Sun, Oct 05, 2008 at 08:19:42PM -0700, Jon Lang wrote: : <[EMAIL PROTECTED]> wrote: : > Log: : > Add missing series operator, mostly for readability. : : Is there a way for the continuing function to access its index as well : as, or instead of, the values of one or more preceding terms? And/o

Re: Smooth numeric upgrades?

2008-10-05 Thread Darren Duncan
Doug McNutt wrote: At 18:06 +0200 10/5/08, TSa (Thomas Sandlaß) wrote: Another matter is how to represent irrationals. With IEEE floats which are basically non-uniformly spaced integers imprecession is involved anyway. But sqrt(2) is a ratio of two infinite integers. How is that handled? I wou

Re: [svn:perl6-synopsis] r14586 - doc/trunk/design/syn

2008-10-05 Thread Jon Lang
<[EMAIL PROTECTED]> wrote: > Log: > Add missing series operator, mostly for readability. Is there a way for the continuing function to access its index as well as, or instead of, the values of one or more preceding terms? And/or to access elements by counting forward from the start rather than ba

Re: [svn:perl6-synopsis] r14586 - doc/trunk/design/syn

2008-10-05 Thread Larry Wall
On Sun, Oct 05, 2008 at 07:31:30PM -0700, Larry Wall wrote: : @seq := 1 ... { $_ + 1 if @seq < 10 } Actually, that one might not work, since we can't find the length of @seq without knowing how many value the closure will generate. The implicit version would not have that problem. Larry

Re: [svn:perl6-synopsis] r14586 - doc/trunk/design/syn

2008-10-05 Thread Larry Wall
On Mon, Oct 06, 2008 at 09:16:27AM +0800, Xiao Yafeng wrote: : + : > +The function may choose to terminate its list by returning (). : > +Since this operator is list associative, an inner function may be : > +followed by a C<...> and another function to continue the list, : > +and so on. Hence, :

[svn:perl6-synopsis] r14587 - doc/trunk/design/syn

2008-10-05 Thread larry
Author: larry Date: Sun Oct 5 19:14:11 2008 New Revision: 14587 Modified: doc/trunk/design/syn/S03.pod Log: typos Modified: doc/trunk/design/syn/S03.pod == --- doc/trunk/design/syn/S03.pod(original) +++ doc/

Re: [svn:perl6-synopsis] r14586 - doc/trunk/design/syn

2008-10-05 Thread Geoffrey Broadwell
On Sun, 2008-10-05 at 17:05 -0700, [EMAIL PROTECTED] wrote: > +C<< infix:<...> >>, the series operator. Lovely, just lovely. > +1, 3, 5 ... *# odd numbers > +1. 2. 4 ... *# powers of 2 Did you mean to use commas on that second line? -'f

Re: Smooth numeric upgrades?

2008-10-05 Thread Tom Christiansen
In-Reply-To: Message from Nicholas Clark <[EMAIL PROTECTED]> of "Sun, 05 Oct 2008 22:13:14 BST." <[EMAIL PROTECTED]> > Studiously ignoring that request to nail down promotion and demotion, I'm > going to jump straight to implementation, and ask: > If one has floating point in the mix [and ho

[perl #59636] [BUG] t/op/bitwise.t fails on Darwin

2008-10-05 Thread James Keenan via RT
FWIW, this test passed for me on Linux at the same SVN revision. And it has always passed for me on Darwin previously, most recently at r31503 on 20080929.

[perl #59634] [BUG] languages/perl6/t/00-parrot/06-op-inplace.t failure

2008-10-05 Thread James Keenan via RT
Hope this additional diagnostic info helps: $ perl t/harness --verbosity=1 t/00-parrot/06-op-inplace.t t/00-parrot/06-op-inplace 1..11 ok 1 ok 2 ok 3 ok 4 ok 5 ok 6 ok 7 ok 1 ok 9 ok 7 ok 11 All 11 subtests passed Test Summary Report --- t/00-parrot/06-op-inplace (Wstat: 0 T

[svn:perl6-synopsis] r14586 - doc/trunk/design/syn

2008-10-05 Thread larry
Author: larry Date: Sun Oct 5 17:05:41 2008 New Revision: 14586 Modified: doc/trunk/design/syn/S03.pod Log: Add missing series operator, mostly for readability. Modified: doc/trunk/design/syn/S03.pod == --- doc/trun

[perl #59634] [BUG] languages/perl6/t/00-parrot/06-op-inplace.t failure

2008-10-05 Thread James Keenan via RT
On Sun Oct 05 16:53:10 2008, [EMAIL PROTECTED] wrote: > I don't often build Rakudo, so I'm not even sure whether this is the > correct place to report this bug. In any event, this was run on > Linux at r31685. > > make && make test > FWIW, the error was reproduced when I typed: make perl6

Re: [perl #59250] [BUG] MMD bug in FixedPMCArray.sort

2008-10-05 Thread Vasily Chekalkin
Patrick R. Michaud via RT wrote: On Thu, Sep 25, 2008 at 05:05:16AM -0700, Vasily Chekalkin via RT wrote: This bug caused by "runops_args" which doesn't populcate interp->current_args which used in "mmd_arg_tuple_func" to calculate signature for MMD. chromatic has suggested that we should wait

[perl #48108] [BUG] downcase opcode fails on unicode strings w/o icu

2008-10-05 Thread NotFound via RT
Updated information: we added recently a workaround to the utf8 downcase function, by moving code already present out of the ICU #if block. This workaround delegates to the ascii downcase when the string has only codepoints in the ascii range (the way used to do that check is debatable, must be re

[perl #46629] [TODO] [C] Implement multiplication of integers with complex numbers

2008-10-05 Thread NotFound via RT
Done in r31684 after MMD changes, adding the test from the previous patch.

Re: Smooth numeric upgrades?

2008-10-05 Thread Nicholas Clark
On Sat, Oct 04, 2008 at 09:37:29PM -0700, Mark Biggar wrote: > trivial and vice versa. But promotion (or demotion) between IEEE floats > and rationals is really hard and I don't know of a language that even > tries. The major problem is that the demotion from rational to IEEE > float is very l

Re: svn commits via email missing?

2008-10-05 Thread jesse
On Sun, Oct 05, 2008 at 10:43:45AM -0500, Patrick R. Michaud wrote: > We seem to have lost the svn-commit mail updates, I haven't seen > a svn-commit message since r31606 on October 3 (parrot is > currently at r31676). > > Any chance we get could this back? For me it's much easier to > review

[svn:parrot-pdd] r31668 - in trunk: . compilers/imcc compilers/nqp/src compilers/pct/src/PAST compilers/pirc/src config/auto config/gen config/gen/makefiles docs docs/pdds docs/stm editor examples/ben

2008-10-05 Thread allison
Author: allison Date: Sun Oct 5 04:30:01 2008 New Revision: 31668 Modified: trunk/docs/pdds/pdd27_multiple_dispatch.pod Changes in other areas also in this revision: Added: trunk/docs/multidispatch.pod - copied unchanged from r31667, /branches/pdd27mmd/docs/multidispatch.pod trunk

Re: [pugs-commits] r22496 - t/spec/S03-operators

2008-10-05 Thread Moritz Lenz
Patrick R. Michaud wrote: > On Fri, Oct 03, 2008 at 10:02:56AM +0200, [EMAIL PROTECTED] wrote: >> +#?rakudo skip ',=' >> +#?DOES 2 >> +{ >> +my @a = 1, 2; >> +is (@a ,= 3, 4).join('|'), '1|2|3|4', ',= on lists works the same as >> push (return value)' >> +is @a.join('|'), '1|2|3|4',

Re: Should the Length of string_substr() Ever Be Negative?

2008-10-05 Thread Ronald Schmidt
NotFound wrote: But if you talk about perl6, this is not applicable, the perl6 function can have any wanted signature, it will never call the function directly, it emits the opcode that will call it and can insert any check or change of his argument. If the sub implementation allows accidental si

Re: Smooth numeric upgrades?

2008-10-05 Thread Michael G Schwern
TSa (Thomas Sandlaß) wrote: > I want to stress this last point. We have the three types Int, Rat and Num. > What exactly is the purpose of Num? The IEEE formats will be handled > by num64 and the like. Is it just there for holding properties? Or does > it do some more advanced numeric stuff? "Int"

Re: Should the Length of string_substr() Ever Be Negative?

2008-10-05 Thread NotFound
>> But a fake signature makes errors harder to find and can make >> optimized builds works different as normal ones. > > I'm not sure how the signature is "fake". An unsigned integer is a > subset of integer. Parrot doesn't have a set of $U registers for > unsigned ints, does it? I suppose the ro

Re: Smooth numeric upgrades?

2008-10-05 Thread Doug McNutt
On Sunday, 5. October 2008 04:23:42 Darren Duncan wrote: > Note that just as integers are naturally radix independent, the unlimited > rationals should be too, and the latter can compactly represent all > rationals as a triple of integers corresponding roughly to a (normalized) > [mantissa, radix,

Re: Smooth numeric upgrades?

2008-10-05 Thread TSa (Thomas Sandlaß)
HaloO, On Sunday, 5. October 2008 04:23:42 Darren Duncan wrote: > Note that just as integers are naturally radix independent, the unlimited > rationals should be too, and the latter can compactly represent all > rationals as a triple of integers corresponding roughly to a (normalized) > [mantissa,

Re: Should the Length of string_substr() Ever Be Negative?

2008-10-05 Thread Mark J. Reed
On Sun, Oct 5, 2008 at 10:10 AM, NotFound <[EMAIL PROTECTED]> wrote: > But a fake signature makes errors harder to find and can make > optimized builds works different as normal ones. I'm not sure how the signature is "fake". An unsigned integer is a subset of integer. Parrot doesn't have a set

svn commits via email missing?

2008-10-05 Thread Patrick R. Michaud
We seem to have lost the svn-commit mail updates, I haven't seen a svn-commit message since r31606 on October 3 (parrot is currently at r31676). Any chance we get could this back? For me it's much easier to review commits and patches arriving by email than to have to go manually look them up via

Re: [svn:perl6-synopsis] r14585 - doc/trunk/design/syn

2008-10-05 Thread Michael G Schwern
TSa (Thomas Sandlaß) wrote: > Can't we have that as a general feature of all operators? > That is: > >my ($x, $y); > >say $x * $y; # prints 1 >say $x + $y; # prints 0 > > It is a cleaver idea to make the operator choose an appropriate > value for a Nothing value. Why having that only

Re: Should the Length of string_substr() Ever Be Negative?

2008-10-05 Thread NotFound
> I'd say the fact that it has to do checking within the routine anyway > is no reason not to add checks to catch errors earlier. Making the > signature programmer-friendlier is like adding javascript validation > to a web form - sure, the target of the submission still has to do its > own validat

Re: Smooth numeric upgrades?

2008-10-05 Thread Michael G Schwern
Darren Duncan wrote: > 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 > a

Re: [svn:perl6-synopsis] r14585 - doc/trunk/design/syn

2008-10-05 Thread TSa (Thomas Sandlaß)
On Wednesday, 1. October 2008 21:54:12 [EMAIL PROTECTED] wrote: > If you apply an assignment operator to a protoobject, it is assumed that > you are implementing some kind of notional "reduction" to an accumulator > -variable. To that end, the base operator is dropped and a simple > -assignment

Re: Should the Length of string_substr() Ever Be Negative?

2008-10-05 Thread Mark J. Reed
I'd say the fact that it has to do checking within the routine anyway is no reason not to add checks to catch errors earlier. Making the signature programmer-friendlier is like adding javascript validation to a web form - sure, the target of the submission still has to do its own validation, but i

Re: Should the Length of string_substr() Ever Be Negative?

2008-10-05 Thread NotFound
> (I'm making as many parameters and struct members unsigned as possible so that > the compiler can warn us if we ever use signed values with them. This is one > nice way to check some of our assumptions.) But sting_substr is called directly from opcodes, then the simpler way is that his argument

Re: Smooth numeric upgrades?

2008-10-05 Thread Darren Duncan
Darren Duncan wrote: 4.5207196*10**30 -> 45207196*10**37 Before anyone nitpicks, I meant to say on that line: 4.5207196*10**44 -> 45207196*10**37 -- Darren Duncan