Re: Passing arguments to parrot from C

2005-10-30 Thread Leopold Toetsch
Nick Glencross wrote: Hmmm. still don't think that's what I want. Obviously this is in the context of the NCI callback stuff that I'm looking into -- no surprises there. Ah callbacks again. As these are called by C code, you really should not a function signature at compile-time. In case 2

Re: Passing arguments to parrot from C

2005-10-30 Thread Nick Glencross
Leopold Toetsch wrote: On Oct 30, 2005, at 1:54, Nick Glencross wrote: Quick question... I've been looking through inter_run and extend to see how to pass arguments to a parrot method/function from C, but all the prototypes that I've seen have '...' or 'va_list' to accept the arguments.

Re: Passing arguments to parrot from C

2005-10-30 Thread Leopold Toetsch
On Oct 30, 2005, at 1:54, Nick Glencross wrote: Quick question... I've been looking through inter_run and extend to see how to pass arguments to a parrot method/function from C, but all the prototypes that I've seen have '...' or 'va_list' to accept the arguments. If I don't know what the

Passing arguments to parrot from C

2005-10-29 Thread Nick Glencross
Quick question... I've been looking through inter_run and extend to see how to pass arguments to a parrot method/function from C, but all the prototypes that I've seen have '...' or 'va_list' to accept the arguments. If I don't know what the arguments or their respective types are at compile

Re: passing arguments to HTML::Tidy clean()

2005-08-14 Thread Michael Houghton
I'll dig it out. If you can take it and work out a way to fit it into the existing HTML::Tidy, that would be the big prize, I think - I worked out a way to do this, in part, but I'm not so sure about it now. On 14 Aug 2005, at 16:19, Rhesa Rozendaal wrote: On Aug 14, 2005, at 6:47 AM, jo / ak

Re: passing arguments to HTML::Tidy clean()

2005-08-14 Thread Rhesa Rozendaal
On Aug 14, 2005, at 6:47 AM, jo / ak wrote: Hi, how can arguments be passed to an HTML::Tidy clean() call? Eg. 'char-encoding' => 'latin1' to avoid translation to entities? On 14 Aug 2005, at 14:46, Andy Lester wrote: You can't at this point. Code hasn't been written to support it. --.

Re: passing arguments to HTML::Tidy clean()

2005-08-14 Thread Michael Houghton
Andy - the alternative version of the code I wrote and sent to you will do this. I'm afraid I got busy on other stuff and forgot all about it, and I probably don't have the time to refactor my stuff into yours now, but if you would like to, be my guest. Mike On 14 Aug 2005, at 14:46, Andy L

Re: passing arguments to HTML::Tidy clean()

2005-08-14 Thread Andy Lester
On Aug 14, 2005, at 6:47 AM, jo / ak wrote: Hi, how can arguments be passed to an HTML::Tidy clean() call? Eg. 'char-encoding' => 'latin1' to avoid translation to entities? You can't at this point. Code hasn't been written to support it. --. Andy Lester => [EMAIL PROTECTED] => www.petdanc

passing arguments to HTML::Tidy clean()

2005-08-14 Thread jo / ak
Hi, how can arguments be passed to an HTML::Tidy clean() call? Eg. 'char-encoding' => 'latin1' to avoid translation to entities? Can anyone help? Regards, Jo

Re: passing arguments to tests

2003-09-15 Thread Andrew Savige
Ovid wrote: > --shuffle will shuffle the order in which the tests are run to ensure that > you have no accidental dependency on test order. > > --fast sets and environment variable that can be checked in the test scripts. > For example, if you have a couple of tests that double the time of your tes

Re: passing arguments to tests

2003-09-14 Thread Tels
-BEGIN PGP SIGNED MESSAGE- Moin, On Sunday 14 September 2003 07:37, Andrew Savige wrote: > Ovid wrote: [snip] > functionality seems to be superseded by Apache::TestHarness run() method. > ObDisclaimer: I haven't got a clue what you are talking about, but this bit caught my attention: >

Re: passing arguments to tests

2003-09-13 Thread Andrew Savige
Ovid wrote: > I've just made it available at > http://users.easystreet.com/ovid/cgi_course/downloads/grind.gz > > It needs more work, including allowing descending into directories (via > File::Find or a similar mechanism) and having pre and post actions. > I haven't figured out the best way to do

