.join on Array

2008-06-26 Thread Patrick R. Michaud
Following up to a thread on p6c regarding method fallbacks and .join: * What should [1,3,5].join('-') produce? * How about ([1,3,5], 20).join('-') ? Thanks! Pm

Re: .join on Array

2008-06-26 Thread Moritz Lenz
Patrick R. Michaud wrote: > Following up to a thread on p6c regarding method fallbacks and .join: > > * What should [1,3,5].join('-') produce? I'm pretty sure it should be '1-3-5', because [1,3,5] is an Array ref > * How about ([1,3,5], 20).join('-') ? Probably the same as (~[1,3,5], 20).join

[PATCH] json reimplemented with pct

2008-06-26 Thread Klaas-Jan Stol
without any internet connection at home you get really bored. that means, time for some fun :-) Included is a patch that implements JSON with the PCT. As JSON is just a data description (sub) language, I was not sure what the TOP rule should contain; I decided for now that it would be just * Runn

Rakudo test miscellanea

2008-06-26 Thread Moritz Lenz
This is a more or less random collection of thoughts and questions about the rakudo testing infrastructure. First of all I feel that it's in a rather good shape. I put up a chart of number of tests on http://rakudo.de/ and plan to update it regularly (via cron job once the admin installs Text::C

Re: [perl #56230] [PATCH] Multimethods for Complex.

2008-06-26 Thread Moritz Lenz
Another question: Vasily Chekalkin (via RT) wrote: > +.sub 'sqrt' :multi(Complex) > +.param pmc a > +a = sqrt a > +.return (a) > +.end Do we actually want a sqrt(Complex)? Somebody who is sufficiently mathematically educated to work with complex numbers should now that sqrt() is ambig

[svn ci] :lexid(...)

2008-06-26 Thread Jonathan Worthington
Hi, So before, this would not work out because it found the wrong outer: -- .sub main outer() .end .namespace [ 'Foo' ] .sub outer say "oops" .end .namespace [] .sub outer $P0 = new 'Integer' $P0 = 42 .lex '$a', $P0 test() .end .sub test :outer('outer') $P0 = find_lex '$a'

Re: Rakudo test miscellanea

2008-06-26 Thread Patrick R. Michaud
On Thu, Jun 26, 2008 at 11:36:05AM +0200, Moritz Lenz wrote: > This is a more or less random collection of thoughts and questions about > the rakudo testing infrastructure. > > First of all I feel that it's in a rather good shape. I agree -- it's looking better all of the time. Many thanks to yo

Re: Rakudo test miscellanea

2008-06-26 Thread Moritz Lenz
Patrick R. Michaud wrote: > On Thu, Jun 26, 2008 at 11:36:05AM +0200, Moritz Lenz wrote: >> [...] it would be useful to have an option that makes localtest more >> verbose. Specifically if a script dies, it's not obvious after which >> test it died. > > I'm not exactly sure what is meant here --

Re: Rakudo test miscellanea

2008-06-26 Thread Ryan Richter
On Thu, Jun 26, 2008 at 11:36:05AM +0200, Moritz Lenz wrote: > There seems to be a thorough confusion about numeric types. for example > some tests read like this: is (1.1).WHAT, 'Num'; and then in a different > file is (1.1).WHAT, 'Rat'; That raises two questions for me > 1) should we test for the

Type of literals

2008-06-26 Thread Moritz Lenz
In the test suite there are some tests like this: is(1.WHAT, 'Int', '1 as a literal is an Int); This seems to imply that we guarantee the direct type of literals. But do we? Actually I see no need for that. All my programs work fine if the literal 1 is of type Foo, and Foo isa Int. What's our po

Re: Rakudo test miscellanea

2008-06-26 Thread Moritz Lenz
(cross-posting to p6l) Ryan Richter wrote: > On Thu, Jun 26, 2008 at 11:36:05AM +0200, Moritz Lenz wrote: >> 2) How do we know which numeric type is a class and which is a role? Is >> there an explicit spec about the types of number literals? That could >> have some impact on type checking in th

Re: Rakudo test miscellanea

