Re: lazy list syntax?

2005-07-29 Thread Aankhen
On 7/29/05, Flavio S. Glock <[EMAIL PROTECTED]> wrote: > Is "for =" only for filehandles? I tried: No, it's for anything that supports iteration... `=$foo` == `$foo.next()`, if I recall correctly. It's probably not yet implemented. Aankhen

Accessing Hash with strings/keys

2005-07-29 Thread Klaas-Jan Stol
Hi, I'm trying to extend the standard Hash PMC, if it returns "None", because there was no value at the specified key, then I want to override this behaviour by returning something else. In order to do that, I should know what methods are called. That's where I'm running into trouble. I can j

Re: End-of-program global destruction is now guaranteed

2005-07-29 Thread Gav....
| | > I look forward to your perl.com article. :) | | It goes up on Thursday afternoon. Would that be 'Porting Test::Builder to Perl 6' ? Excellent Article. As an aside , I am looking for more Perl 6 material, but I would say the 'Perl 6 and Parrot Essentials' is out of date. Is there anything

Re: [perl #36677] Parrot cannot startup if STDERR or STDOUT is closed

2005-07-29 Thread Michael G Schwern
On Thu, Jul 28, 2005 at 12:31:33PM -0700, jerry gay via RT wrote: > i've added a new test t/run/exit.t that checks parrot exit codes under > different scenarios. the 8 subtests all pass on win32. These tests pass, and yet: $ perl -wle 'close STDOUT; system "parrot --version"; print STDERR $? >>

Re: Accessing Hash with strings/keys

2005-07-29 Thread Leopold Toetsch
On Jul 29, 2005, at 10:38, Klaas-Jan Stol wrote: Anybody an idea what I'm doing wrong here? By far the simplest thing is either look at the opcode in ops/core_ops.c or use a debugger and set a breakpoint at the appropriate opcode, e.g. Parrot_set_p_p_kc (or _kic) and step on from there

Re: [perl #36597] [PATCH]Dominance Frontiers

2005-07-29 Thread Patrick R. Michaud
On Thu, Jul 28, 2005 at 03:39:33PM -0400, Andy Dougherty wrote: > On Thu, 28 Jul 2005, Will Coleda wrote: > > > Applying your patch to a pristine build yields only the backtrack.t failure: > > #2 eats 100% of the CPU until I kill it: it doesn't behave that way in > > svn-head. > > I can confirm t

Slurpy "is rw" arrays ([EMAIL PROTECTED] is rw)

2005-07-29 Thread Ingo Blechschmidt
Hi, are the following assumptions correct? sub foo ([EMAIL PROTECTED]) { push @args, 42 } sub bar ([EMAIL PROTECTED] is rw) { push @args, 42 } foo @some_array; # dies ("Can't modify constant array...") bar @some_array; # works, but does not change @some_array, as the

Test::Builder::Module

2005-07-29 Thread Michael G Schwern
I've just implemented the oft requested Test::Builder::Module. Its a superclass for all Test::Builder based modules that implements an import() method to match what Test::More does and a builder() method to get the Test::Builder object. The upshot is that writing a test module is now reduced to t

Re: [perl #36597] [PATCH]Dominance Frontiers

2005-07-29 Thread Leopold Toetsch
Patrick R. Michaud wrote: ... I'm able to reproduce this with the code below Good catch. I'll be very happy to add the above PIR segment to the imcc test suite if someone can tell me which imcc/t/*/*.t file it should go in. Probably time to start a new subdir: imcc/t/cfg/df.t or some

Re: An idea for doing pack.

2005-07-29 Thread David Formosa \(aka ? the Platypus\)
On Thu, 28 Jul 2005 15:46:14 +0300, Yuval Kogman <[EMAIL PROTECTED]> wrote: [...] > I like your Pack object - that is the parsed template, but I'd also > like to be able to generate these templates with a programmatic > interface that isn't string concatenation... > > Is it just a simple data st

Re: Slurpy "is rw" arrays ([EMAIL PROTECTED] is rw)

2005-07-29 Thread Adriano Ferreira
On 7/29/05, Ingo Blechschmidt <[EMAIL PROTECTED]> wrote: > Or is @args always readonly and the declaration ([EMAIL PROTECTED] is rw) is > an > error? The declaration ([EMAIL PROTECTED] is rw) can't be outlawed as it is how Perl 5 default sig translates to Perl 6. IMHO @args as a parameter works

[perl #36683] Test failures on OS X 10.3.9

2005-07-29 Thread via RT
# New Ticket Created by Michael G Schwern # Please include the string: [perl #36683] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/rt3/Ticket/Display.html?id=36683 > The latest parrot build is failing as follows on OS X 10.3.9. Failed Test

Re: GMC for dummies

2005-07-29 Thread Ed Mooring
On Mon, Jul 25, 2005 at 10:33:37PM -0400, Bob Rogers wrote: [snip] > > This is sounding more and more like the CMUCL gencgc algorithm, which > uses what I understand is a classic approach. Instead of an IGP list, > it write-protects all oldspace pages (hence my earlier question), > unprotecting t

[perl #36682] Configure.pl warning

2005-07-29 Thread via RT
# New Ticket Created by Michael G Schwern # Please include the string: [perl #36682] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/rt3/Ticket/Display.html?id=36682 > rsync'ing the latest parrot from cvs.perl.org and running configure on OS X 10.3.9

Re: [perl #36677] Parrot cannot startup if STDERR or STDOUT is closed

2005-07-29 Thread Leopold Toetsch
Michael G Schwern (via RT) wrote: Parrot cannot start up if either STDOUT or STDERR are closed. Fixed in trunk - r8730 Now a Undef PMC is stored as the PIO STDxx PMC. This will give nice effects if you print something. leo

Re: Test::Builder::Module

2005-07-29 Thread Geoffrey Young
Michael G Schwern wrote: > What I'm looking for is ideas about more things it could do that would > be useful for most testing libraries. What scaffolding do module authors > find themselves implementing? if there were a better way to do this: push @ISA, qw(Test::Harness::Straps); $Test:

Re: Test::Builder::Module

2005-07-29 Thread Adrian Howard
On 29 Jul 2005, at 11:31, Michael G Schwern wrote: I've just implemented the oft requested Test::Builder::Module. Its a superclass for all Test::Builder based modules that implements an import() method to match what Test::More does and a builder() method to get the Test::Builder object. N

Re: Test::Builder::STDOUT ?

2005-07-29 Thread Adrian Howard
On 29 Jul 2005, at 06:07, Michael G Schwern wrote: BEGIN { *STDERR = *STDOUT } That'll handle anything, Test::Builder or not. Nope. T::H::S turns analyse_file( 'foo.t' ) into something like open(FILE, "/usr/bin/perl foo.t|" ) so the test script will get it STDERR disassociated from

Re: Test::Builder::STDOUT ?

2005-07-29 Thread Adrian Howard
On 29 Jul 2005, at 02:58, chromatic wrote: If you can use your own test harness, use Test::Harness::Straps::analyze() or Test::Harness::Straps::analyze_fh() to collect STDERR and STDOUT from the tested process. Ah. That would make sense. Much more sensible. Off to play. Adrian

Re: [svn ci] (r8717) Win32 Dynclasses

2005-07-29 Thread Will Coleda
Woot! None of the tests are currently failing on OS X, though there are several TODOs hey. Many (All??) of the failing tests are TODOs: perhaps the test harness isn't happy about TODOs on win32, for some reason. Do TODO tests report as passed in the core suite? If so, it's probably

Re: [perl #36567] t/perl/Parrot_Docs.t doesn't clean up properly.

2005-07-29 Thread Andy Dougherty
On Fri, 15 Jul 2005, Chromatic wrote: > On Fri, 2005-07-15 at 08:27 -0700, Andy Dougherty wrote: > > > After running 'make test', Parrot leaves the following files lying around > > in /tmp. I think there's from t/perl/Parrot_Docs.t. > > > There are two problems: > > 1. Parrot should clean

Complete type inferencing

2005-07-29 Thread Autrijus Tang
On Fri, Jul 29, 2005 at 04:59:21AM +0800, Autrijus Tang wrote: > However, my intuition is that a soft-typed system, with clearly defined > dynamic parts translated to runtime coerce and dependent types, that can > work exactly as Perl 5 did at first, but provide sensible inferencing > and compile-t

Re: Slurpy "is rw" arrays ([EMAIL PROTECTED] is rw)

2005-07-29 Thread TSa (Thomas Sandlaß)
HaloO, Adriano Ferreira wrote: Only sub foobar (@args) { push @args, 42 } would change @some_array in foobar @some_array; That is how I undestood that. Can someone confirm this belief? I share your belief. It's up to others to confirm it. I just want to add that I f

Re: Complete type inferencing

2005-07-29 Thread TSa (Thomas Sandlaß)
HaloO Autrijus, you wrote: Interested readers can consult Manfred Widera's similar work for Scheme, in his "Complete Type Inference in Functional Programming" paper. Uih, you call a 300 page book a paper? I'm impressed. If that is the thing you read between tramp stations here's one of my favo

Re: lazy list syntax?

2005-07-29 Thread Flavio S. Glock
Just wondering - would 'reverse =$foo' call '$foo.previous()' ? - Flavio 2005/7/29, Aankhen <[EMAIL PROTECTED]>: > On 7/29/05, Flavio S. Glock <[EMAIL PROTECTED]> wrote: > > Is "for =" only for filehandles? I tried: > > No, it's for anything that supports iteration... `=$foo` == > `$foo.next()`,

Re: Complete type inferencing

2005-07-29 Thread Autrijus Tang
On Fri, Jul 29, 2005 at 06:36:45PM +0200, "TSa (Thomas Sandla�)" wrote: > you wrote: > >Interested readers can consult Manfred Widera's similar work for Scheme, > >in his "Complete Type Inference in Functional Programming" paper. > > Uih, you call a 300 page book a paper? I'm impressed. Well, it'

Curious use of .assuming in S06

2005-07-29 Thread Autrijus Tang
In S06's Currying section, there are some strange looking examples: &textfrom := &substr.assuming(:str($text) :len(Inf)); &textfrom := &substr.assuming:str($text):len(Inf); &woof ::= &bark:(Dog).assuming :pitch; Why is it allowed to omit comma between adverbial pairs, and even omit

Re: Curious use of .assuming in S06

2005-07-29 Thread Brent 'Dax' Royal-Gordon
Autrijus Tang <[EMAIL PROTECTED]> wrote: > In S06's Currying section, there are some strange looking examples: > > &textfrom := &substr.assuming(:str($text) :len(Inf)); > > &textfrom := &substr.assuming:str($text):len(Inf); > > &woof ::= &bark:(Dog).assuming :pitch; > > Why is it al

Re: Test::Builder::Module

2005-07-29 Thread Michael G Schwern
On Fri, Jul 29, 2005 at 09:06:48AM -0400, Geoffrey Young wrote: > Michael G Schwern wrote: > > What I'm looking for is ideas about more things it could do that would > > be useful for most testing libraries. What scaffolding do module authors > > find themselves implementing? > > if there were

Re: Test::Builder::Module

2005-07-29 Thread Michael G Schwern
On Fri, Jul 29, 2005 at 02:56:53PM +0100, Adrian Howard wrote: > >Calling builder() is safer than Test::Builder->new as it is forward > >compatible for a day when each module will be able to have its own > >Test::Builder object rather than the strict singleton it is now. > [snip] > > In that c

Re: Curious use of .assuming in S06

2005-07-29 Thread Autrijus Tang
On Fri, Jul 29, 2005 at 12:53:03PM -0700, Brent 'Dax' Royal-Gordon wrote: > Autrijus Tang <[EMAIL PROTECTED]> wrote: > > In S06's Currying section, there are some strange looking examples: > > > > &textfrom := &substr.assuming(:str($text) :len(Inf)); > > > > &textfrom := &substr.assuming:

Test::Harness::Straps - changes?

2005-07-29 Thread Adrian Howard
Earlier today chromatic kindly gave me a gentle tap with the cluestick which let me figure out how to give T::H::S STDERR & STDOUT, which means my mates test results are now toddling off to a SQLite database quite happily. However, munging together my own command together with various _pr

Does it cost anything to use a big pmc everywhere?

2005-07-29 Thread Amir Karger
[Accidentally posted to Google Groups first] I'm finally doing some work on Leo's PIR Z-machine interpreter. (I've added about 15 opcodes to the 10 or so he started with. Luckily, he did a lot of the infrastructure stuff that scared me as a PIR newbie. The tester I wrote while developing Plotz pas

Re: Test::Harness::Straps - changes?

2005-07-29 Thread chromatic
On Fri, 2005-07-29 at 22:27 +0100, Adrian Howard wrote: > However, munging together my own command together with various > _private looking methods to pass to IPC::Run3 and then poking around > in a results hash all seems a little gnarly. Only a little? I might have to apply the cluestick wi

Re: Test::Harness::Straps - changes?

2005-07-29 Thread Michael G Schwern
On Fri, Jul 29, 2005 at 02:49:07PM -0700, chromatic wrote: > Only a little? I might have to apply the cluestick with some force. > > > So is there a plan (he asks curiously)? > > I would really like to see objects representing different types of > tests, so that you can decorate the test classes

Re: Test::Builder::STDOUT ?

2005-07-29 Thread Michael G Schwern
On Fri, Jul 29, 2005 at 03:26:17PM +0100, Adrian Howard wrote: > On 29 Jul 2005, at 06:07, Michael G Schwern wrote: > >BEGIN { *STDERR = *STDOUT } > > > >That'll handle anything, Test::Builder or not. > > Nope. T::H::S turns > > analyse_file( 'foo.t' ) > > into something like > > open(F

Re: Test::Harness::Straps - changes?

2005-07-29 Thread chromatic
On Fri, 2005-07-29 at 15:57 -0700, Michael G Schwern wrote: > This is, IMHO, the wrong place to do it. The test should not be > responsible for decorating results, Test::Harness should be. I also meant in Test::Harness. -- c

Re: Test::Harness::Straps - changes?

2005-07-29 Thread Andy Lester
On Fri, Jul 29, 2005 at 03:57:07PM -0700, Michael G Schwern ([EMAIL PROTECTED]) wrote: > This is, IMHO, the wrong place to do it. The test should not be responsible > for decorating results, Test::Harness should be. It means you can decorate > ANY test, not just those that happen to use Test::B

Re: The Use and Abuse of Liskov

2005-07-29 Thread Damian Conway
Luke wrote: A variant a is said to be _more specific than_ a variant b if: * Every type in a's signature is a subset (derived from or equal) of the corresponding type in b's signature. * At least one of these is a proper subset (not an equality). A variant is dispatched i

Lazyness and IO

2005-07-29 Thread David Formosa \(aka ? the Platypus\)
I was thinking about lazyness and IO and worked out this potenial gotcha. In essence its quite simmler to the pipe buffering problems you sometimes can get in perl5. my IO $news = io("nntp://nntp.perl.org",:rw); # Open a nntp connection my $banner = =$news # Throw away the banner. So far so goo