Re: passing arguments to tests

2003-09-13 Thread Jim Cromie
5.8.1 recently started failing 2 tests in op/cproto.t, on pop(), shift(); this only happens on one box, ie RH-7.2, not RH-9, and I havent tried a make distclean, so I havent reported it to p5p. Instead I decided that some false laziness was in order, and I should go digging. But, I thought it wo

Re: passing arguments to tests

2003-09-13 Thread Adrian Howard
On Thursday, Sep 11, 2003, at 16:38 Europe/London, Ovid wrote: --- Andrew Savige <[EMAIL PROTECTED]> wrote: Oh, that 'grind' looks like a very handy command but I'm a bit confused about how you use it. Is it just a handy general-purpose command or do you use it specifically as part of "make te

Re: passing arguments to tests

2003-09-11 Thread Ovid
--- Andrew Savige <[EMAIL PROTECTED]> wrote: > Oh, that 'grind' looks like a very handy command but I'm a bit > confused about how you use it. Is it just a handy general-purpose > command or do you use it specifically as part of "make test" in > your CPAN distributions? It's a utility that I w

Re: passing arguments to tests

2003-09-11 Thread Andrew Savige
Ovid wrote: > I do something like the following to get this effect: > > #!/usr/bin/perl -w > use strict; > use Test::Harness; > use Getopt::Long; > use Pod::Usage; > > GetOptions( > 'help|?'=> sub { pod2usage(-verbose => 2); exit }, > 'verbose!' => \$Test::Harness::verbos

Re: passing arguments to tests

2003-09-08 Thread Ovid
--- Andrew Savige <[EMAIL PROTECTED]> wrote: > Fergal Daly wrote on 14 July 2003: > > is it possible with Test::Harness and MakeMaker to pass arguments to > > my test scripts? I think it's not but I just want to check for sure. > > The module I'm working on is getting a new "optimised" mode so I'

Re: passing arguments to tests

2003-09-07 Thread Andrew Savige
Fergal Daly wrote on 14 July 2003: > is it possible with Test::Harness and MakeMaker to pass arguments to > my test scripts? I think it's not but I just want to check for sure. > The module I'm working on is getting a new "optimised" mode so I'd like > to be able to run all the tests twice, once

Re: passing arguments to tests

2003-08-20 Thread Michael G Schwern
On Wed, Aug 20, 2003 at 10:34:33PM +1000, Andrew Savige wrote: > Not to mention Semi::Semicolons. I blame Ziggy for that one. > You'll have to take my word for it when I claim that I finally realised > why you'd chosen "Straps" ... right after I pressed the send button. > Maybe after that "is my

Re: Passing arguments to tests

2003-08-20 Thread Andrew Savige
A moron once wrote: > I have a similar problem; I'd like some of my test programs > to generate other test programs on the fly, then run them. > > This seems to work: > > use strict; > use Test::Harness; > my $outf = 'out.tmp'; > print "1..1\n"; > local *SAVOUT; open(SAVOUT, ">&STDOUT"); # save or

Re: passing arguments to tests

2003-08-20 Thread Andrew Savige
Michael G Schwern wrote: > On Wed, Aug 20, 2003 at 07:18:54PM +1000, Andrew Savige wrote: > > I admit to asking my original question as a joke since, as of Perl > 5.6.1, > > Test::Harness was pure functional (Test::Harness::Straps no there). > > However, I am not joking now when I say I have no ide

Re: passing arguments to tests

2003-08-20 Thread Michael G Schwern
On Wed, Aug 20, 2003 at 07:18:54PM +1000, Andrew Savige wrote: > I admit to asking my original question as a joke since, as of Perl 5.6.1, > Test::Harness was pure functional (Test::Harness::Straps no there). > However, I am not joking now when I say I have no idea what "Straps" > means. harness

Re: passing arguments to tests

2003-08-20 Thread Andrew Savige
Michael G Schwern wrote: > On Thu, Jul 24, 2003 at 10:55:57AM +1000, Andrew Savige wrote: >> I'd be interested to see an example of sub-classing Test::Harness. > > See examples/mini_harness.plx in Test::Harness. > > The straps interface is not yet entirely usable. Thanks. Looks interesting. I ad