2008-06-26 Thread Mark J. Reed
On Thu, Jun 26, 2008 at 10:23 AM, Moritz Lenz <[EMAIL PROTECTED]> wrote: > Thanks for the effort, but it also raises new questions. For example: >> Int is Num > Rakudo doesn't do it that way, because the 'A is B' relation in OO means > "Every instance of A is also an Instance of B", which certainly

Re: Rakudo test miscellanea

2008-06-26 Thread Moritz Lenz
Mark J. Reed wrote: > On Thu, Jun 26, 2008 at 10:23 AM, Moritz Lenz > <[EMAIL PROTECTED]> wrote: >> Thanks for the effort, but it also raises new questions. For example: >>> Int is Num >> Rakudo doesn't do it that way, because the 'A is B' relation in OO means >> "Every instance of A is also an Ins

[perl #56382] [RFC] Making Test::Harness 3 available without including it in core parrot.

2008-06-26 Thread via RT
# New Ticket Created by Will Coleda # Please include the string: [perl #56382] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=56382 > I wanted to open a new ticket on this so discussion regarding how we get this in place fo

Re: Rakudo test miscellanea

2008-06-26 Thread Trey Harris
In a message dated Thu, 26 Jun 2008, Moritz Lenz writes: I assume that 'Num' is meant to be a non-complex. Then it seems to make sense to assume: Int is Rat Rat is Num Num is Complex or am I off again? S29 seems to have been assuming this, if I'm reading the multis correctly. -- Trey Harris

Re: Rakudo test miscellanea

2008-06-26 Thread Moritz Lenz
Trey Harris wrote: > In a message dated Thu, 26 Jun 2008, Moritz Lenz writes: >> I assume that 'Num' is meant to be a non-complex. >> Then it seems to make sense to assume: >> Int is Rat >> Rat is Num >> Num is Complex >> or am I off again? > > S29 seems to have been assuming this, if I'm reading

Re: Rakudo test miscellanea

2008-06-26 Thread Patrick R. Michaud
On Thu, Jun 26, 2008 at 10:40:53AM -0400, Trey Harris wrote: > In a message dated Thu, 26 Jun 2008, Moritz Lenz writes: > >I assume that 'Num' is meant to be a non-complex. > >Then it seems to make sense to assume: > >Int is Rat > >Rat is Num > >Num is Complex > >or am I off again? > > S29 seems t

Re: Rakudo test miscellanea

2008-06-26 Thread Ryan Richter
On Thu, Jun 26, 2008 at 04:50:21PM +0200, Moritz Lenz wrote: > What's the alternative? > I don't think it's a good idea to special-case numeric types, and I > don't think it's a good idea to define multis for each numeric type either. > > I assume that 'Num' is meant to be a non-complex. > Then it

Re: Rakudo test miscellanea

2008-06-26 Thread Mark J. Reed
Moritz Lenz> 3.14 would be a Rat or a Float or whatever That's a good question, actually. Does the literal "3.14" get turned into a Float or a Rat? Float is probably simplest, and matches what e.g. Lisp does, but you could argue either way. Especially since many exact decimal literals become ap

Re: Rakudo test miscellanea

2008-06-26 Thread Larry Wall
On Thu, Jun 26, 2008 at 04:50:21PM +0200, Moritz Lenz wrote: : I assume that 'Num' is meant to be a non-complex. : Then it seems to make sense to assume: : Int is Rat : Rat is Num : Num is Complex : or am I off again? Well, there's this little thing called Liskov substitutability... Neither "is"

Re: Rakudo test miscellanea

2008-06-26 Thread Larry Wall
On Thu, Jun 26, 2008 at 12:45:39PM -0400, Mark J. Reed wrote: : Moritz Lenz> 3.14 would be a Rat or a Float or whatever : : That's a good question, actually. Does the literal "3.14" get turned : into a Float or a Rat? Float is probably simplest, and matches what : e.g. Lisp does, but you could a

Re: Rakudo test miscellanea

2008-06-26 Thread Ryan Richter
On Thu, Jun 26, 2008 at 09:55:09AM -0700, Larry Wall wrote: > We could go as far as to guarantee that Nums do rational arithmetic > out to a certain point, but probably what the financial insitutions > want is special fixed-point types that assume a divisor anyway. > Would any financial institution

Re: Type of literals

2008-06-26 Thread Larry Wall
On Thu, Jun 26, 2008 at 04:03:42PM +0200, Moritz Lenz wrote: : In the test suite there are some tests like this: : is(1.WHAT, 'Int', '1 as a literal is an Int); : : This seems to imply that we guarantee the direct type of literals. But : do we? : : Actually I see no need for that. All my programs

Re: Rakudo test miscellanea

2008-06-26 Thread Uri Guttman
> "RR" == Ryan Richter <[EMAIL PROTECTED]> writes: RR> On Thu, Jun 26, 2008 at 09:55:09AM -0700, Larry Wall wrote: >> We could go as far as to guarantee that Nums do rational arithmetic >> out to a certain point, but probably what the financial insitutions >> want is special fixed-poin

Re: Rakudo test miscellanea

2008-06-26 Thread mark . a . biggar
Most financial institutions don't use float, rational or fixed point, they just keep integer pennies. -- Mark Biggar [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] -- Original message -- From: Larry Wall <[EMAIL PROTECTED]> > Would any financial instituti

Re: Rakudo test miscellanea

2008-06-26 Thread Larry Wall
On Thu, Jun 26, 2008 at 09:46:25AM -0700, Larry Wall wrote: : the VM somehow sneaks in the appropriate conversion for us if we : actually try to pass an Int to a Rat. I'd point out that this is fundamentally the same decision point that is reached when we want to do boxing, because we basically ha

Re: [perl #56382] [RFC] Making Test::Harness 3 available without including it in core parrot.

2008-06-26 Thread chromatic
On Thursday 26 June 2008 07:37:46 Will Coleda wrote: > If we went this route, we could avoid including T:H3, and also remove > any of the remaining modules we bundle in lib/ > > Comments? T::H 3 is only a requirement for people who want to type 'make smolder' (and eventually I hope 'make smoke')

Re: [perl #56382] [RFC] Making Test::Harness 3 available without including it in core parrot.

2008-06-26 Thread Michael Peters
chromatic wrote: > T::H 3 is only a requirement for people who want to type 'make smolder' (and > eventually I hope 'make smoke'), so probing for it without bundling it seems > eminently sensible to me. Agreed. That's what we do with TAP::Harness::Archive. -- Michael Peters Plus Three, LP

Re: Rakudo test miscellanea

2008-06-26 Thread Mark J. Reed
On Thu, Jun 26, 2008 at 1:31 PM, <[EMAIL PROTECTED]> wrote: > Most financial institutions don't use float, rational or fixed point, they > just keep integer pennies. I'm not so sure about that. There are lots of financial transactions that deal in sub-$0.01 fractions: taxes, currency conversion,

[perl #38194] [TODO] build - optimize pmc2c.pl

2008-06-26 Thread James Keenan via RT
On #parrot I had some discussion about tools/build/pmc2c.pl with bacek and DietCoke. I pasted some output from dprofpp: http://nopaste.snit.ch/13401 http://nopaste.snit.ch/13402 On the basis of these pastes, I was advised to consider using Memoize.pm to memoize the most frequently called f

Re: [perl #38194] [TODO] build - optimize pmc2c.pl

2008-06-26 Thread Will Coleda
On Thu, Jun 26, 2008 at 2:50 PM, James Keenan via RT <[EMAIL PROTECTED]> wrote: > On #parrot I had some discussion about tools/build/pmc2c.pl with bacek > and DietCoke. I pasted some output from dprofpp: > > http://nopaste.snit.ch/13401 > http://nopaste.snit.ch/13402 > > On the basis of these

Re: [perl #56166] [BUG] [PATCH] Perl::Critic Version Problems

2008-06-26 Thread Will Coleda
On Sun, Jun 22, 2008 at 10:35 PM, Will Coleda via RT <[EMAIL PROTECTED]> wrote: > Attached find a first pass at converting our perlcritic.t into using > Test::Perl::Critic. > > This patch: > > - requires Test::Perl::Critic to do anything useful with the test. (We can > add it to > Bundle::Parrot)

[perl #56166] [BUG] [PATCH] Perl::Critic Version Problems

2008-06-26 Thread James Keenan via RT
FWIW, the part of the patch pertaining to t/codingstd/perlcritic.t did not apply cleanly when I tried it on Linux. That may just indicate that the guts have been ripped out of that file and replaced with mostly new code. Perhaps you could post the complete text of your new version of that file?

Re: Type of literals

2008-06-26 Thread Daniel Ruoso
Qui, 2008-06-26 às 16:03 +0200, Moritz Lenz escreveu: > In the test suite there are some tests like this: > is(1.WHAT, 'Int', '1 as a literal is an Int); > This seems to imply that we guarantee the direct type of literals. But > do we? > Actually I see no need for that. All my programs work fine if

Re: [perl #56346] [PATCH] Check for valid conditions in debug opcodes

2008-06-26 Thread NotFound
More refactor: in addition to the changes in the previous, this also moves the PDB_extend_const_table from src/debug.c to compilers/imcc/pbc.c, because is the only file that uses it and seems to not be related to the debugger (historical reasons?), renames it and makes it static, and add a few auxi

[perl #47794] [BUG] objects - :method doesn't work with :outer()

2008-06-26 Thread Patrick R. Michaud via RT
This appears to have been resolved by jonathan++ in r28716. Way to go Jonathan! Pm

Re: [perl #56166] [BUG] [PATCH] Perl::Critic Version Problems

2008-06-26 Thread Will Coleda
On Thu, Jun 26, 2008 at 4:18 PM, James Keenan via RT <[EMAIL PROTECTED]> wrote: > FWIW, the part of the patch pertaining to t/codingstd/perlcritic.t did > not apply cleanly when I tried it on Linux. > > That may just indicate that the guts have been ripped out of that file > and replaced with mostl

[perl #56166] [BUG] [PATCH] Perl::Critic Version Problems

2008-06-26 Thread James Keenan via RT
Thanks, Coke. On my Linux VM I did not yet have Test::Perl::Critic installed, so I first tested the patch to see if it would DTRT, i.e., skip all. It did. I then installed Test::Perl::Critic via 'cpan' and retested, successfully. (I might add that since the first files to be tested are Configur

[perl #42293] [TODO] t/doc/pod.t vs. tools/doc/pod_errors.pl

2008-06-26 Thread Will Coleda via RT
On Tue Apr 03 21:29:13 2007, coke wrote: > These two scripts perform the same basic task, but do so inconsistently. > > The tools/ script should be removed, and someone should investigate > how it's checking the pod (it finds errors in the current distro > while the test does not.) > > -- > W

[perl #41606] [TODO] Add flag to do runtime check on deprecated ops

2008-06-26 Thread Will Coleda via RT
On Mon Feb 26 02:32:10 2007, kjs wrote: > On Fri Feb 23 14:46:17 2007, [EMAIL PROTECTED] wrote: > > hi, > > > > it might be a good idea to add a flag to parrot that checks at runtime > > whether any deprecated ops are used. > > the flag should be turned off by default; some ops like find_global a

[perl #48445] [TODO] [NQP] - report undeclared variable usage

2008-06-26 Thread Will Coleda via RT
On Mon Dec 10 11:49:08 2007, pmichaud wrote: > > When an NQP program uses a variable that hasn't been > previously declared, it should report a useful error message: > > Use of undeclared variable '$x' at ... > > Pm Looking at this, there doesn't seem to be a way to write a self-hosted test

Re: [perl #41606] [TODO] Add flag to do runtime check on deprecated ops

2008-06-26 Thread chromatic
On Thursday 26 June 2008 20:02:18 Will Coleda via RT wrote: > Attached, find a patch that allows us to specify a ":deprecated" flag (post > op, ala :flow). It also adds a new parrot warning (configurable with > warningson) level called PARROT_WARNING_DEPRECATED_FLAG. The patch only > applies this

[perl #56398] [BUG] lexical inner scope always keeps first lexpad (or something)

2008-06-26 Thread Patrick R. Michaud (via RT)
# New Ticket Created by Patrick R. Michaud # Please include the string: [perl #56398] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=56398 > Earlier today Jonathan was able to implement the :lexid proposal discussed in RT#5