Re: Thanksgiving fun
I tried it on the 0.5.0 updated this week, with the following results: [EMAIL PROTECTED] nqp]$ ../../parrot nqp.pbc ~/tmp/blue_rect.pl Cannot find the attribute 'post' (String) that you asked for. Method 'named' not found current instr.: 'parrot;POST::Grammar;_PAST::Op_pirop' pc 4378 (src/POST/Grammar.tg:151) called from Sub 'parrot;TGE::Tree;_eval_cell' pc 282 (TGE/Tree.pir:175) called from Sub 'parrot;TGE::Tree;get' pc 241 (TGE/Tree.pir:155) called from Sub 'parrot;POST::Grammar;_PAST::Op_callmethod' pc 4479 (src/POST/Grammar.tg:172) called from Sub 'parrot;TGE::Tree;_eval_cell' pc 282 (TGE/Tree.pir:175) called from Sub 'parrot;TGE::Tree;get' pc 241 (TGE/Tree.pir:155) called from Sub 'parrot;TGE::Tree;_eval_cell' pc 282 (TGE/Tree.pir:175) called from Sub 'parrot;TGE::Tree;get' pc 241 (TGE/Tree.pir:155) called from Sub 'parrot;POST::Grammar;_PAST::Stmts_post' pc 4166 (src/POST/Grammar.tg:90) called from Sub 'parrot;TGE::Tree;_eval_cell' pc 282 (TGE/Tree.pir:175) called from Sub 'parrot;TGE::Tree;get' pc 241 (TGE/Tree.pir:155) called from Sub 'parrot;POST::Grammar;_PAST::Block_post' pc 4029 (src/POST/Grammar.tg:51) called from Sub 'parrot;TGE::Tree;_eval_cell' pc 282 (TGE/Tree.pir:175) called from Sub 'parrot;TGE::Tree;get' pc 241 (TGE/Tree.pir:155) called from Sub 'parrot;POST::Grammar;_PAST::Block_root' pc 3872 (src/POST/Grammar.tg:11) called from Sub 'parrot;TGE::Tree;_eval_cell' pc 282 (TGE/Tree.pir:175) called from Sub 'parrot;TGE::Tree;get' pc 241 (TGE/Tree.pir:155) called from Sub 'parrot;PAST::Compiler;compile' pc 2327 (src/PAST/Compiler.pir:41) called from Sub 'parrot;PCT::HLLCompiler;compile' pc 615 (src/HLLCompiler.pir:258) called from Sub 'parrot;PCT::HLLCompiler;eval' pc 848 (src/HLLCompiler.pir:371) called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1136 (src/HLLCompiler.pir:504) called from Sub 'parrot;PCT::HLLCompiler;command_line' pc 1285 (src/HLLCompiler.pir:568) -- Email and shopping with the feelgood factor! 55% of income to good causes. http://www.ippimail.com
Re: Thanksgiving fun
On Nov 23, 1:37 am, [EMAIL PROTECTED] wrote: > I tried it on the 0.5.0 updated this week, with the following results: > > [EMAIL PROTECTED] nqp]$ ../../parrot nqp.pbc ~/tmp/blue_rect.pl > Cannot find the attribute 'post' (String) that you asked for. > Method 'named' not found > current instr.: 'parrot;POST::Grammar;_PAST::Op_pirop' pc 4378 > (src/POST/Grammar.tg:151) > called from Sub 'parrot;TGE::Tree;_eval_cell' pc 282 (TGE/Tree.pir:175) > called from Sub 'parrot;TGE::Tree;get' pc 241 (TGE/Tree.pir:155) > called from Sub 'parrot;POST::Grammar;_PAST::Op_callmethod' pc 4479 > (src/POST/Grammar.tg:172) > called from Sub 'parrot;TGE::Tree;_eval_cell' pc 282 (TGE/Tree.pir:175) > called from Sub 'parrot;TGE::Tree;get' pc 241 (TGE/Tree.pir:155) > called from Sub 'parrot;TGE::Tree;_eval_cell' pc 282 (TGE/Tree.pir:175) > called from Sub 'parrot;TGE::Tree;get' pc 241 (TGE/Tree.pir:155) > called from Sub 'parrot;POST::Grammar;_PAST::Stmts_post' pc 4166 > (src/POST/Grammar.tg:90) > called from Sub 'parrot;TGE::Tree;_eval_cell' pc 282 (TGE/Tree.pir:175) > called from Sub 'parrot;TGE::Tree;get' pc 241 (TGE/Tree.pir:155) > called from Sub 'parrot;POST::Grammar;_PAST::Block_post' pc 4029 > (src/POST/Grammar.tg:51) > called from Sub 'parrot;TGE::Tree;_eval_cell' pc 282 (TGE/Tree.pir:175) > called from Sub 'parrot;TGE::Tree;get' pc 241 (TGE/Tree.pir:155) > called from Sub 'parrot;POST::Grammar;_PAST::Block_root' pc 3872 > (src/POST/Grammar.tg:11) > called from Sub 'parrot;TGE::Tree;_eval_cell' pc 282 (TGE/Tree.pir:175) > called from Sub 'parrot;TGE::Tree;get' pc 241 (TGE/Tree.pir:155) > called from Sub 'parrot;PAST::Compiler;compile' pc 2327 > (src/PAST/Compiler.pir:41) > called from Sub 'parrot;PCT::HLLCompiler;compile' pc 615 > (src/HLLCompiler.pir:258) > called from Sub 'parrot;PCT::HLLCompiler;eval' pc 848 > (src/HLLCompiler.pir:371) > called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1136 > (src/HLLCompiler.pir:504) > called from Sub 'parrot;PCT::HLLCompiler;command_line' pc 1285 > (src/HLLCompiler.pir:568) > > -- > > Email and shopping with the feelgood factor! > 55% of income to good causes.http://www.ippimail.com You need to get the latest version, at least r22971 . You can download the latest snapshot at http://svn.perl.org/snapshots/parrot/ kjs
Re: [svn:parrot] r22924 - trunk/src/pmc
I just want to add a reminder here that the whole reason PCT, PAST-pm, and Tcl use morph in the first place is because Parrot doesn't provide a usable "replace pmc with clone" opcode, and using morph+assign is a workaround. In other words, if a "replace pmc" opcode exists, then morph suddenly becomes _much_ less important. Ideally I'd like to have a keyed version also (choose your own better opcode name): replace $P0, $P1# replace $P0 with a clone of $P1 replace $P0[key], $P1 # replace pmc at $P0[key] with a clone # of $P1 (creating $P0[key] if needed) Pm On Fri, Nov 23, 2007 at 12:05:08PM +0200, Allison Randal wrote: > A better fix is to update pmc_reuse in src/pmc.c so it correctly handles > morphing to object types. See pmc_new in the same file for an example of > instantiating an object from a type ID (by looking up the class object). > As Jonathan started to ponder in his message "Morphing to high level > classes", this may mean having the 'instantiate' vtable function check > the hash parameter for a 'reuse' key, a PMC header to reuse. (50/50 on > whether we want to expose that as an option from the PIR-level interface > or block it.) > > Allison > > [EMAIL PROTECTED] wrote: > >Author: chromatic > >Date: Tue Nov 20 20:42:22 2007 > >New Revision: 22924 > > > >Modified: > > trunk/src/pmc/undef.pmc > > > >Log: > >[PMC] assign $P0, $P1 failed with badness when $P0 was an Undef PMC and > >$P1 was > >an Object, because the assign_pmc vtable entry first morphed the Undef PMC > >into > >a like Object and then tried to instantiate it with the init vtable entry. > > > >This does not work on Objects, as you must instantiate them from their > >Classes. > > > >Now there's no morph into an Object; the Undef PMC morphs into a Ref and > >points to the Object instead. > > > >Modified: trunk/src/pmc/undef.pmc > >== > >--- trunk/src/pmc/undef.pmc (original) > >+++ trunk/src/pmc/undef.pmc Tue Nov 20 20:42:22 2007 > >@@ -48,7 +48,7 @@ > > > > =item C > > > >-Assigns the PMC to the value of C<*other>by first changing the PMC to the > >+Assigns the PMC to the value of C<*other> by first changing the PMC to the > > appropriate type. > > > > =cut > >@@ -56,7 +56,8 @@ > > */ > > > > void assign_pmc(PMC *other) { > >-VTABLE_morph(INTERP, SELF, other->vtable->base_type); > >+if (!PObj_is_object_TEST(other)) > >+VTABLE_morph(INTERP, SELF, other->vtable->base_type); > > > > /* don't want to call set_pmc if we're assigning an Undef to an > > Undef */ > > if (other->vtable->base_type != enum_class_Undef) > > > >
Re: Thanksgiving fun
On Fri, Nov 23, 2007 at 01:21:39AM -0800, [EMAIL PROTECTED] wrote: > On Nov 23, 1:37 am, [EMAIL PROTECTED] wrote: > > I tried it on the 0.5.0 updated this week, with the following results: > > > > [EMAIL PROTECTED] nqp]$ ../../parrot nqp.pbc ~/tmp/blue_rect.pl > > Cannot find the attribute 'post' (String) that you asked for. > > ... > > You need to get the latest version, at least r22971 . You can download > the latest snapshot at http://svn.perl.org/snapshots/parrot/ That's correct -- I didn't get all of the updates for NQP together in time for the 0.5.0 release (there have been a lot of them). The new version of NQP will appear in 0.5.1, but for those who don't want to wait it can be obtained via the subversion or snapshot repositories. Pm
Re: [svn:parrot] r22924 - trunk/src/pmc
A better fix is to update pmc_reuse in src/pmc.c so it correctly handles morphing to object types. See pmc_new in the same file for an example of instantiating an object from a type ID (by looking up the class object). As Jonathan started to ponder in his message "Morphing to high level classes", this may mean having the 'instantiate' vtable function check the hash parameter for a 'reuse' key, a PMC header to reuse. (50/50 on whether we want to expose that as an option from the PIR-level interface or block it.) Allison [EMAIL PROTECTED] wrote: Author: chromatic Date: Tue Nov 20 20:42:22 2007 New Revision: 22924 Modified: trunk/src/pmc/undef.pmc Log: [PMC] assign $P0, $P1 failed with badness when $P0 was an Undef PMC and $P1 was an Object, because the assign_pmc vtable entry first morphed the Undef PMC into a like Object and then tried to instantiate it with the init vtable entry. This does not work on Objects, as you must instantiate them from their Classes. Now there's no morph into an Object; the Undef PMC morphs into a Ref and points to the Object instead. Modified: trunk/src/pmc/undef.pmc == --- trunk/src/pmc/undef.pmc (original) +++ trunk/src/pmc/undef.pmc Tue Nov 20 20:42:22 2007 @@ -48,7 +48,7 @@ =item C -Assigns the PMC to the value of C<*other>by first changing the PMC to the +Assigns the PMC to the value of C<*other> by first changing the PMC to the appropriate type. =cut @@ -56,7 +56,8 @@ */ void assign_pmc(PMC *other) { -VTABLE_morph(INTERP, SELF, other->vtable->base_type); +if (!PObj_is_object_TEST(other)) +VTABLE_morph(INTERP, SELF, other->vtable->base_type); /* don't want to call set_pmc if we're assigning an Undef to an Undef */ if (other->vtable->base_type != enum_class_Undef)
Re: [perl #46681] [TODO] [C] Use strerror_r instead of strerror
On Nov 22, 2007 9:03 PM, Joe Sadusk via RT <[EMAIL PROTECTED]> wrote: > Reposting this because this is my first patch, and it didn't occur to me > that if I don't CC perl6-internals, no one would notice it. > > It turns out that strerror_r is POSIX only, and windows has the slightly > different strerror_s (exactly the same except the arguments are in a > different order). I defined a macro that abstracts this, but I don't > know if there's a standard header file cross platform macros like this > are put in, so I put it inline in the pmc. If anyone has a suggestion of > where this belongs, I'll gladly move it. I'm no expert on this, but in config/gen/platform, there are subdirectories that contain files that do platform dependent stuff. (I only know this because I once added config/gen/platform/win32/string.h, which defines a macro for strdup for MSVC users.) I suspect that your macro should go in a similar file, but this should be confirmed by someone with more knowledge on this. kjs
[svn:parrot-pdd] r22974 - in trunk/docs/pdds: . draft
Author: allison Date: Fri Nov 23 03:23:04 2007 New Revision: 22974 Added: trunk/docs/pdds/pdd25_concurrency.pod - copied unchanged from r22973, /trunk/docs/pdds/draft/pdd25_concurrency.pod Removed: trunk/docs/pdds/draft/pdd25_concurrency.pod Log: [pdd] Launching concurrency PDD out of draft.