Re: passing arguments to tests

2003-08-20 Thread Michael G Schwern
On Thu, Jul 24, 2003 at 10:55:57AM +1000, Andrew Savige wrote: > I'd be interested to see an example of sub-classing Test::Harness. See examples/mini_harness.plx in Test::Harness. The straps interface is not yet entirely usable. -- Michael G Schwern[EMAIL PROTECTED] http://www.pobox.c

Re: passing arguments to tests

2003-07-29 Thread Tony Bowden
On Thu, Jul 24, 2003 at 09:17:02AM -0400, Potozniak, Andrew wrote: > &Test::More::is(1,1,"One equals One!!"); > &Test::More::is(1,2,"Does one equal two??"); You probably don't want to be calling those with the & in front of them either as that'll make them bypass the prototype. And as the Test fu

RE: passing arguments to tests

2003-07-28 Thread Nick Ing-Simmons
Andrew Potozniak <[EMAIL PROTECTED]> writes: >>I'm afraid your code won't work. > >As stated below I got it to work with my example :-p > >>Okay, you've subclassed a functional module. But this means that >>you'll be >passing the package name as the first argument, not a test >>name. This will

Re: passing arguments to tests

2003-07-25 Thread Andrew Savige
> #!/usr/bin/perl > use strict; > use warnings; > > sub my_fn { print "in sub my_fn, args='@_'\n" } > > # This happily calls my_fn(): the parameters received by my_fn are > # 'sample.t' and 'def'. But why? > > 'sample.t'->main::my_fn('def'); > > # ... yet this fails with: Can't call method "mai

Re: passing arguments to tests

