perl6-ish idiom for code and tests in one file

2007-01-05 Thread gabriele renzi
Hi everyone, supposing that I want to keep code and tests in one single file, is there a common idiom to do that? At the moment I'm going with something like: if $?FILE == $*PROGRAM_NAME { use Test; plan 1; ok foo(); } but this seem unnecessarily verbose. Is there some standard idio

Re: perl6-ish idiom for code and tests in one file

2007-01-05 Thread Gaal Yahas
On Fri, Jan 05, 2007 at 04:14:27AM +0100, gabriele renzi wrote: > supposing that I want to keep code and tests in one single file, is > there a common idiom to do that? Nice idea! > At the moment I'm going with something like: > > if $?FILE == $*PROGRAM_NAME { > use Test; > plan 1; > ok

Re: [perl #41163] [PATCH] suppress uninitialized value warning in config/inter/yacc.pm

2007-01-05 Thread Lee Duhem
On Thu, Jan 04, 2007 at 10:37:51PM +, Jonathan Worthington wrote: > Lee Duhem (via RT) wrote: > >This patch suppress some uninitialized value warning in > >config/inter/yacc.pm when use --maintainer option at configure. > > > I'm kinda concerned about what will happen if $3 was 0 (and was me

[perl #41186] [BUG]: tools/build/ops2pm.pl: Variable used in both package scope and loop iteration

2007-01-05 Thread via RT
# New Ticket Created by James Keenan # Please include the string: [perl #41186] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=41186 > Particle has asked me to consider testing and refactoring ('phalanxing', for short) to

[perl #41187] [PATCH] fix failed test t/examples/past.t

2007-01-05 Thread Lee Duhem
# New Ticket Created by "Lee Duhem" # Please include the string: [perl #41187] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=41187 > After update to 16418, test t/examples/past.t failed: $ /usr/local/bin/perl t/harness --

Re: perl6-ish idiom for code and tests in one file

2007-01-05 Thread Juerd
gabriele renzi skribis 2007-01-05 4:14 (+0100): > I think it should be possible and nice to use a macro (possibly a > standard subroutine, I'm not sure) like > testing { > ok foo; > } > would it make sense or I'm just crazy? Possible, presumably easy to implement, and a great idea. I love it!

Patterns

2007-01-05 Thread Luke Palmer
I propose that we remove the following two lines from the smart match table in S03: HashAny hash entry existence exists $_{$x} Array Any array contains item* any($_) === $x These are the two lines with Any on the right side. I want to remove these so that we can

Re: Patterns

2007-01-05 Thread Larry Wall
On Fri, Jan 05, 2007 at 08:47:18PM +, Luke Palmer wrote: : I propose that we remove the following two lines from the smart match : table in S03: : :HashAny hash entry existence exists $_{$x} :Array Any array contains item* any($_) === $x : : These are the two

Re: perl6-ish idiom for code and tests in one file

2007-01-05 Thread Larry Wall
On Fri, Jan 05, 2007 at 01:40:44PM +0200, Gaal Yahas wrote: : > I think it should be possible and nice to use a macro (possibly a : > standard subroutine, I'm not sure) like : > : > testing { : > ok foo; : > } : > : > would it make sense or I'm just crazy? : : I like the approach. I think you

Re: Patterns

2007-01-05 Thread Larry Wall
At the moment I'm leaning toward: $pattern.accepts($thing) $pattern.rejects($thing) and going the other way $thing ~~ $pattern $thing.match($pattern) $thing.subst($pattern) and most generally, something like: $thing.does($pattern) $thing.when($pattern) By the way,

Re: [perl #41186] [BUG]: tools/build/ops2pm.pl: Variable used in both package scope and loop iteration

2007-01-05 Thread James E Keenan
James Keenan wrote: # New Ticket Created by James Keenan # Please include the string: [perl #41186] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=41186 > Particle has asked me to consider testing and refactoring ('phal

Re: [perl #41186] [BUG]: tools/build/ops2pm.pl: Variable used in both package scope and loop iteration

2007-01-05 Thread James E Keenan
James Keenan wrote: # New Ticket Created by James Keenan # Please include the string: [perl #41186] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=41186 > Particle has asked me to consider testing and refactoring ('phal

Re: I/O PDD - ready for implementation

2007-01-05 Thread Allison Randal
Jonathan Worthington wrote: I like the look of this, but if I wanted to go about implementing it I feel I'm kinda short of what that means implementation wise. I'm happy enough with flattening composition and all that jazz, but a little extra guidance on what you're expecting to compose into th