[perl #48164] [TODO] [Tcl] Document the functions in tcl/src/binary.c
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48164] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48164 In languages/tcl/src/binary.c there are several functions which are not yet documented. It would be great of they could be described, as well as their various arguments.
[perl #48162] [TODO] [Tcl] Document what the tcl/src/binary.c file does in the DESCRIPTION
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48162] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48162 In languages/tcl/src/binary.c, the DESCRIPTION section of the pod needs to be written.
Re: [TODO] document (pdd19) or deprecate .get_results directive
On Dec 5, 7:29 am, [EMAIL PROTECTED] (Patrick R . Michaud) wrote: # New Ticket Created by Patrick R. Michaud # Please include the string: [perl #48152] # in the subject line of all future correspondence about this issue. # URL:http://rt.perl.org/rt3/Ticket/Display.html?id=48152 Many exception handlers in the repository use a .get_results directive to obtain the thrown exception object. This directive doesn't seem to be documented anywhere, except in the (highly outdated) compiler_faq.pod document. TODO: (1) adopt .get_results and document it, or (2) deprecate it and identify what is to be used in its place. Pm I think .get_results is syntactic sugar for the get_results op, but allowing for local variables + flags instead of the PASM-style get_results 0,0, a, b In normal cases, get_results is used to retrieve the return values of a call, which seems a bit strange (not intuitive) as you don't call the exception (but I don't know the implementation details) It seems to me you'd want to retrieve the parameters; in Java one would write it like so: try { // do something kinky } catch (Exception e) { } In the catch block, e is the parameter with which the catch block is invoked (it's not really invoked I think, but that's the metaphor here, I think Parrot allows for both labels and subs these days, no?). So, then I would think, wouldn't it be more intuitive to write it like so: .sub main push_eh handler # do something kinky handler: .local pmc exc .get_params exc # handle exc .end I'm not sure how many params could be passed, but if any number, then the :slurpy and other flags could be used. One could even consider writing: .sub main ... handler: .param pmc exc ... .end which is shorter than .local pmc exc; .get_params exc. my 2c, kjs
[perl #48204] [TODO] [cola] Check method signature in gen_arg_list_expr() and find out what type is expected
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48204] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48204 In languages/cola/gen.c:gen_arg_list_expr() there is the todo item: /* FIXME: Here we should check the method signature and find out * what type is expected. */ This needs to be implemented.
[perl #48202] [TODO] [cola] Rewrite push_sym() to call generic Node versions of calls
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48202] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48202 In languages/cola/sym.c:push_sym() there is the todo item: /* Easy FIXME, rewrite below to call above generic Node versions */ This needs to be implemented.
[perl #48200] [TODO] [cola] Add documentation to files and functions
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48200] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48200 Many of the files and functions in cola are as yet not documented. The files need to have an appropriate description (in the DESCRIPTION section of the pod) and the functions need to have their functionality described as well as a short description of the function arguments (if any).
[perl #48196] [TODO] [APL] Should the PMC in set_shape() be cloned?
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48196] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48196 In languages/APL/src/pmc/aplvector.pmc:set_shape() there is the todo item: /* XXX clone this? */ VTABLE_push_pmc(INTERP, SELF, VTABLE_get_pmc_keyed_int(INTERP, SELF, pos)); Should a clone operation be used here? (Or should the operation itself be cloned?). Either way, there is something here which needs cloning, and it'd be great if someone were able to do this.
[perl #48192] [TODO] [amber] Correct overflow issue in integer()
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48192] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48192 In languages/amber/lib/kernel/pmc/amber_string.pmc:integer() there is the todo item: METHOD PMC* integer() { /* XXX OVERFLOW */ which I'm guessing means that there is an overflow problem lurking in this method. This needs to be corrected.
[perl #48184] [TODO] [amber] Use has(index) to check indices in set_item()
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48184] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48184 In languages/amber/lib/kernel/pmc/amber_array.pmc:set_item() there is the todo item: /* XXX --require has(index) */ I *believe* this means that before setting or getting the index that one needs to check that the index exists to begin with, hence one should require has(index) before proceeding further in the method.
[perl #48182] [TODO] [amber] Reject out of range values in item()
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48182] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48182 In languages/amber/lib/kernel/pmc/amber_array.pmc:last() there is the todo item: /* XXX reject out-of-range values (0, or count, or -count) */ So, out of range values need to be detected and properly handled in this method.
[perl #48180] [TODO] [amber] Reject first() and last() methods if count = 0
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48180] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48180 In languages/amber/lib/kernel/pmc/amber_array.pmc there is the todo item associated with the first() and last() methods: /* XXX reject if count = 0 */ It looks like these methods shouldn't be carried out if count = 0. This therefore needs to be implemented.
[ANN] SF parrot win32
I have no personal web site, so I create the project parrotwin32 on sourceforge : http://parrotwin32.sourceforge.net/ This project supplies only binaries for Windows (setup.exe form) of the monthly releases. I hope that help Parrot end-users (on Windows) and promote the use of Parrot. François Perrad.
[perl #48186] [TODO] [amber] Consider using unicode in character()
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48186] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48186 In languages/amber/lib/kernel/pmc/amber_integer.pmc:character() there is the todo item: /* XXX consider Unicode */ One needs to decide if unicode is appropriate in this context and if so, implement its usage.
[perl #48138] [BUG] t/native_pbc/integer.t, t/native_pbc/number.t fail on Darwin
... and on Windows: http://tinyurl.com/2mvrhz So they're pretty much borken all around.
[perl #48218] [PCT] :inline('...') should imply :pasttype('inline')
# New Ticket Created by Jerry Gay # Please include the string: [perl #48218] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48218 when specifying inline pir in past, i've run across a bit of redundancy that can be factored out: $try.push( PAST::Op.new( :inline( new %r, 'Undef'\nstore_lex '$!', %r ), :pasttype('inline') ) could be written as: $try.push( PAST::Op.new( :inline( new %r, 'Undef'\nstore_lex '$!', %r ) ) without any loss of information, since :inline('...') should always imply :pasttype('inline'). ~jerry
Re: [ANN] SF parrot win32
I have no personal web site, so I create the project parrotwin32 on sourceforge : http://parrotwin32.sourceforge.net/ Cool, and I also promoted it at http://perl6.ru/parrotwin32/. But an attempt to run perl6.pbc faied: C:\Program Files\parrot-0.5.0-develbin/parrot.exe languages/perl6/perl6.pbc load_bytecode couldn't find file 'PGE.pbc' current instr.: 'parrot;Perl6::Compiler;__onload' pc 0 (perl6.pir:30) called from Sub 'parrot;Perl6::Compiler;main' pc -1 ((unknown file):-1) Probably setup.exe have to update an environment also? -- Andrew Shitov __ [EMAIL PROTECTED] | http://www.shitov.ru
Re: [perl #48138] [BUG] t/native_pbc/integer.t, t/native_pbc/number.t fail on Darwin
On Wednesday 05 December 2007 09:27:58 James Keenan via RT wrote: ... and on Windows: http://tinyurl.com/2mvrhz So they're pretty much borken all around. What happens when you do: $ parrot -o i.pbc -a - EOF print 0x10203040 end EOF $ mv i.pbc t/native_pbc/integer_${N}.pbc ... and run the integer test again? -- c
[perl #48138] [BUG] t/native_pbc/integer.t, t/native_pbc/number.t fail on Darwin
... and on Linux: http://tinyurl.com/36umpv
Re: Pair notation for number radix
brian d foy writes: In article [EMAIL PROTECTED], Larry Wall [EMAIL PROTECTED] wrote: On Tue, Dec 04, 2007 at 08:28:48AM -0800, brian d foy wrote: : In article [EMAIL PROTECTED], Larry Wall : [EMAIL PROTECTED] wrote: : : : Later in the Literals section of S02, there's a chart of the : : corresponding forms for fat arrow, pair, and paren notation. It has : : : :a = 'foo' :afoo :a(foo) You're confusing various levels here when you say same thing. They're the same in some ways and different in others. Well, I think the documentation is confusing it. If these notations are not the same thing, should there be a table that shows the correspondence of these forms? Those three _are_ all the same thing, in that they all generate pairs. The colon can _also_ be used for forming adverbs (similarly to how the slash can be used for both regexes and division, in different places), but that doesn't effect the equivalence of the above. Smylers
Re: [perl #48108] [BUG] downcase opcode fails on unicode strings w/o icu
On Tuesday 04 December 2007 08:14:41 Patrick R.Michaud wrote: If ICU isn't present, Parrot's Cdowncase opcode always throws an exception. It does this even if the string contains codepoints only in the ascii and/or iso-8859-1 range. For example: $ cat x.pir .sub main :main $S0 = unicode:hello world $S1 = downcase $S0 say $S1 .end $ ./parrot x.pir no ICU lib loaded current instr.: 'main' pc 3 (x.pir:3) This may cause a problem for Perl 6 programs, since the source code is always read as Unicode, and particularly affects the C « and C » characters (codepoints U+00ab and U+00bb). So far the major place I've run into this is in PGE, and I have a workaround there [1], but it will certainly crop up in many other places as we get more Perl 6 programs going. Pm [1] PGE only has to downcase a single character at a time, so instead of doing $S1 = downcase $S0 it can cheat with $I0 = ord $S0 $S1 = chr $I0 $S1 = downcase $S1 This works because chr with codepoints 256 produces strings as either ascii or iso-8859-1, and downcase can work with that. As a workaround (writing Unicode downcasing by hand in the absence of ICU is... tricky), can you convert the strings from Unicode to ISO-8859-1 with the trans_charset op? $I0 = find_charset 'iso-8859-1' $S0 = unicode:Hello world $S0 = trans_charset $S0, $I0 -- c
[perl #48138] [BUG] t/native_pbc/integer.t, t/native_pbc/number.t fail on Darwin
... and the two tests fail on Dragonfly BSD as well, as reported in this smoke test from today: http://tinyurl.com/36hxed
[perl #48198] [TODO] [cola] Add support for member resolution in lookup_type()
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48198] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48198 In languages/cola/type.c:lookup_type() there is the todo item: FIXME: Add support for member resolution (namespace.namespace.type, etc.) This needs to be implemented.
[perl #48194] [TODO] [APL] Move any constant string declarations into class_init()
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48194] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48194 In languages/APL/src/pmc/aplvector.pmc:class_init() there is the todo item: /* XXX: move any constant string declarations here so we just do them once. */ This needs to be done.
[perl #48188] [TODO] [amber] Correct overflow for -maxint in abs()
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48188] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48188 In languages/amber/lib/kernel/pmc/amber_integer.pmc:abs() there is the todo item: /* XXX overflow for -maxint */ There is therefore an overflow issue when trying to handle abs(-maxint). This needs to be corrected.
[perl #48166] [TODO] [Tcl] Variable is claimed before it is used, causing segfault
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48166] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48166 In languages/tcl/src/pmc/tclstring.pmc:get_list() there is the todo item: /* * XXX This prevents a segfault; retval gets claimed before it * it is used below without this register. This shouldn't happen */ Parrot_register_pmc(INTERP, retval); Having to set the register is unnecessary, and should be removed. Before this happens, however, the underlying issue needs to be corrected.
[perl #48218] [PCT] :inline('...') should imply :pasttype('inline')
Added in r23510. Thanks! Pm
[perl #48176] [TODO] [pugs] Warning: use of uninitialized value
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48176] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48176 In languages/pugs/pmc/pugscapture.pmc there are todo items of the form: /* XXX Warning: use of uninitialized value */ This looks very similar to RT#48170 which was in the regex language. Does this todo item mean that we should be *warning* about an uninitialised value here, rather than that there is one in the C code?
[perl #48174] [TODO] [pugs] Store undef for consistency
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48174] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48174 In languages/pugs/pmc/pugscapture.pmc there are todo items which read: /* XXX should store the undef for consistency */ This needs to be implemented
[perl #48172] [TODO] [pugs] Getting nonexistent value, exception or undef?
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48172] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48172 In languages/pugs/pmc/pugscapture.pmc:retval() there is the todo item: /* XXX getting non existent value, exception or undef? It looks like we need to determine at this point whether or not the value we are getting doesn't exist, is an exception, or is undef. Please correct me if I'm wrong!
[perl #48168] [TODO] [regex] Implement init_pmc
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48168] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48168 In languages/regex/pmc/matchrange.pmc:init_pmc() there is the todo item: /* XXX not implemented */ The method needs to be implemented completely.
Re: [ANN] SF parrot win32
On Dec 5, 2007, at 9:38 AM, François Perrad wrote: I have no personal web site, so I create the project parrotwin32 on sourceforge : http://parrotwin32.sourceforge.net/ This project supplies only binaries for Windows (setup.exe form) of the monthly releases. I hope that help Parrot end-users (on Windows) and promote the use of Parrot. Beautiful. Thanks. http://perlbuzz.com/2007/12/parrotwin32-project-provides-prebuilt-windows-exec.html xoxo, Andy -- Andy Lester = [EMAIL PROTECTED] = www.petdance.com = AIM:petdance
Re: Pair notation for number radix
In article [EMAIL PROTECTED], Larry Wall [EMAIL PROTECTED] wrote: On Tue, Dec 04, 2007 at 08:28:48AM -0800, brian d foy wrote: : In article [EMAIL PROTECTED], Larry Wall : [EMAIL PROTECTED] wrote: : : : Later in the Literals section of S02, there's a chart of the : : corresponding forms for fat arrow, pair, and paren notation. It has : : : :a = 'foo' :afoo :a(foo) You're confusing various levels here when you say same thing. They're the same in some ways and different in others. Well, I think the documentation is confusing it. If these notations are not the same thing, should there be a table that shows the correspondence of these forms? If the pair notation shouldn't be used for adverbs, perhaps the documentation shouldn't note a generalized adverbial form of Pair notation. I guess I'll just leave it at that, though, and not bring it up again.
[perl #48206] [TODO] [cola] Check that expression evaluates to a method in gen_method_call()
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48206] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48206 In languages/cola/gen.c:gen_method_call() there is the todo item: /* FIXME: Should check that expression evaluates to a method */ This needs to be implemented.
Re: perl 6 grammar
Jonathan Lang wrote: Another thing to note about given ... when: you don't have to use them together. All that given does is to set $_ to the variable provided; this can be used in a manner similar to with statements in other languages. And when doesn't have to be inside a given block, either: it can be used in any block that sets $_. For example: for @list { when *..^0 { say $_ is negative } when 0 {say $_ is zero } when 0^..* { say $_ is positive } default { say $_ is something else } } or (I think): method test ($value) { setup(); when $value { doit() } #[smart-match the calling object $_ against $value.] } (Question: assuming that the above is valid, would breaking out of the when block be the same as returning from the method? Or would it qualify as an abnormal termination of the method?) I was exactly thinking at the 'with' keyword for given. Even if it is not exactly the same thing. the construct for ... when sounds more natural to me even if here it is with an array, could be : for $operator { '' {} '' {} default {} } but as Mr. Wall said, 2 different things, 2 idioms. -- シリル・デュモン(Cyrille Dumont) [EMAIL PROTECTED] our work is the portrait of ourselves tel: 03-5690-0230 fax: 03-5690-7366 http://www.comquest.co.j
Re: ***SPAM*** Re: perl 6 grammar
Miroslav Silovic wrote: cdumont wrote: In japanese it could even be : wa { '' no baai ni { ... } } Getting rid off the thema or I guess here taking $_ as the default. is this possible : given $operator { '' {} '' {} } ? If Larry doesn't mind me elbowing into the conversation... The unmentioned detail here is that given and when are decoupled; they're not two keywords in the same construct. In other words, given can be used without when and when can be used inside any block. Cgiven only binds $_ and executes a block, it's kind of a single-shot Cfor. So you can do this: given $long_expression_that_is_difficult_to_type_more_than_once { .trim; s:g/!alpha//; .prettify; .indent; say $_; } And Cwhen simply matches the current $_ with its argument. So you can, for example, use it inside Cfor or Cmap: @encoded = map @list:{ when 'black' { 1 } when 'white' { 2 } when /#(.*)/ { $1 } } Miro Thank you for the precision! -- シリル・デュモン(Cyrille Dumont) [EMAIL PROTECTED] our work is the portrait of ourselves tel: 03-5690-0230 fax: 03-5690-7366 http://www.comquest.co.j
[perl #48118] [PATCH] Replace additional instances of '$/'
No complaints; resolving ticket.
[perl #47902] [PATCH] Confine calls to Perl 5 %Config to init::defaults
No complaints; resolving ticket.
[perl #48036] [PATCH] Add --silent option to Parrot configuration
No complaints; resolving ticket.
Re: PDD16 details
Uh... ping? On Mon, Dec 03, 2007 at 11:09:26PM +0100, pancake wrote: I have been looking a bit inside PDDs and parrot source and find no way to load a pointer to a function as a PMC inside the VM. What I want to do is to embed parrot into a C program and make some of the functions of this C program available via NCI to the vm. I have achieved this by using the tip noted in docs/compiler_faq.pod (thanks kjs!) which says I need to pass a null string to loadlib and compile the parent C program with -export-dynamic which is GCC specific... So imho looks like an ugly system- dependant 'hack'. I have found some interesting funcs in src/inter_misc.c but seems not to fix the problem, can anybody give me an appoint? I know that the NCI part is not yet finished, but IMHO these functions should follow the Parrot_ name convention and make them available from the Parrot API. Here's the source: #include parrot/parrot.h void func() { printf(Hello World!\n); } int main(int argc, char **argv) { PMC *method; Parrot_Interp pvm = Parrot_new(NULL); register_nci_method(pvm, enum_class_NCI, func, func, v); Parrot_PackFile pf = Parrot_readbc(pvm, hello.pbc); if (pf == NULL) { fprintf(stderr, Oops. Cannot open hello.pbc\n); return 1; } /* */ Parrot_loadbc(pvm, pf); Parrot_runcode(pvm, argc, argv); Parrot_destroy(pvm); } $ cat hello.pir .sub main :main func() say Hello World .end $ cat Makefile all: parrot -o hello.pbc hello.pir gcc main.c `pkg-config --cflags --libs parrot` -export-dynamic Thanks! --pancake
[perl #48212] make smoke hangs on win32 latest build
# New Ticket Created by # Please include the string: [perl #48212] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48212 I built Parrot revision 23494 using Strawberry Perl 5.8.8 alpha 2 on Windows XP SP2. When I tried running mingw32-make test or mingw32-make smoke, the test build hangs when running t/oo/new.t. When the build gets to this test, the parrot process pegs the CPU and has to be killed manually.
[svn:parrot-pdd] r23504 - trunk/docs/pdds/draft
Author: kjs Date: Wed Dec 5 09:08:50 2007 New Revision: 23504 Modified: trunk/docs/pdds/draft/pdd19_pir.pod Log: [pdd19] * remove some notes about deprecated things that are removed by now. * add .get_results directive. Modified: trunk/docs/pdds/draft/pdd19_pir.pod == --- trunk/docs/pdds/draft/pdd19_pir.pod (original) +++ trunk/docs/pdds/draft/pdd19_pir.pod Wed Dec 5 09:08:50 2007 @@ -338,8 +338,6 @@ above), but string sub names can contain any characters, including characters from different character sets (see LConstants above). -{{ NOTE: the optional comma in the flag list is deprecated RT#45697 }} - Always paired with C.end. =item .end @@ -360,8 +358,6 @@ =head3 Directives used for Parrot calling conventions. -{{ DEPRECATED: the pcc_ prefix. See #45925. }} - =over 4 =item .begin_call and .end_call @@ -420,6 +416,24 @@ {{ TODO: once these flag bits are solidified by long-term use, then we may choose to copy appropriate bits of the documentation to here. }} + +=head3 Catching Exceptions + +Using the Cpush_eh op you can install an exception handler. If an exception +is thrown, Parrot will execute the installed exception handler. In order to +retrieve the thrown exception, use the C.get_results directive. + + push_eh handler + ... + handler: + .local pmc exception + .local string message + .get_results (exception, message) + ... + +This is syntactic sugar for the Cget_results op, but any flags set on the +targets will be handled automatically by the PIR compiler. + =head2 Syntactic Sugar Any PASM opcode is a valid PIR instruction. In addition, PIR defines some
[perl #48226] [Patch] Option 'exec' for Parrot::Test::Harness
# New Ticket Created by Bernhard Schmalhofer # Please include the string: [perl #48226] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48226 Hi, when trying to convert languages/eclectus/t/harnes to Parrot::Test::Harness, I found that P::T::H did not pass the 'exec' option to TAP::Harness. So I added the 'exec' option, and removed the probably obsolete '--gc-debug' hack. Things look fine on 'Kunbuntu 7.10' with Perl 5.8.8 and Test::Harness 3.04. Could sombody test-savy have a second look at this patch? 'petite' is available at http://www.scheme.com/petitechezscheme.html Regards, Bernhard Index: lib/Parrot/Test/Harness.pm === --- lib/Parrot/Test/Harness.pm (Revision 23505) +++ lib/Parrot/Test/Harness.pm (Arbeitskopie) @@ -7,8 +7,8 @@ =head1 SYNOPSIS -Tell the harness which language (and optionally, compiler) you want to use in a -file called Ft/harness: +Tell the harness which language, and optionally compiler or other executable, +you want to use in a file called Ft/harness: use Parrot::Test::Harness language = 'punie'; @@ -16,20 +16,30 @@ use Parrot::Test::Harness language = 'perl6', compiler = 'perl6.pbc'; -That's it. Seriously. + # or + use Parrot::Test::Harness language = 'perl6', compiler = 'perl6.pbc'; + + # or + + use Parrot::Test::Harness language = 'eclectus', exec = [ 'petite', '--script' ]; + +That's it. Seriously. + =head1 DESCRIPTION -This module provides a basic test harness for Parrot-hosted languages. Right -now it parameterizes the two parameters that at least three language +This module provides a basic test harness for Parrot-hosted languages. Right +now it parameterizes the three parameters that at least four language implementations need. If you really want, you can pass a third option to the Cuse line. Carguments should be an array reference containing additional arguments (as you might find on the command line). -If you don't pass a Ccompiler argument pair, the harness will run the tests -with Cperl. If you Ido pass the pair, the harness will run the tests with +If you don't pass a Ccompiler or Cexec argument pair, the harness will run the tests +with Cperl. If you Ido pass one of these pairs, the harness can use another executable. +For Cexec a reference to a an array of string is expected. +For Ccompiler the harness will run the tests with Cparrot, calling the Ccompiler file as the first argument. This means that you can write your tests in your language itself and run them @@ -38,7 +48,7 @@ =head1 AUTHOR -written by chromatic with most of the intelligence stolen from the Punie +Written by chromatic with most of the intelligence stolen from the Punie harness and most of that probably stolen from Test::Harness Please send patches and bug reports via Parrot's RT queue or to the mailing @@ -58,13 +68,14 @@ sub set_flags { my %options = @_; $ENV{HARNESS_VERBOSE} = 1; -$ENV{HARNESS_PERL} ||= '../../parrot ./' . $options{compiler} -if $options{compiler}; +if ( $options{exec} ) { +$ENV{HARNESS_PERL} ||= join q{ }, @{$options{exec}}; +} +elsif ( $options{compiler} ) { +$ENV{HARNESS_PERL} ||= join q{}, ../../parrot ./$options{compiler}; +} -# Per Leo on 18APR2005, run the test suite with --gc-debug -if ( $ENV{TEST_PROG_ARGS} $ENV{TEST_PROG_ARGS} !~ /\b--gc-debug\b/ ) { -$ENV{TEST_PROG_ARGS} .= --gc-debug; -} +return; } sub get_files { @@ -123,11 +134,12 @@ exit unless my @files = get_files(%options); if (eval { require TAP::Harness; 1 }) { -my %options = $options{compiler} -? ( exec = [ '../../parrot', './' . $options{compiler} ] ) -: (); -my $harness = TAP::Harness-new( \%options ); -$harness-runtests( @files ); +my %options = + $options{exec} ? ( exec = $options{exec} ) +: $options{compiler} ? ( exec = [ '../../parrot', './' . $options{compiler} ] ) +: (); +TAP::Harness-new( \%options )-runtests( @files ); + return; } Index: languages/eclectus/t/harness === --- languages/eclectus/t/harness (Revision 23505) +++ languages/eclectus/t/harness (Arbeitskopie) @@ -2,7 +2,7 @@ =head1 NAME -languages/eclectus/t/harness - A harness for scheme +languages/eclectus/t/harness - A harness for Eclectus =head1 SYNOPSIS @@ -20,19 +20,12 @@ use strict; use warnings; use 5.008; +use lib qw( ../lib ../../lib ../../lib ); -use TAP::Harness (); -use File::Spec; +use Parrot::Test::Harness language = 'eclectus', exec = [ 'petite', '--script' ]; -my @test_files = glob( File::Spec-catfile( 't', '*.t' ) ); - -TAP::Harness-new( -{ exec = [ 'petite', '--script' ], -}
[perl #43326] [TODO] config/auto/pmc.pm: Write unit tests
No complaints; resolving ticket.
[perl #48190] [TODO] [amber] Can null variable check be reinstated by generating n_neg instead of neg?
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48190] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48190 In languages/amber/lib/kernel/pmc/amber_integer.pmc:neg() there is the todo item: /* if (!dest) --TODO: can we reinstate this if we generate n_neg instead of neg? */ So, can the check to see if dest is NULL be reinstated if n_neg is generated instead of neg? Work out if this is the case, implement if so, delete the line contating the TODO item if not.
Re: [perl #48138] [BUG] t/native_pbc/integer.t, t/native_pbc/number.t fail on Darwin
On Dec 5, 2007, at 12:49 PM, chromatic via RT wrote: On Wednesday 05 December 2007 09:27:58 James Keenan via RT wrote: ... and on Windows: http://tinyurl.com/2mvrhz So they're pretty much borken all around. What happens when you do: $ parrot -o i.pbc -a - EOF print 0x10203040 end EOF $ mv i.pbc t/native_pbc/integer_${N}.pbc ... and run the integer test again? -- c On Linux/x86: [parrot] 515 $ ./parrot -o i.pbc -a - EOF print 0x10203040 end EOF [parrot] 516 $ mv i.pbc t/native_pbc/integer_${N}.pbc [parrot] 517 $ prove -v t/native_pbc/integer.t t/native_pbc/number.t t/native_pbc/integer1..1 # Failed test (t/native_pbc/integer.t at line 56) # Exited with error code: [SIGNAL 11] # Received: # # Expected: # 270544960 not ok 1 - i386 32 bit opcode_t, 32 bit intval # Looks like you failed 1 test of 1. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay t/native_pbc/number.1..1 not ok 1 - i386 double float 32 bit opcode_t # Failed test (t/native_pbc/number.t at line 86) # got: '012345678910111213141516171819202122232425' # expected: '1.00 # 4.00 # 16.00 # 64.00 # 256.00 # 1024.00 # 4096.00 # 16384.00 # 65536.00 # 262144.00 # 1048576.00 # 4194304.00 # 16777216.00 # 67108864.00 # 268435456.00 # 1073741824.00 # 4294967296.00 # 17179869184.00 # 68719476736.00 # 274877906944.00 # 1099511627776.00 # 4398046511104.00 # 17592186044416.00 # 70368744177664.00 # 281474976710656.00 # 1125899906842620.00 # ' # Looks like you failed 1 test of 1. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay Failed TestStat Wstat Total Fail Failed List of Failed --- t/native_pbc/integer.t1 256 11 100.00% 1 t/native_pbc/number.t 1 256 11 100.00% 1 Failed 2/2 test scripts, 0.00% okay. 2/2 subtests failed, 0.00% okay. On Darwin/PPC (r23512): [parrot] 505 $ ./parrot -o i.pbc -a - EOF print 0x10203040 end EOF [parrot] 506 $ mv i.pbc t/native_pbc/integer_${N}.pbc [parrot] 507 $ prove -v t/native_pbc/integer.t t/native_pbc/number number.t number_2.pbc number_4.pbc number_1.pbc number_3.pbc number_5.pbc [parrot] 507 $ prove -v t/native_pbc/integer.t t/native_pbc/number.t t/native_pbc/integer1..1 not ok 1 - i386 32 bit opcode_t, 32 bit intval # Failed test (t/native_pbc/integer.t at line 56) # Exited with error code: [SIGNAL 11] # Received: # # Expected: # 270544960 # Looks like you failed 1 test of 1. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay t/native_pbc/number.1..1 not ok 1 - i386 double float 32 bit opcode_t # Failed test (t/native_pbc/number.t at line 86) # got: '012345678910111213141516171819202122232425' # expected: '1.00 # 4.00 # 16.00 # 64.00 # 256.00 # 1024.00 # 4096.00 # 16384.00 # 65536.00 # 262144.00 # 1048576.00 # 4194304.00 # 16777216.00 # 67108864.00 # 268435456.00 # 1073741824.00 # 4294967296.00 # 17179869184.00 # 68719476736.00 # 274877906944.00 # 1099511627776.00 # 4398046511104.00 # 17592186044416.00 # 70368744177664.00 # 281474976710656.00 # 1125899906842620.00 # ' # Looks like you failed 1 test of 1. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay Failed TestStat Wstat Total Fail List of Failed --- t/native_pbc/integer.t1 256 11 1 t/native_pbc/number.t 1 256 11 1 Failed 2/2 test scripts. 2/2 subtests failed. Files=2, Tests=2, 10 wallclock secs ( 0.31 cusr + 0.19 csys = 0.50 CPU) Failed 2/2 test programs. 2/2 subtests failed. Summary: no change in results; both tests still failing
[perl #48170] [TODO] [regex] Remove 'use of uninitialized value' issues in match.pmc
# New Ticket Created by Paul Cochrane # Please include the string: [perl #48170] # in the subject line of all future correspondence about this issue. # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=48170 In languages/regex/pmc/match.pmc there are a couple of todo items which read: /* XXX Warning: use of uninitialized value */ It seems that in order to get to where the todo items are, a variable has been assigned as NULL, and this causes the warning? I'm not 100% sure... Anyway, there is an issue here which needs correcting.
Re: [perl #48226] [Patch] Option 'exec' for Parrot::Test::Harness
On Wednesday 05 December 2007 14:20:34 Bernhard Schmalhofer wrote: when trying to convert languages/eclectus/t/harnes to Parrot::Test::Harness, I found that P::T::H did not pass the 'exec' option to TAP::Harness. So I added the 'exec' option, and removed the probably obsolete '--gc-debug' hack. Things look fine on 'Kunbuntu 7.10' with Perl 5.8.8 and Test::Harness 3.04. Could sombody test-savy have a second look at this patch? Everything looks reasonable to me, except q{} versus q{ } which are barely discernable and offers (to my mind) only disadvantages over '' versus ' ' which is much more distinguishable. -- c
Re: PDD16 details
On Monday 03 December 2007 14:09:26 pancake wrote: I have been looking a bit inside PDDs and parrot source and find no way to load a pointer to a function as a PMC inside the VM. What I want to do is to embed parrot into a C program and make some of the functions of this C program available via NCI to the vm. I have achieved this by using the tip noted in docs/compiler_faq.pod (thanks kjs!) which says I need to pass a null string to loadlib and compile the parent C program with -export-dynamic which is GCC specific... So imho looks like an ugly system- dependant 'hack'. I have found some interesting funcs in src/inter_misc.c but seems not to fix the problem, can anybody give me an appoint? I know that the NCI part is not yet finished, but IMHO these functions should follow the Parrot_ name convention and make them available from the Parrot API. Is there any reason you're not using the NCI opcodes from within PIR? That's the easy way to do it. -- c
Re: [perl #48138] [BUG] t/native_pbc/integer.t, t/native_pbc/number.t fail on Darwin
On Wednesday 05 December 2007 17:46:19 James E Keenan wrote: [parrot] 506 $ mv i.pbc t/native_pbc/integer_${N}.pbc In that step, replace ${N} with the test number, that is, integer_1.pbc, integer_2.pbc, etc. Otherwise the test will use the same .pbc files it was failing on before, and the failures won't be any more interesting. As there's only one test in each file, you only have to do that for integer_1.pbc and number_1.pbc (though I think the number test recommends doing something slightly different; there's a comment early in the code). I'm getting a lot sick of keeping those .pbc files up to date, so either someone has to figure out how to regenerate them when necessary or we whack the tests for now, until we stop invalidating PBC every week. -- c
Re: [perl #48138] [BUG] t/native_pbc/integer.t, t/native_pbc/number.t fail on Darwin
On Dec 5, 2007, at 9:12 PM, chromatic via RT wrote: On Wednesday 05 December 2007 17:46:19 James E Keenan wrote: [parrot] 506 $ mv i.pbc t/native_pbc/integer_${N}.pbc In that step, replace ${N} with the test number, that is, integer_1.pbc, integer_2.pbc, etc. Otherwise the test will use the same .pbc files it was failing on before, and the failures won't be any more interesting. On both Darwin and Linux, the integer.t now passes; number.t continues to fail. Here's the Linux output: [li11-226:parrot] 517 $ prove -v t/native_pbc/integer.t \ t/native_pbc/number.t t/native_pbc/integer1..1 ok 1 - i386 32 bit opcode_t, 32 bit intval ok t/native_pbc/number.1..1 not ok 1 - i386 double float 32 bit opcode_t # Failed test (t/native_pbc/number.t at line 86) # Exited with error code: [SIGNAL 11] # Received: # # Expected: # 1.00 # 4.00 # 16.00 # 64.00 # 256.00 # 1024.00 # 4096.00 # 16384.00 # 65536.00 # 262144.00 # 1048576.00 # 4194304.00 # 16777216.00 # 67108864.00 # 268435456.00 # 1073741824.00 # 4294967296.00 # 17179869184.00 # 68719476736.00 # 274877906944.00 # 1099511627776.00 # 4398046511104.00 # 17592186044416.00 # 70368744177664.00 # 281474976710656.00 # 1125899906842620.00 # # Looks like you failed 1 test of 1. dubious Test returned status 1 (wstat 256, 0x100) DIED. FAILED test 1 Failed 1/1 tests, 0.00% okay Failed Test Stat Wstat Total Fail List of Failed --- t/native_pbc/number.t1 256 11 1 Failed 1/2 test scripts. 1/2 subtests failed. Files=2, Tests=2, 2 wallclock secs ( 0.08 cusr + 0.01 csys = 0.09 CPU) Failed 1/2 test programs. 1/2 subtests failed.
[svn:perl6-synopsis] r14471 - doc/trunk/design/syn
Author: larry Date: Wed Dec 5 20:50:15 2007 New Revision: 14471 Modified: doc/trunk/design/syn/S02.pod Log: Some clarifications requested by brian d foy++ Modified: doc/trunk/design/syn/S02.pod == --- doc/trunk/design/syn/S02.pod(original) +++ doc/trunk/design/syn/S02.podWed Dec 5 20:50:15 2007 @@ -12,9 +12,9 @@ Maintainer: Larry Wall [EMAIL PROTECTED] Date: 10 Aug 2004 - Last Modified: 3 Dec 2007 + Last Modified: 5 Dec 2007 Number: 2 - Version: 120 + Version: 121 This document summarizes Apocalypse 2, which covers small-scale lexical items and typological issues. (These Synopses also contain @@ -2136,9 +2136,42 @@ a = $$a:$$a a = @$$a :@$$a (etc.) a = %fooa%fooa:p +'' = $x:($x) +'' = x :x +'' = ($x,$y) :($x,$y) +'' = [$x,$y] :[$x,$y] +'' = {$x = $y}:{$x = $y} + +The fatarrow construct may be used only where a term is expected +because it's considered an expression in its own right, since the +fatarrow is parsed as a normal infix operator (even when autoquoting an +identifier on its left). The adverbial forms are considered special +tokens and are recognized in various positions in addition to term +position. In particular, when used where an infix would be expected +they modify the previous operator, ignoring the intervening term or +parenthesized argument. The form is also used to rename parameter +declarations and to modify the meaning of various quoting forms. +When appended to an identifier, the adverbial syntax is used to +generate variants of that identifier; this syntax is used for +naming operators such as C infix:+ and multiply dispatched +grammatical rules such as statement_control:if. When so used the +adverb is considered part of the name, so C infix:+ and C +infix:- are two different operators. Likewise C prefix:+ + is different from C infix:+ . + +Either fatarrow or adverbial pair notation may be used to pass named arguments as +terms to a function or method. After a call with parenthesized arguments, +only adverbial syntax may be used to pass additional arguments. This is typically +used to pass an extra block: + +find($directory) :{ when not /^\./ } + +This actually falls out from the preceding rules because the adverbial block is in +operator position, so it modifies the find operator. Note that as usual the C{...} form can indicate either a closure or a hash -depending on the contents. It does Inot indicate a subscript. +depending on the contents. It does Inot indicate a subscript despite being +parsed as one. Note also that the C a b form is not a subscript and is therefore equivalent not to C.{'a','b'} but rather to C('a','b'). Bare C a