2003-07-24 Thread Andrew Savige
Andrew P's test program does indeed "work" with Perl 5.8.0 on both Unix and Windows with a test name of 'sample.t' in THDriver.pl, yet changing it to './sample.t' results in a failure of: Can't call method "SUPER::runtests" without a package or object reference. But why? The snippet below (tested

RE: passing arguments to tests

2003-07-24 Thread Potozniak, Andrew
-Original Message- From: chromatic [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 12:56 PM To: Potozniak, Andrew Cc: '[EMAIL PROTECTED]' Subject: Re: passing arguments to tests On Thursday, July 24, 2003, at 09:46 AM, Potozniak, Andrew wrote: >> Correct me

Re: passing arguments to tests

2003-07-24 Thread chromatic
On Thursday, July 24, 2003, at 09:46 AM, Potozniak, Andrew wrote: Correct me if I'm wrong but calling $self->SUPER::somesub calls a sub in the functional context which will not pass the "calling class" along with it. Okay, you're wrong. :) 'SUPER::' is just a hint to the method dispatcher to m

RE: passing arguments to tests

2003-07-24 Thread Potozniak, Andrew
>I'm afraid your code won't work. As stated below I got it to work with my example :-p >Okay, you've subclassed a functional module. But this means that >you'll be >passing the package name as the first argument, not a test >name. This will generate a "this >test does not exist" warning with

RE: passing arguments to tests

2003-07-24 Thread Ovid
I'm afraid your code won't work. > package TestHarnessSubClass; [snip] > #This creates TestHarnessSubClass into a sub class of Test::Harness > use base "Test::Harness"; [snip] > sub runtests{ > my $self = shift; [snip] > $self->SUPER::runtests(@_); > } Okay, you've subclassed a functional mo

RE: passing arguments to tests

2003-07-24 Thread Potozniak, Andrew
iak Administrative Computing Student Assistant State University of New York at Buffalo [EMAIL PROTECTED] 645-3587 x 7123 --- -Original Message- From: Andrew Savige [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 23, 2003 8:56 PM To: Po

Re: passing arguments to tests

2003-07-23 Thread Andrew Savige
"Potozniak, Andrew" wrote: > Create a sub class of Test::Harness and or MakeMaker that will over-ride > all of their methods/subroutines and then add what you want it to do, > don't forget to call super classes' method/subroutine that you are > over-riding. I can give an example of this if need be.

RE: passing arguments to tests

2003-07-23 Thread Potozniak, Andrew
>>Fergal Daly wrote: >> Hi, >> is it possible with Test::Harness and MakeMaker to pass arguments >> to my test scripts? I think it's not but I just want to check for sure. >> The module I'm working on is getting a new "optimised" mode so I'd like >> to be able to run all the tests twice, once

Re: passing arguments to tests

2003-07-23 Thread Andrew Savige
Fergal Daly wrote: > Hi, > is it possible with Test::Harness and MakeMaker to pass arguments > to my test scripts? I think it's not but I just want to check for sure. > The module I'm working on is getting a new "optimised" mode so I'd like > to be able to run all the tests twice, once with

Re: passing arguments to tests

2003-07-14 Thread Danny Faught
What's wrong with creating these as subtests within a single .t file? Are you trying to avoid that? Have you looked at Test::Cmd? If I remember right, it's geared for testing command-line applications rather than modules. FWIW, the black box test harness I used to use allowed specifying an ar

Re: passing arguments to tests

2003-07-13 Thread Paul Johnson
On Sun, Jul 13, 2003 at 04:13:07PM +0100, Fergal Daly wrote: > On Sunday 13 July 2003 15:53, Paul Johnson wrote: > > The way I deal with this is to make a module that does all the heavy > > lifting, give it an appropriate import sub, and then a test reduces to > > something like: > > > > use Tes

Re: passing arguments to tests

2003-07-13 Thread Fergal Daly
On Sunday 13 July 2003 15:53, Paul Johnson wrote: > The way I deal with this is to make a module that does all the heavy > lifting, give it an appropriate import sub, and then a test reduces to > something like: > > use TestX ( opt1 => "x", opt2 => "y" ) > > That covers everything except the pe

Re: passing arguments to tests

2003-07-13 Thread Paul Johnson
On Sun, Jul 13, 2003 at 03:22:43PM +0100, Fergal Daly wrote: > Hi, > is it possible with Test::Harness and MakeMaker to pass arguments to my test > scripts? I think it's not but I just want to check for sure. The module I'm > working on is getting a new "optimised" mode so I'd like to be able to ru

passing arguments to tests

2003-07-13 Thread Fergal Daly
Hi, is it possible with Test::Harness and MakeMaker to pass arguments to my test scripts? I think it's not but I just want to check for sure. The module I'm working on is getting a new "optimised" mode so I'd like to be able to run all the tests twice, once with and once without the opti

Re: Passing arguments

2002-09-30 Thread Paul Johnson
On Sun, Sep 29, 2002 at 09:31:46PM -, Smylers wrote: > Consider this Perl 5: > > while (<>) > { > # ... > foreach my $fruit (qw) > { > # ... > } > } > > Inside the inner loop C<$_> still holds the current line. In the > equivalent Perl 6 syntax, insider the inne

Re: Passing arguments

2002-09-29 Thread Smylers
Paul Johnson wrote: > On Sat, Sep 21, 2002 at 10:05:50AM -, Smylers wrote: > > > Many Perl programs use C<$_> to mean > > 'the current line'. 'A2' gives the Perl 6 syntax for this as: > > > >while $STDIN { > > > > Maybe somewhere in the middle of > > it, it's necessary to have a C loo

Re: Passing arguments

2002-09-21 Thread Luke Palmer
On 21 Sep 2002, Smylers wrote: > Larry Wall wrote: > > > On 20 Sep 2002, Aaron Sherman wrote: > > > > : Does that mean that I can't > > : > > : for $x -> $_ { > > : for $y -> $z { > > : print "$_, $z\n"; > > : } > > : } > > : > > : And exp

Re: Passing arguments

2002-09-21 Thread Paul Johnson
On Sat, Sep 21, 2002 at 10:05:50AM -, Smylers wrote: > Larry Wall wrote: > > > On 20 Sep 2002, Aaron Sherman wrote: > > > > : Does that mean that I can't > > : > > : for $x -> $_ { > > : for $y -> $z { > > : print "$_, $z\n"; > > : } > > :

Re: Passing arguments

2002-09-21 Thread Smylers
Larry Wall wrote: > On 20 Sep 2002, Aaron Sherman wrote: > > : Does that mean that I can't > : > : for $x -> $_ { > : for $y -> $z { > : print "$_, $z\n"; > : } > : } > : > : And expect to get different values? > > That's correct. N

Re: Passing arguments

2002-09-20 Thread Adam D. Lopresto
Personally, I like the looks of sub foo($a, $b is given) { ... } > Does this mean that we allow/encourage uses of $_ other than as a default > for an optional argument? I think it would be less confusing and > error-prone to associate the underscore-aliasing with the parameter $_ > wil

RE: Passing arguments

2002-09-20 Thread Larry Wall
On Fri, 20 Sep 2002, Sean O'Rourke wrote: : On Fri, 20 Sep 2002, Larry Wall wrote: : > The current thinking as of Zurich is that the "given" passes in : > separate from the ordinary parameters: : > : > sub ($a,$b,$c) is given($x) {...} : > : > That binds the dynamically surrounding $_ to $x as

Re: Passing arguments

2002-09-20 Thread Angel Faus
Larry said: > BTW, latest leaning is toward = rather than //= for parameter > defaults, ... Horray! Sorry. Couldn't resist. :-) -angel "Simple men are happy with simple presents"

RE: Passing arguments

2002-09-20 Thread Sean O'Rourke
On Fri, 20 Sep 2002, Larry Wall wrote: > The current thinking as of Zurich is that the "given" passes in > separate from the ordinary parameters: > > sub ($a,$b,$c) is given($x) {...} > > That binds the dynamically surrounding $_ to $x as an out-of-band > parameter. Can also bind to $_ to mak

RE: Passing arguments

2002-09-20 Thread Larry Wall
On 20 Sep 2002, Aaron Sherman wrote: : I assumed that's what C was. It does have the disadvantage of : looking like variable assignment, though. BTW, latest leaning is toward = rather than //= for parameter defaults, since it can, in fact, be undef if the parameter is supplied, while //= seems to

RE: Passing arguments

2002-09-20 Thread Larry Wall
On 20 Sep 2002, Aaron Sherman wrote: : On Fri, 2002-09-20 at 10:36, Larry Wall wrote: : > On Thu, 19 Sep 2002, Brent Dax wrote: : : > : (An aside: it strikes me that you could use C as a scoped lexical : > : alias, i.e. : > : given $bar -> $foo { : > : print $foo; : > : } : : > Sur

RE: Passing arguments

2002-09-20 Thread Larry Wall
On Fri, 20 Sep 2002, Brent Dax wrote: : Larry Wall: : # That binds the dynamically surrounding $_ to $x as an : # out-of-band parameter. Can also bind to $_ to make it the : # current topic. : : The problem I have with that is this: : : sub for_trace(*@array, &block) { : l

RE: Passing arguments

2002-09-20 Thread Aaron Sherman
On Fri, 2002-09-20 at 10:36, Larry Wall wrote: > On Thu, 19 Sep 2002, Brent Dax wrote: > : (An aside: it strikes me that you could use C as a scoped lexical > : alias, i.e. > : given $bar -> $foo { > : print $foo; > : } > Sure, though it also aliases to $_. > Does that mean

RE: Passing arguments

2002-09-20 Thread Brent Dax
Larry Wall: # That binds the dynamically surrounding $_ to $x as an # out-of-band parameter. Can also bind to $_ to make it the # current topic. The problem I have with that is this: sub for_trace(*@array, &block) { loop($_=0; $_ < @array; $_++) {

RE: Passing arguments

2002-09-20 Thread Larry Wall
On Thu, 19 Sep 2002, Brent Dax wrote: : Aaron Sherman: : # topicalize: To default to C<$_> in a prototype (thus : # acquiring the caller's current topic). : : Well, to topicalize a region of code is actually to specify a different : topic, that is, a different value for $_. For example: : :

RE: Passing arguments

2002-09-19 Thread Brent Dax
Aaron Sherman: # topicalize: To default to C<$_> in a prototype (thus # acquiring the caller's current topic). Well, to topicalize a region of code is actually to specify a different topic, that is, a different value for $_. For example: $foo = new X; $bar = new Y;

Re: Passing arguments

2002-09-19 Thread Aaron Sherman
On Sat, 2002-09-14 at 04:16, Luke Palmer wrote: > When a bare closure is defined, it behaves the same as a signatureless > sub. That is, it topicalizes the first argument, and hands them all over > in @_. So your "topic passing" is just, well, passing the topic, like > any ol' argument. Ok,