develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33994 - in branches/rakudoreg: . compilers/pct/src/PCT compilers/pirc/new docs/book docs/pdds docs/project editor examples/io examples/tge/branch languages/lua/t/test languages/perl6/config/makefiles languages/perl6/src/builtins languages/pe

From:
jonathan
Date:
December 16, 2008 15:31
Subject:
[svn:parrot] r33994 - in branches/rakudoreg: . compilers/pct/src/PCT compilers/pirc/new docs/book docs/pdds docs/project editor examples/io examples/tge/branch languages/lua/t/test languages/perl6/config/makefiles languages/perl6/src/builtins languages/pe
Message ID:
20081216232812.07291CBA12@x12.develooper.com
Author: jonathan
Date: Tue Dec 16 15:28:09 2008
New Revision: 33994

Added:
   branches/rakudoreg/languages/perl6/src/classes/Exception.pir
      - copied unchanged from r33993, /trunk/languages/perl6/src/classes/Exception.pir
Removed:
   branches/rakudoreg/examples/io/pioctl.pasm
   branches/rakudoreg/src/io/io_mmap.c
Modified:
   branches/rakudoreg/   (props changed)
   branches/rakudoreg/DEPRECATED.pod
   branches/rakudoreg/MANIFEST
   branches/rakudoreg/compilers/pct/src/PCT/HLLCompiler.pir
   branches/rakudoreg/compilers/pirc/new/pir.y
   branches/rakudoreg/compilers/pirc/new/pircompunit.c
   branches/rakudoreg/compilers/pirc/new/pircompunit.h
   branches/rakudoreg/compilers/pirc/new/piremit.c
   branches/rakudoreg/compilers/pirc/new/pirparser.c
   branches/rakudoreg/compilers/pirc/new/pirsymbol.c
   branches/rakudoreg/compilers/pirc/new/pirsymbol.h
   branches/rakudoreg/docs/book/ch13_reference.pod
   branches/rakudoreg/docs/pdds/pdd19_pir.pod
   branches/rakudoreg/docs/pdds/pdd22_io.pod
   branches/rakudoreg/docs/project/release_manager_guide.pod
   branches/rakudoreg/editor/pir-mode.el
   branches/rakudoreg/examples/tge/branch/transform.pir
   branches/rakudoreg/languages/lua/t/test/bisect-output-win32.txt   (props changed)
   branches/rakudoreg/languages/perl6/config/makefiles/root.in
   branches/rakudoreg/languages/perl6/src/builtins/any-list.pir
   branches/rakudoreg/languages/perl6/src/classes/Failure.pir
   branches/rakudoreg/languages/perl6/src/classes/Pair.pir
   branches/rakudoreg/languages/perl6/src/parser/actions.pm
   branches/rakudoreg/languages/perl6/src/parser/grammar.pg
   branches/rakudoreg/languages/perl6/t/spectest.data
   branches/rakudoreg/languages/pipp/ROADMAP   (props changed)
   branches/rakudoreg/languages/pipp/docs/pipp.pod   (props changed)
   branches/rakudoreg/src/pmc/filehandle.pmc
   branches/rakudoreg/t/perl/testlib/answer.pir   (contents, props changed)
   branches/rakudoreg/t/perl/testlib/hello   (props changed)
   branches/rakudoreg/t/pmc/io_iterator.t

Log:
[rakudo] Sync branch up with trunk.

Modified: branches/rakudoreg/DEPRECATED.pod
==============================================================================
--- branches/rakudoreg/DEPRECATED.pod	(original)
+++ branches/rakudoreg/DEPRECATED.pod	Tue Dec 16 15:28:09 2008
@@ -35,10 +35,6 @@
 
 =over 4
 
-=item * C<pioctl> [post 0.5.1]
-
-See RT #48589.
-
 =item * C<store_global> [post 0.5.0]
 
 See RT #48016. Replace usage with set_[hll,root]_global variants.
@@ -64,6 +60,17 @@
 
 These opcodes were only used by the old MMD system. See TT #7.
 
+=item * C<slice> [post 0.8.2]
+
+The C<slice> opcode's implementation is experimental. Its use cases and
+implementation should be reconsidered. The current implementation will
+be removed.
+
+=item * C<add_io_event> [post 0.8.2]
+
+The C<add_io_event> opcode is experimental and non-functional. The current
+implementation will be removed.
+
 =back
 
 =head1 Class Features
@@ -74,7 +81,7 @@
 
 See RT #48014. This will be removed once all core PMCs have been updated.
 
-=item :anon and :vtable named parameters to add_method [post 0.8.2]
+=item * :anon and :vtable named parameters to add_method [post 0.8.2]
 
 If you want to override a vtable method/function when building a Class, then
 use the method C<add_vtable_override> instead of calling C<add_method> with
@@ -86,6 +93,14 @@
 
 =over 4
 
+=item * String indexing [post 0.8.2]
+
+String indexing sugar is deprecated. This means you can no longer write
+
+  $S0[1]
+
+to mean substr, $S0, 1, 1. Use the C<substr> op instead.
+
 =item * C<.namespace [ "a" .. "b" ]> [post 0.5.0]
 
 See RT #46715.

Modified: branches/rakudoreg/MANIFEST
==============================================================================
--- branches/rakudoreg/MANIFEST	(original)
+++ branches/rakudoreg/MANIFEST	Tue Dec 16 15:28:09 2008
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Sun Dec 14 21:18:26 2008 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Tue Dec 16 22:45:43 2008 UT
 #
 # See tools/dev/install_files.pl for documentation on the
 # format of this file.
@@ -677,7 +677,6 @@
 examples/io/httpd.pir                                       [main]doc
 examples/io/httpd2.pir                                      [main]doc
 examples/io/net_smtp.pasm                                   [main]doc
-examples/io/pioctl.pasm                                     [main]doc
 examples/io/pipe2.pir                                       [main]doc
 examples/io/pipe3.pir                                       [main]doc
 examples/japh/README                                        [main]doc
@@ -2133,6 +2132,7 @@
 languages/perl6/src/classes/Capture.pir                     [perl6]
 languages/perl6/src/classes/Code.pir                        [perl6]
 languages/perl6/src/classes/Complex.pir                     [perl6]
+languages/perl6/src/classes/Exception.pir                   [perl6]
 languages/perl6/src/classes/Failure.pir                     [perl6]
 languages/perl6/src/classes/Grammar.pir                     [perl6]
 languages/perl6/src/classes/Hash.pir                        [perl6]
@@ -2990,7 +2990,6 @@
 src/io/api.c                                                []
 src/io/buffer.c                                             []
 src/io/core.c                                               []
-src/io/io_mmap.c                                            []
 src/io/io_private.h                                         []
 src/io/io_string.c                                          []
 src/io/portable.c                                           []

Modified: branches/rakudoreg/compilers/pct/src/PCT/HLLCompiler.pir
==============================================================================
--- branches/rakudoreg/compilers/pct/src/PCT/HLLCompiler.pir	(original)
+++ branches/rakudoreg/compilers/pct/src/PCT/HLLCompiler.pir	Tue Dec 16 15:28:09 2008
@@ -745,7 +745,7 @@
     $I0 = adverbs['version']
     if $I0 goto version
 
-    
+
     $S0 = adverbs['e']
     $I0 = exists adverbs['e']
     if $I0 goto eval_line

Modified: branches/rakudoreg/compilers/pirc/new/pir.y
==============================================================================
--- branches/rakudoreg/compilers/pirc/new/pir.y	(original)
+++ branches/rakudoreg/compilers/pirc/new/pir.y	Tue Dec 16 15:28:09 2008
@@ -981,7 +981,7 @@
                             yypirerror(yyscanner, lexer, "indexed object '%s' not declared", instr);
                             sym = new_symbol(lexer, instr, PMC_TYPE);
                          }
-                         else if (sym->type != PMC_TYPE)
+                         else if (sym->info.type != PMC_TYPE)
                             /* found symbol, now check it's a PMC */
                             yypirerror(yyscanner, lexer,
                                     "indexed object '%s' must be of type 'pmc'", instr);
@@ -1029,10 +1029,10 @@
                            if (TEST_FLAG($1->flags, TARGET_FLAG_IS_REG))
                                $$ = $1;
                            else { /* it's not a register, so it must be a declared symbol */
-                               if ($1->s.sym->type != PMC_TYPE)
+                               if ($1->info->type != PMC_TYPE)
                                    yypirerror(yyscanner, lexer,
                                            "indexed object '%s' is not of type 'pmc'",
-                                           $1->s.sym->name);
+                                           $1->info->id.name);
 
                                /* create a target node based on the symbol node;
                                 * sym already has a PASM register, so through
@@ -1174,7 +1174,7 @@
                           }
                           else {
                               /* at this point, sym is not NULL, even if there was an error */
-                              if (sym->type != PMC_TYPE)
+                              if (sym->info.type != PMC_TYPE)
                                   yypirerror(yyscanner, lexer,
                                           "indexed object '%s' must be of type 'pmc'", $3);
 
@@ -1195,7 +1195,7 @@
                               yypirerror(yyscanner, lexer, "indexed object '%s' not declared", $3);
                               sym = new_symbol(lexer, $3, PMC_TYPE);
                           }
-                          else if (sym->type != PMC_TYPE)
+                          else if (sym->info.type != PMC_TYPE)
                               yypirerror(yyscanner, lexer,
                                       "indexed object '%s' must be of type 'pmc'", $3);
 
@@ -1297,7 +1297,7 @@
                               /* create a dummy symbol so we can continue without seg. faults */
                               sym = new_symbol(lexer, $1, PMC_TYPE);
                           }
-                          else if (sym->type != PMC_TYPE)
+                          else if (sym->info.type != PMC_TYPE)
                               yypirerror(yyscanner, lexer,
                                       "indexed object '%s' must be of type 'pmc'", $1);
                           /* at this point sym is a valid (possibly dummy) object for sure */
@@ -1576,9 +1576,9 @@
                         { /* if $4 is not a register, it must be a declared symbol */
                           if (!TEST_FLAG($4->flags, TARGET_FLAG_IS_REG)) {
 
-                              if ($4->s.sym->type != PMC_TYPE) /* a .lex must be a PMC */
+                              if ($4->info->type != PMC_TYPE) /* a .lex must be a PMC */
                                   yypirerror(yyscanner, lexer, "lexical '%s' must be of type 'pmc'",
-                                             $4->s.sym->name);
+                                             $4->info->id.name);
                           }
                           set_lex_flag($4, $2);
                         }
@@ -1693,14 +1693,14 @@
                              }
                              else { /* is not a register but a symbol */
 
-                                 symbol *sym = find_symbol(lexer, $1->s.sym->name);
+                                 symbol *sym = find_symbol(lexer, $1->info->id.name);
                                  if (sym == NULL)
                                      yypirerror(yyscanner, lexer,
-                                             "symbol '%s' was not declared", $1->s.sym->name);
-                                 else if ($1->s.sym->type != PMC_TYPE)
+                                             "symbol '%s' was not declared", $1->info->id.name);
+                                 else if ($1->info->type != PMC_TYPE)
                                      yypirerror(yyscanner, lexer,
                                              "cannot invoke method: '%s' is not of type 'pmc'",
-                                             $1->s.sym->name);
+                                             $1->info->id.name);
 
                                  /* get a target based on the symbol, it contains a register */
                                  invocant = $1;
@@ -1739,8 +1739,8 @@
                                 /* make sure sym is not NULL */
                                 sym = new_symbol(lexer, $1, PMC_TYPE);
                              }
-                             else if (sym->type != PMC_TYPE
-                                  &&  sym->type != STRING_TYPE)
+                             else if (sym->info.type != PMC_TYPE
+                                  &&  sym->info.type != STRING_TYPE)
                                  yypirerror(yyscanner, lexer,
                                          "method '%s' must be of type 'pmc' or 'string'", $1);
 
@@ -3299,43 +3299,21 @@
 write_signature(NOTNULL(expression * const iter), NOTNULL(char *instr_writer)) {
     switch (iter->type) {
         case EXPR_TARGET:
-            if (TEST_FLAG(iter->expr.t->flags, TARGET_FLAG_IS_REG))
-                *instr_writer++ = type_codes[iter->expr.t->s.reg->type];
-            else
-                *instr_writer++ = type_codes[iter->expr.t->s.sym->type];
+            *instr_writer++ = type_codes[iter->expr.t->info->type];
 
             if (iter->expr.t->key) {
                 *instr_writer++ = '_';
                 *instr_writer++ = 'k';
-                /* XXX fix this mess. */
+
                 if ((iter->expr.t->key->expr->type == EXPR_TARGET)
-                    &&
-                    (  (iter->expr.t->key->expr->expr.t->flags & TARGET_FLAG_IS_REG)
-                     ?
-                       (iter->expr.t->key->expr->expr.t->s.reg->type == PMC_TYPE)
-                     :
-                       (iter->expr.t->key->expr->expr.t->s.sym->type == PMC_TYPE)
-                    )
-                   ) {
+                &&  (iter->expr.t->key->expr->expr.t->info->type == PMC_TYPE)) {
                     /* the key is a target, and its type is a PMC. In that case, do not
                      * print the signature; 'kp' is not valid.
                      */
                 }
                 else {
-                    if (
-                       (iter->expr.t->key->expr->type == EXPR_TARGET)
-                       &&
-
-
-                       (
-                       (iter->expr.t->key->expr->expr.t->flags & TARGET_FLAG_IS_REG)
-                       ?
-                       (iter->expr.t->key->expr->expr.t->s.reg->type == INT_TYPE)
-                       :
-                       (iter->expr.t->key->expr->expr.t->s.sym->type == INT_TYPE)
-                       )
-                       )
-
+                    if ((iter->expr.t->key->expr->type == EXPR_TARGET)
+                    &&  (iter->expr.t->key->expr->expr.t->info->type == INT_TYPE))
                     {
                        *instr_writer++ = 'i';
                     }
@@ -3546,7 +3524,8 @@
 
             if (sym) {
                 operand->expr.t        = new_target(lexer);
-                operand->expr.t->s.sym = sym;  /* target's pointer set to symbol */
+                /* operand->expr.t->s.sym = sym;  */ /* target's pointer set to symbol */
+                operand->expr.t->info  = &sym->info;
                 operand->type          = EXPR_TARGET; /* convert operand node into EXPR_TARGET */
             }
             else { /* it must be a label */

Modified: branches/rakudoreg/compilers/pirc/new/pircompunit.c
==============================================================================
--- branches/rakudoreg/compilers/pirc/new/pircompunit.c	(original)
+++ branches/rakudoreg/compilers/pirc/new/pircompunit.c	Tue Dec 16 15:28:09 2008
@@ -444,9 +444,9 @@
 
     if (TEST_FLAG(left->flags, TARGET_FLAG_IS_REG)) {      /* if left is a reg */
         if (TEST_FLAG(right->flags, TARGET_FLAG_IS_REG)) { /* then right must be a reg */
-            if ((left->s.reg->type == right->s.reg->type)        /* types must match */
-            &&  (left->s.reg->regno == right->s.reg->regno           /* PIR regno must match */
-            &&  (left->s.reg->color == right->s.reg->color)))    /* PASM regno must match */
+            if ((left->info->type  == right->info->type)       /* types must match */
+            &&  (left->info->id.regno == right->info->id.regno /* PIR regno must match */
+            &&  (left->info->color == right->info->color)))    /* PASM regno must match */
                 return TRUE;
         }
         else /* left is a reg, right is not */
@@ -456,8 +456,8 @@
     else { /* left is not a reg */
 
         if (!TEST_FLAG(right->flags, TARGET_FLAG_IS_REG)  /* right must not be a reg */
-        && (left->s.sym->name && right->s.sym->name       /* both must have a name */
-        && STREQ(left->s.sym->name, right->s.sym->name))) /* and they must be equal */
+        && (left->info->id.name && right->info->id.name       /* both must have a name */
+        && STREQ(left->info->id.name, right->info->id.name))) /* and they must be equal */
             return TRUE;
     }
 
@@ -518,8 +518,9 @@
 target *
 target_from_symbol(lexer_state * const lexer, symbol * const sym) {
     target *t  = new_target(lexer);
-    t->s.sym   = sym; /* set a pointer from target to symbol */
+
     t->flags   = sym->flags; /* copy the flags */
+    t->info    = &sym->info;
 
     return t;
 }
@@ -593,7 +594,8 @@
     assign_vanilla_register(lexer, sym);
 
     /* set a pointer from the target to the symbol object */
-    targ->s.sym = sym;
+    /* targ->s.sym = sym; */
+    targ->info = &sym->info;
 
     return targ;
 }
@@ -645,14 +647,14 @@
      */
 
     /* :slurpy can only be set on a PMC parameter */
-    if (TEST_FLAG(flag, TARGET_FLAG_SLURPY) && param->s.sym->type != PMC_TYPE)
+    if (TEST_FLAG(flag, TARGET_FLAG_SLURPY) && param->info->type != PMC_TYPE)
         yypirerror(lexer->yyscanner, lexer,
-                   "cannot set :slurpy flag on non-pmc %s", param->s.sym->name);
+                   "cannot set :slurpy flag on non-pmc %s", param->info->id.name);
 
     /* :opt_flag can only be set on a int parameter */
-    if (TEST_FLAG(flag, TARGET_FLAG_OPT_FLAG) && param->s.sym->type != INT_TYPE)
+    if (TEST_FLAG(flag, TARGET_FLAG_OPT_FLAG) && param->info->type != INT_TYPE)
         yypirerror(lexer->yyscanner, lexer,
-                   "cannot set :opt_flag flag on non-int %s", param->s.sym->name);
+                   "cannot set :opt_flag flag on non-int %s", param->info->id.name);
 
     return param;
 }
@@ -1361,7 +1363,8 @@
 
     color_reg(lexer, type, regno);
     reg = find_register(lexer, type, regno);
-    t->s.reg = reg;
+    /* XXX t->s.reg = reg; */
+    t->info = &reg->info;
 
     /* set a flag on this target node saying it's a register */
     SET_FLAG(t->flags, TARGET_FLAG_IS_REG);
@@ -1859,10 +1862,7 @@
 
             switch (argvalue->type) {
                 case EXPR_TARGET:
-                    if (TEST_FLAG(argvalue->expr.t->flags, TARGET_FLAG_IS_REG))
-                        flag |= argvalue->expr.t->s.reg->type;
-                    else
-                        flag |= argvalue->expr.t->s.sym->type;
+                    flag |= argvalue->expr.t->info->type;
                     break;
                 case EXPR_CONSTANT:
                     flag |= argvalue->expr.c->type;
@@ -2085,7 +2085,7 @@
 
             /* if the target is a register, invoke that. */
             if (TEST_FLAG(inv->sub->flags, TARGET_FLAG_IS_REG)) {
-                target *sub = new_reg(lexer, PMC_TYPE, inv->sub->s.reg->color);
+                target *sub = new_reg(lexer, PMC_TYPE, inv->sub->info->color);
                 if (inv->retcc) { /* return continuation present? */
                     new_sub_instr(lexer, PARROT_OP_invoke_p_p, "invoke_p_p");
                     add_operands(lexer, "%T%T", inv->sub, inv->retcc);
@@ -2097,7 +2097,7 @@
             }
             else { /* find the global label in the current file, or find it during runtime */
                 target *sub        = generate_unique_pir_reg(lexer, PMC_TYPE);
-                global_label *glob = find_global_label(lexer, inv->sub->s.sym->name);
+                global_label *glob = find_global_label(lexer, inv->sub->info->id.name);
 
                 if (glob) {
                     /* XXX fix pmc const stuff */
@@ -2108,7 +2108,7 @@
                     new_sub_instr(lexer, PARROT_OP_find_sub_not_null_p_sc,
                                   "find_sub_not_null_p_sc");
 
-                    add_operands(lexer, "%T%s", sub, inv->sub->s.sym->name);
+                    add_operands(lexer, "%T%s", sub, inv->sub->info->id.name);
 
                     /* save the current instruction in a list; entries in this list will be
                      * fixed up, if possible, after the parsing phase.
@@ -2125,7 +2125,8 @@
                      *   find_sub_not_null_p_sc
                      *
                      */
-                    save_global_reference(lexer, CURRENT_INSTRUCTION(lexer), inv->sub->s.sym->name);
+                    save_global_reference(lexer, CURRENT_INSTRUCTION(lexer),
+                                          inv->sub->info->id.name);
                 }
 
                 new_sub_instr(lexer, PARROT_OP_invokecc_p, "invokecc_p");

Modified: branches/rakudoreg/compilers/pirc/new/pircompunit.h
==============================================================================
--- branches/rakudoreg/compilers/pirc/new/pircompunit.h	(original)
+++ branches/rakudoreg/compilers/pirc/new/pircompunit.h	Tue Dec 16 15:28:09 2008
@@ -195,18 +195,13 @@
  * return values, it's a local variable (or register).
  */
 typedef struct target {
+    struct syminfo *info;           /* pointer to symbol/pir_reg's information */
+    target_flag     flags;          /* flags like :slurpy etc. */
+    char const     *alias;          /* if this is a named parameter, this is the alias */
+    char const     *lex_name;       /* if this is a lexical, this field contains the name */
+    struct key     *key;            /* the key of this target, i.e. $P0[$P1], $P1 is key. */
 
-    union sym_union {
-        struct symbol  *sym;
-        struct pir_reg *reg;
-    } s;
-
-    target_flag    flags;          /* flags like :slurpy etc. */
-    char const    *alias;          /* if this is a named parameter, this is the alias */
-    char const    *lex_name;       /* if this is a lexical, this field contains the name */
-    struct key    *key;            /* the key of this target, i.e. $P0[$P1], $P1 is key. */
-
-    struct target *next;
+    struct target  *next;
 
 } target;
 

Modified: branches/rakudoreg/compilers/pirc/new/piremit.c
==============================================================================
--- branches/rakudoreg/compilers/pirc/new/piremit.c	(original)
+++ branches/rakudoreg/compilers/pirc/new/piremit.c	Tue Dec 16 15:28:09 2008
@@ -94,13 +94,13 @@
 print_target(lexer_state *lexer, target * const t) {
 
     if (TEST_FLAG(t->flags, TARGET_FLAG_IS_REG)) {
-        if (t->s.reg == NULL)
+        if (t->info == NULL)
             fprintf(stderr, "reg target has no pir_reg ptr!\n");
 
-        fprintf(out, "%c%d", pir_register_types[t->s.reg->type], t->s.reg->color);
+        fprintf(out, "%c%d", pir_register_types[t->info->type], t->info->color);
     }
     else
-        fprintf(out, "%c%d", pir_register_types[t->s.sym->type], t->s.sym->color);
+        fprintf(out, "%c%d", pir_register_types[t->info->type], t->info->color);
 
     /* if the target has a key, print that too */
     if (t->key)
@@ -432,9 +432,9 @@
 static void
 emit_pbc_target_arg(lexer_state * const lexer, target * const t) {
     if (TEST_FLAG(t->flags, TARGET_FLAG_IS_REG))
-        emit_int_arg(lexer->bc, t->s.reg->color);
+        emit_int_arg(lexer->bc, t->info->color);
     else
-        emit_int_arg(lexer->bc, t->s.sym->color);
+        emit_int_arg(lexer->bc, t->info->color);
 }
 
 /*

Modified: branches/rakudoreg/compilers/pirc/new/pirparser.c
==============================================================================
--- branches/rakudoreg/compilers/pirc/new/pirparser.c	(original)
+++ branches/rakudoreg/compilers/pirc/new/pirparser.c	Tue Dec 16 15:28:09 2008
@@ -2977,7 +2977,7 @@
                             yypirerror(yyscanner, lexer, "indexed object '%s' not declared", instr);
                             sym = new_symbol(lexer, instr, PMC_TYPE);
                          }
-                         else if (sym->type != PMC_TYPE)
+                         else if (sym->info.type != PMC_TYPE)
                             /* found symbol, now check it's a PMC */
                             yypirerror(yyscanner, lexer,
                                     "indexed object '%s' must be of type 'pmc'", instr);
@@ -3037,10 +3037,10 @@
                            if (TEST_FLAG((yyvsp[(1) - (2)].targ)->flags, TARGET_FLAG_IS_REG))
                                (yyval.targ) = (yyvsp[(1) - (2)].targ);
                            else { /* it's not a register, so it must be a declared symbol */
-                               if ((yyvsp[(1) - (2)].targ)->s.sym->type != PMC_TYPE)
+                               if ((yyvsp[(1) - (2)].targ)->info->type != PMC_TYPE)
                                    yypirerror(yyscanner, lexer,
                                            "indexed object '%s' is not of type 'pmc'",
-                                           (yyvsp[(1) - (2)].targ)->s.sym->name);
+                                           (yyvsp[(1) - (2)].targ)->info->id.name);
 
                                /* create a target node based on the symbol node;
                                 * sym already has a PASM register, so through
@@ -3202,7 +3202,7 @@
                           }
                           else {
                               /* at this point, sym is not NULL, even if there was an error */
-                              if (sym->type != PMC_TYPE)
+                              if (sym->info.type != PMC_TYPE)
                                   yypirerror(yyscanner, lexer,
                                           "indexed object '%s' must be of type 'pmc'", (yyvsp[(3) - (4)].sval));
 
@@ -3226,7 +3226,7 @@
                               yypirerror(yyscanner, lexer, "indexed object '%s' not declared", (yyvsp[(3) - (4)].sval));
                               sym = new_symbol(lexer, (yyvsp[(3) - (4)].sval), PMC_TYPE);
                           }
-                          else if (sym->type != PMC_TYPE)
+                          else if (sym->info.type != PMC_TYPE)
                               yypirerror(yyscanner, lexer,
                                       "indexed object '%s' must be of type 'pmc'", (yyvsp[(3) - (4)].sval));
 
@@ -3361,7 +3361,7 @@
                               /* create a dummy symbol so we can continue without seg. faults */
                               sym = new_symbol(lexer, (yyvsp[(1) - (4)].sval), PMC_TYPE);
                           }
-                          else if (sym->type != PMC_TYPE)
+                          else if (sym->info.type != PMC_TYPE)
                               yypirerror(yyscanner, lexer,
                                       "indexed object '%s' must be of type 'pmc'", (yyvsp[(1) - (4)].sval));
                           /* at this point sym is a valid (possibly dummy) object for sure */
@@ -3754,9 +3754,9 @@
     { /* if $4 is not a register, it must be a declared symbol */
                           if (!TEST_FLAG((yyvsp[(4) - (5)].targ)->flags, TARGET_FLAG_IS_REG)) {
 
-                              if ((yyvsp[(4) - (5)].targ)->s.sym->type != PMC_TYPE) /* a .lex must be a PMC */
+                              if ((yyvsp[(4) - (5)].targ)->info->type != PMC_TYPE) /* a .lex must be a PMC */
                                   yypirerror(yyscanner, lexer, "lexical '%s' must be of type 'pmc'",
-                                             (yyvsp[(4) - (5)].targ)->s.sym->name);
+                                             (yyvsp[(4) - (5)].targ)->info->id.name);
                           }
                           set_lex_flag((yyvsp[(4) - (5)].targ), (yyvsp[(2) - (5)].sval));
                         ;}
@@ -3893,14 +3893,14 @@
                              }
                              else { /* is not a register but a symbol */
 
-                                 symbol *sym = find_symbol(lexer, (yyvsp[(1) - (4)].targ)->s.sym->name);
+                                 symbol *sym = find_symbol(lexer, (yyvsp[(1) - (4)].targ)->info->id.name);
                                  if (sym == NULL)
                                      yypirerror(yyscanner, lexer,
-                                             "symbol '%s' was not declared", (yyvsp[(1) - (4)].targ)->s.sym->name);
-                                 else if ((yyvsp[(1) - (4)].targ)->s.sym->type != PMC_TYPE)
+                                             "symbol '%s' was not declared", (yyvsp[(1) - (4)].targ)->info->id.name);
+                                 else if ((yyvsp[(1) - (4)].targ)->info->type != PMC_TYPE)
                                      yypirerror(yyscanner, lexer,
                                              "cannot invoke method: '%s' is not of type 'pmc'",
-                                             (yyvsp[(1) - (4)].targ)->s.sym->name);
+                                             (yyvsp[(1) - (4)].targ)->info->id.name);
 
                                  /* get a target based on the symbol, it contains a register */
                                  invocant = (yyvsp[(1) - (4)].targ);
@@ -3945,8 +3945,8 @@
                                 /* make sure sym is not NULL */
                                 sym = new_symbol(lexer, (yyvsp[(1) - (1)].sval), PMC_TYPE);
                              }
-                             else if (sym->type != PMC_TYPE
-                                  &&  sym->type != STRING_TYPE)
+                             else if (sym->info.type != PMC_TYPE
+                                  &&  sym->info.type != STRING_TYPE)
                                  yypirerror(yyscanner, lexer,
                                          "method '%s' must be of type 'pmc' or 'string'", (yyvsp[(1) - (1)].sval));
 
@@ -5988,43 +5988,21 @@
 write_signature(NOTNULL(expression * const iter), NOTNULL(char *instr_writer)) {
     switch (iter->type) {
         case EXPR_TARGET:
-            if (TEST_FLAG(iter->expr.t->flags, TARGET_FLAG_IS_REG))
-                *instr_writer++ = type_codes[iter->expr.t->s.reg->type];
-            else
-                *instr_writer++ = type_codes[iter->expr.t->s.sym->type];
+            *instr_writer++ = type_codes[iter->expr.t->info->type];
 
             if (iter->expr.t->key) {
                 *instr_writer++ = '_';
                 *instr_writer++ = 'k';
-                /* XXX fix this mess. */
+
                 if ((iter->expr.t->key->expr->type == EXPR_TARGET)
-                    &&
-                    (  (iter->expr.t->key->expr->expr.t->flags & TARGET_FLAG_IS_REG)
-                     ?
-                       (iter->expr.t->key->expr->expr.t->s.reg->type == PMC_TYPE)
-                     :
-                       (iter->expr.t->key->expr->expr.t->s.sym->type == PMC_TYPE)
-                    )
-                   ) {
+                &&  (iter->expr.t->key->expr->expr.t->info->type == PMC_TYPE)) {
                     /* the key is a target, and its type is a PMC. In that case, do not
                      * print the signature; 'kp' is not valid.
                      */
                 }
                 else {
-                    if (
-                       (iter->expr.t->key->expr->type == EXPR_TARGET)
-                       &&
-
-
-                       (
-                       (iter->expr.t->key->expr->expr.t->flags & TARGET_FLAG_IS_REG)
-                       ?
-                       (iter->expr.t->key->expr->expr.t->s.reg->type == INT_TYPE)
-                       :
-                       (iter->expr.t->key->expr->expr.t->s.sym->type == INT_TYPE)
-                       )
-                       )
-
+                    if ((iter->expr.t->key->expr->type == EXPR_TARGET)
+                    &&  (iter->expr.t->key->expr->expr.t->info->type == INT_TYPE))
                     {
                        *instr_writer++ = 'i';
                     }
@@ -6235,7 +6213,8 @@
 
             if (sym) {
                 operand->expr.t        = new_target(lexer);
-                operand->expr.t->s.sym = sym;  /* target's pointer set to symbol */
+                /* operand->expr.t->s.sym = sym;  */ /* target's pointer set to symbol */
+                operand->expr.t->info  = &sym->info;
                 operand->type          = EXPR_TARGET; /* convert operand node into EXPR_TARGET */
             }
             else { /* it must be a label */

Modified: branches/rakudoreg/compilers/pirc/new/pirsymbol.c
==============================================================================
--- branches/rakudoreg/compilers/pirc/new/pirsymbol.c	(original)
+++ branches/rakudoreg/compilers/pirc/new/pirsymbol.c	Tue Dec 16 15:28:09 2008
@@ -80,18 +80,18 @@
 */
 void
 assign_vanilla_register(NOTNULL(lexer_state * const lexer), symbol * const sym) {
-    sym->color    = next_register(lexer, sym->type);
+    sym->info.color    = next_register(lexer, sym->info.type);
 
-    sym->interval = new_live_interval(lexer->lsr, lexer->stmt_counter, sym->type);
+    sym->info.interval = new_live_interval(lexer->lsr, lexer->stmt_counter, sym->info.type);
 
     /* set the reference of the interval to the symbol's color */
-    sym->interval->color = &sym->color;
+    sym->info.interval->color = &sym->info.color;
 
     /* mark the interval, so that its register is not reused, if the :unique_reg
      * flag was set.
      */
     if (TEST_FLAG(sym->flags, TARGET_FLAG_UNIQUE_REG))
-        SET_FLAG(sym->interval->flags, INTERVAL_FLAG_UNIQUE_REG);
+        SET_FLAG(sym->info.interval->flags, INTERVAL_FLAG_UNIQUE_REG);
 }
 
 
@@ -167,9 +167,10 @@
 symbol *
 new_symbol(NOTNULL(lexer_state * const lexer), NOTNULL(char const * const name), pir_type type) {
     symbol *sym = pir_mem_allocate_zeroed_typed(lexer, symbol);
-    sym->name   = name;
-    sym->type   = type;
-    sym->color  = NO_REG_ALLOCATED;
+
+    sym->info.id.name = name;
+    sym->info.type    = type;
+    sym->info.color   = NO_REG_ALLOCATED;
 
     sym->next   = NULL;
     return sym;
@@ -200,7 +201,7 @@
     /* store all symbols in the list and set the type on each symbol. */
     while (iter != NULL) {
 
-        unsigned long hash = get_hashcode(iter->name, table->size);
+        unsigned long hash = get_hashcode(iter->info.id.name, table->size);
 
         /* look up this symbol; if it exists already, that's an error.
          * don't use find_symbol, as that will update the live_interval of the symbol.
@@ -210,8 +211,9 @@
         bucket *b = get_bucket(table, hash);
         while (b) {
             symbol *s = bucket_symbol(b);
-            if (STREQ(s->name, iter->name)) {
-                yypirerror(lexer->yyscanner, lexer, "symbol '%s' already declared", iter->name);
+            if (STREQ(s->info.id.name, iter->info.id.name)) {
+                yypirerror(lexer->yyscanner, lexer, "symbol '%s' already declared",
+                iter->info.id.name);
                 break; /* out of the loop */
             }
             b = b->next;
@@ -222,7 +224,7 @@
             b = new_bucket(lexer);
             bucket_symbol(b) = iter;
             store_bucket(table, b, hash);
-            iter->type  = type;
+            iter->info.type  = type;
         }
 
 
@@ -255,9 +257,9 @@
         for (i = 0; i < symbols->size; i++) {
             bucket *b = get_bucket(symbols, i);
             while (b) {
-                if (bucket_symbol(b)->color == NO_REG_ALLOCATED)
+                if (bucket_symbol(b)->info.color == NO_REG_ALLOCATED)
                     fprintf(stderr, "Warning: in sub '%s': symbol '%s' declared but not used\n",
-                                    subiter->sub_name, bucket_symbol(b)->name);
+                                    subiter->sub_name, bucket_symbol(b)->info.id.name);
 
                 b = b->next;
             }
@@ -292,17 +294,17 @@
     while (buck) {
         symbol *sym = bucket_symbol(buck);
 
-        if (STREQ(sym->name, name)) {
-            if (sym->color == NO_REG_ALLOCATED)  /* no PASM register assigned yet */
+        if (STREQ(sym->info.id.name, name)) {
+            if (sym->info.color == NO_REG_ALLOCATED)  /* no PASM register assigned yet */
                 /* get a new reg from vanilla reg. allocator */
                 assign_vanilla_register(lexer, sym);
             else  /* update end point of interval */
-                sym->interval->endpoint = lexer->stmt_counter;
+                sym->info.interval->endpoint = lexer->stmt_counter;
 
 
             if (TEST_FLAG(lexer->flags, LEXER_FLAG_VERBOSE))
-                fprintf(stderr, "live range of variable %s: (%d, %d)\n", sym->name,
-                        sym->interval->startpoint, sym->interval->endpoint);
+                fprintf(stderr, "live range of variable %s: (%d, %d)\n", sym->info.id.name,
+                        sym->info.interval->startpoint, sym->info.interval->endpoint);
 
             return sym;
         }
@@ -329,10 +331,10 @@
 new_pir_reg(NOTNULL(lexer_state * const lexer), pir_type type, int regno) {
     pir_reg *r = pir_mem_allocate_zeroed_typed(lexer, pir_reg);
 
-    r->type    = type;
-    r->color   = NO_REG_ALLOCATED;
+    r->info.type     = type;
+    r->info.color    = NO_REG_ALLOCATED;
+    r->info.id.regno = regno;
 
-    r->regno   = regno;
     r->next    = NULL;
 
     return r;
@@ -357,9 +359,9 @@
      */
     pir_reg *iter = CURRENT_SUB(lexer)->registers[type];
     while (iter != NULL) {
-        if (iter->regno == regno) {
+        if (iter->info.id.regno == regno) {
             /* update the end point of this register's live interval */
-            iter->interval->endpoint = lexer->stmt_counter;
+            iter->info.interval->endpoint = lexer->stmt_counter;
             return iter;
         }
 
@@ -398,12 +400,12 @@
     /* create a new node representing this PIR register */
     reg = new_pir_reg(lexer, type, regno);
     /* get a new PASM register for this PIR register. */
-    reg->color = pasmregno;
+    reg->info.color = pasmregno;
 
     /* create a new live interval for this symbolic register */
-    reg->interval = new_live_interval(lexer->lsr, lexer->stmt_counter, type);
+    reg->info.interval = new_live_interval(lexer->lsr, lexer->stmt_counter, type);
     /* let the interval have a pointer to this symbolic register */
-    reg->interval->color = &reg->color;
+    reg->info.interval->color = &reg->info.color;
 
 
     /* link this register into the list of "colored" registers; each of
@@ -433,7 +435,7 @@
     **/
 
     /* return newly allocated register */
-    return reg->color;
+    return reg->info.color;
 }
 
 
@@ -463,8 +465,8 @@
      */
     if (reg) {
         /* update end point of interval */
-        reg->interval->endpoint = lexer->stmt_counter;
-        return reg->color;
+        reg->info.interval->endpoint = lexer->stmt_counter;
+        return reg->info.color;
     }
 
     if (TEST_FLAG(lexer->flags, LEXER_FLAG_PASMFILE)) { /* PASM mode */

Modified: branches/rakudoreg/compilers/pirc/new/pirsymbol.h
==============================================================================
--- branches/rakudoreg/compilers/pirc/new/pirsymbol.h	(original)
+++ branches/rakudoreg/compilers/pirc/new/pirsymbol.h	Tue Dec 16 15:28:09 2008
@@ -26,19 +26,18 @@
     pir_type       type;
     live_interval *interval;
 
+    union sym_id {  /* identification of this symbol/reg */
+        char const *name;
+        int         regno;
+    } id;
+
 } syminfo;
 
 
 /* structure to represent a declared local variable or parameter */
 typedef struct symbol {
     syminfo        info;
-    int            color;
-    pir_type       type;
-    live_interval *interval;
-
-    char const    *name;  /* name of this symbol */
     target_flag    flags;
-
     struct symbol *next;
 
 } symbol;
@@ -47,12 +46,6 @@
 /* structure to represent a PIR register. */
 typedef struct pir_reg {
     syminfo         info;
-    int             color;
-    pir_type        type;
-    live_interval  *interval;
-
-    int             regno; /* symbolic (PIR) register number */
-
     struct pir_reg *next;
 
 } pir_reg;

Modified: branches/rakudoreg/docs/book/ch13_reference.pod
==============================================================================
--- branches/rakudoreg/docs/book/ch13_reference.pod	(original)
+++ branches/rakudoreg/docs/book/ch13_reference.pod	Tue Dec 16 15:28:09 2008
@@ -1834,17 +1834,6 @@
 
 See also: C<unpin>.
 
-=head3 pioctl
-
-X<pioctl opcode (PASM)>
-
-  pioctl R<DEST>, R<PIO>, R<VAL>, R<VAL>
-
-Perform an operation on an IO object. This is a general purpose
-hook for setting various flags, modes, etc.
-
-I<Arguments: IR, P, I, I>
-
 =head3 pop
 
 X<pop opcode (PASM)>

Modified: branches/rakudoreg/docs/pdds/pdd19_pir.pod
==============================================================================
--- branches/rakudoreg/docs/pdds/pdd19_pir.pod	(original)
+++ branches/rakudoreg/docs/pdds/pdd19_pir.pod	Tue Dec 16 15:28:09 2008
@@ -434,7 +434,9 @@
 constants at compile time, provided that (a) the generated constant can be
 computed at compile time (i.e. doesn't depend on the runtime environment), and
 (b) the constant value is of a PMC class that supports saving in a bytecode
-file [need a freeze/thaw reference].
+file.
+
+{{ TODO: need a freeze/thaw reference }}.
 
 For example, C<examples/shootout/revcomp.pir> contains the following (slightly
 abbreviated) definition:
@@ -735,13 +737,15 @@
 A keyed C<set> operation for PMCs or a substring operation for string
 arguments and an integer key.
 
-{{ DEPRECATION NOTE: Possibly deprecate the substring variant. }}
+{{ DEPRECATION NOTE: The substring operation for string arguments is
+   deprecated, and will be removed after the 0.8.2 release. }}
 
 =item <var> = <var> [ <key> ]
 
 {{ NOTE: keyed assignment is still valid in PIR, but the C<..> notation in
 keys is deprecated [See RT #48561], so this syntactic sugar for slices is also
-deprecated. See the (currently experimental) C<slice> opcode instead. }}
+deprecated. See the (currently experimental) C<slice> opcode instead, but
+this, too, is deprecated. }}
 
 where C<key> is:
 
@@ -944,16 +948,17 @@
 
 can also be expanded by writing either C<.foo> or C<.foo()>.
 
-{{ NOTE: this is a change from the current implementation, which requires the
-definition and call of a zero-parameter macro to match in the use of
-parentheses. }}
+B<Note: IMCC requires you to write parentheses if the macro was declared with
+(empty) parentheses. Likewise, when no parentheses were written (implying an
+empty parameter list), no parentheses may be used in the expansion.>
 
 =over
 
 =item * Heredoc arguments
 
-Heredoc arguments are not allowed when expanding a macro. This means that
-the following is not allowed:
+Heredoc arguments are not allowed when expanding a macro. The next
+implementation of PIR ("PIRC") will be able to handle this correctly.
+This means that, currently, when using IMCC, the following is not allowed:
 
    .macro foo(bar)
    ...
@@ -965,9 +970,6 @@
 
  EOS
 
-{{ NOTE: This is because the parsing of heredocs happens later than the
-preprocessing of macros. Might be nice if we could parse heredocs at the macro
-level, but not a high priority. compilers/pirc/new can do this. }}
 
 Using braces, { }, allows you to span multiple lines for an argument.
 See runtime/parrot/include/hllmacros.pir for examples and possible usage.
@@ -1016,6 +1018,8 @@
 
 =head3 Unique local variables
 
+B<Note: this is not yet implemented in IMCC>.
+
 Within the macro body, the user can declare a local variable with a unique
 name.
 
@@ -1123,62 +1127,73 @@
 
 =head2 Subroutine Definition
 
-  .sub _sub_label [<subflag>]*
-   .param int a
-   .param int b
-   .param int c
-  ...
-  .begin_return
-   .set_return xy
-  .end_return
-  ...
-  .end
+A simple subroutine, marked with C<:main>, indicating it's the entry point
+in the file. Other sub flags include C<:load>, C<:init>, etc.
+
+    .sub sub_label :main
+      .param int a
+      .param int b
+      .param int c
+
+      .begin_return
+        .set_return xy
+      .end_return
+
+    .end
 
 =head2 Subroutine Call
 
-  .const "Sub" $P0 = "_sub_label"
-  $P1 = new 'Continuation'
-  set_addr $P1, ret_addr
-  ...
-  .local int x
-  .local num y
-  .local str z
-  .begin_call
-  .set_arg x
-  .set_arg y
-  .set_arg z
-  .call $P0, $P1    # r = _sub_label(x, y, z)
+Invocation of a subroutine. In this case a continuation subroutine is
+created.
+
+    .const "Sub" $P0 = "sub_label"
+    $P1 = new 'Continuation'
+    set_addr $P1, ret_addr
+    # ...
+    .local int x
+    .local num y
+    .local string z
+    .begin_call
+      .set_arg x
+      .set_arg y
+      .set_arg z
+      .call $P0, $P1    # r = _sub_label(x, y, z)
   ret_addr:
-  .local int r  # optional - new result var
-  .get_result r
-  .end_call
+      .local int r      # optional - new result var
+      .get_result r
+    .end_call
 
 =head2 NCI Call
 
-  load_lib $P0, "libname"
-  dlfunc $P1, $P0, "funcname", "signature"
-  ...
-  .begin_call
-  .set_arg x
-  .set_arg y
-  .set_arg z
-  .nci_call $P1 # r = funcname(x, y, z)
-  .local int r  # optional - new result var
-  .get_result r
-  .end_call
+    load_lib $P0, "libname"
+    dlfunc $P1, $P0, "funcname", "signature"
+    # ...
+    .begin_call
+      .set_arg x
+      .set_arg y
+      .set_arg z
+      .nci_call $P1 # r = funcname(x, y, z)
+      .local int r  # optional - new result var
+      .get_result r
+    .end_call
 
 =head2 Subroutine Call Syntactic Sugar
 
-  ...  # variable decls
-  r = _sub_label(x, y, z)
-  (r1[, r2 ...]) = _sub_label(x, y, z)
-  _sub_label(x, y, z)
+Below there are three different ways to invoke the subroutine C<sub_label>.
+The first retrieves a single return value, the second retrieves 3 return
+values, whereas the last discards any return values.
+
+  .local int r0, r1, r2
+  r0 = sub_label($I0, $I1, $I2)
+  (r0, r1, r2) = sub_label($I0, $I1, $I2)
+  sub_label($I0, $I1, $I2)
 
 This also works for NCI calls, as the subroutine PMC will be
 a NCI sub, and on invocation will do the Right Thing.
+
 Instead of the label a subroutine object can be used too:
 
-   get_global $P0, "_sub_label"
+   get_global $P0, "sub_label"
    $P0(args)
 
 
@@ -1187,16 +1202,16 @@
   .namespace [ "Foo" ]
 
   .sub _sub_label :method [,Subpragma, ...]
-   .param int a
-   .param int b
-   .param int c
-   ...
-   self."_other_meth"()
-  ...
-  .begin_return
-   .set_return xy
-  .end_return
-  ...
+    .param int a
+    .param int b
+    .param int c
+    # ...
+    self."_other_meth"()
+    # ...
+    .begin_return
+    .set_return xy
+    .end_return
+    ...
   .end
 
 The variable "self" automatically refers to the invocating object, if the
@@ -1205,21 +1220,22 @@
 =head2 Calling Methods
 
 The syntax is very similar to subroutine calls. The call is done with
-C<meth_call> which must immediately be preceded by the C<.invocant>:
+C<.meth_call> which must immediately be preceded by the C<.invocant>:
 
-   .local pmc class
-   .local pmc obj
+   .local int x, y, z
+   .local pmc class, obj
    newclass class, "Foo"
    new obj, class
-  .begin_call
-  .set_arg x
-  .set_arg y
-  .set_arg z
-  .invocant obj
-  .meth_call "_method" [, $P1 ] # r = obj."_method"(x, y, z)
-  .local int r  # optional - new result var
-  .get_result r
-  .end_call
+   .begin_call
+   .set_arg x
+   .set_arg y
+   .set_arg z
+   .invocant obj
+   .meth_call "method" [, $P1 ] # r = obj."method"(x, y, z)
+   .local int r  # optional - new result var
+   .get_result r
+   .end_call
+   ...
 
 The return continuation is optional. The method can be a string
 constant or a string variable.
@@ -1241,40 +1257,6 @@
   .yield ()            # yield with no value
 
 
-=head2 Stack calling conventions
-
-Arguments are B<save>d in reverse order onto the user stack:
-
-   .set_arg y   # save args in reversed order
-   .set_arg x
-   call _foo    #(r, s) = _foo(x,y)
-   .local int r
-   .local int s
-   .get_result r    # restore results in order
-   .get_result s    #
-
-and return values are B<restore>d in argument order from there.
-
-
-
- .sub _foo      # sub foo(int a, int b)
-   saveall
-   .param int a         # receive arguments from left to right
-   .param int b
-   ...
-
-   .return mi       # return (pl, mi), push results
-   .return pl       # in reverse order
-   restoreall
-   ret
- .end
-
-Pushing arguments in reversed order on the user stack makes the left
-most argument the top of stack entry. This allows for a variable
-number of function arguments (and return values), where the left most
-argument before a variable number of following arguments is the
-argument count.
-
 =head1 IMPLEMENTATION
 
 There are multiple implementations of PIR, each of which will meet this
@@ -1285,13 +1267,14 @@
 
 =item * compilers/imcc
 
-This is the current implementation being used in Parrot.
+This is the current implementation being used in Parrot. Some of the
+specified syntactic constructs in this PDD are not implemented in
+IMCC; these constructs are marked with notes saying so.
 
 =item * compilers/pirc
 
-This is a new implementation which will fix several of
-IMCC's shortcomings. It will replace IMCC in the not too
-distant future.
+This is a new implementation which will fix several of IMCC's
+shortcomings. It will replace IMCC in the not too distant future.
 
 =item * languages/PIR
 

Modified: branches/rakudoreg/docs/pdds/pdd22_io.pod
==============================================================================
--- branches/rakudoreg/docs/pdds/pdd22_io.pod	(original)
+++ branches/rakudoreg/docs/pdds/pdd22_io.pod	Tue Dec 16 15:28:09 2008
@@ -492,8 +492,7 @@
   $P0 = readline $P1, $P2
 
 Retrieves a single line from a stream into a string. Calling
-C<readline> flags the stream as operating in line-buffer mode (see
-C<pioctl> below).
+C<readline> flags the stream as operating in line-buffer mode.
 
 The asynchronous version takes an additional final PMC callback
 argument, and only returns a status object. When the readline operation
@@ -575,52 +574,6 @@
 
 =back
 
-=head3 Deprecated opcodes
-
-=over
-
-=item *
-
-C<pioctl> provides low-level access to the attributes of a stream
-object. It takes a stream object, an integer flag to select a command,
-and a single integer argument for the command. It returns an integer
-indicating the success or failure of the command.
-
-This opcode has been replaced with methods on the FileHandle object, but
-is kept here for reference. See RT #48589
-
-The following constants are defined for the commands that C<pioctl> can
-execute:
-
-  0    PIOCTL_CMDRESERVED
-           No documentation available.
-  1    PIOCTL_CMDSETRECSEP
-           Set the record separator. [This doesn't actually work at the
-           moment.]
-  2    PIOCTL_CMDGETRECSEP
-           Get the record separator.
-  3    PIOCTL_CMDSETBUFTYPE
-           Set the buffer type.
-  4    PIOCTL_CMDGETBUFTYPE
-           Get the buffer type
-  5    PIOCTL_CMDSETBUFSIZE
-           Set the buffer size.
-  6    PIOCTL_CMDGETBUFSIZE
-           Get the buffer size.
-
-The following constants are defined as argument/return values for the
-buffer-type commands:
-
-  0    PIOCTL_NONBUF
-           Unbuffered I/O. Bytes are sent as soon as possible.
-  1    PIOCTL_LINEBUF
-           Line buffered I/O. Bytes are sent when a newline is
-           encountered.
-  2    PIOCTL_BLKBUF
-           Fully buffered I/O. Bytes are sent when the buffer is full.
-
-=back
-
 =head2 Filesystem Opcodes
 
 [Okay, I'm seriously considering moving most of these to methods on the

Modified: branches/rakudoreg/docs/project/release_manager_guide.pod
==============================================================================
--- branches/rakudoreg/docs/project/release_manager_guide.pod	(original)
+++ branches/rakudoreg/docs/project/release_manager_guide.pod	Tue Dec 16 15:28:09 2008
@@ -172,6 +172,10 @@
 
 =item 8.
 
+=over 4
+
+=item a. CPAN
+
 In PAUSE, assign yourself co-maintainer permissions on all modules owned by
 PARROTRE.
 
@@ -189,6 +193,29 @@
 
 See F<docs/project/pause_guide.pod> for more details.
 
+=item b. FTP
+
+SSH to ftp-osl.osuosl.org. (If you don't have the necessary login information,
+get it from one of the previous release managers.)
+
+Make a new directory for the new release named "a.b.c" after the version
+number. If the release is in the stable series (1.0, 1.5, 2.0, 2.5, etc) create
+the new directory in F<ftp/releases/stable>, if the release is a monthly
+release between stable versions, create the directory in F<ftp/releases/devel>.
+
+Copy the tarball into the new directory. (Using C<scp> or C<wget> or whatever
+tool you prefer.)
+
+When you're finished making changes, run the trigger script to push the changes
+out to the FTP mirrors.
+
+  ~/trigger-parrot
+
+Check your changes at F<ftp://ftp.parrot.org/pub/parrot/releases>. It should
+only take a few minutes for the mirrors to sync.
+
+=back
+
 =item 9.
 
 Compose the release announcement.  Use F<tools/util/crow.pir> to make
@@ -237,9 +264,9 @@
 
 =item e
 
-Send an email to webmaster@parrotcode.org requesting that they update the
-C</.htredirects> file for release/devel to point to the proper CPAN URL. [This
-step will change in the near future.]
+Under "Administer" -> "Site building" -> "URL Redirects", change the URL for
+"release/current" to the FTP directory for the new release (for example,
+F<ftp://ftp.parrot.org/pub/parrot/releases/devel/0.8.1>).
 
 =back
 

Modified: branches/rakudoreg/editor/pir-mode.el
==============================================================================
--- branches/rakudoreg/editor/pir-mode.el	(original)
+++ branches/rakudoreg/editor/pir-mode.el	Tue Dec 16 15:28:09 2008
@@ -190,7 +190,7 @@
     "n_infix" "ne" "needs_destroy" "neg" "new" "new_callback" "newclass"
     "newclosure" "nors" "not" "null"
     "open" "or" "ord"
-    "peek" "pin" "pioctl" "poll" "pop" "popmark" "pow" "print" "printerr"
+    "peek" "pin" "poll" "pop" "popmark" "pow" "print" "printerr"
     "profile" "prophash" "push" "push_eh" "pushaction" "pushmark"
     "read" "readline" "recv" "register" "removeattribute" "removeparent"
     "repeat" "restore" "result_info" "ret" "rethrow" "returncc"

Modified: branches/rakudoreg/examples/tge/branch/transform.pir
==============================================================================
--- branches/rakudoreg/examples/tge/branch/transform.pir	(original)
+++ branches/rakudoreg/examples/tge/branch/transform.pir	Tue Dec 16 15:28:09 2008
@@ -5,7 +5,7 @@
 =head1 SYNOPSIS
 
   # must be run from this directory ...
-  $ ../../../parrot transform.pir branch.g 
+  $ ../../../parrot transform.pir branch.g
 
 =head1 DESCRIPTION
 

Modified: branches/rakudoreg/languages/perl6/config/makefiles/root.in
==============================================================================
--- branches/rakudoreg/languages/perl6/config/makefiles/root.in	(original)
+++ branches/rakudoreg/languages/perl6/config/makefiles/root.in	Tue Dec 16 15:28:09 2008
@@ -75,6 +75,7 @@
   src/classes/Method.pir \
   src/classes/Junction.pir \
   src/classes/Failure.pir \
+  src/classes/Exception.pir \
   src/classes/Nil.pir \
   src/classes/Role.pir \
   src/classes/Pair.pir \

Modified: branches/rakudoreg/languages/perl6/src/builtins/any-list.pir
==============================================================================
--- branches/rakudoreg/languages/perl6/src/builtins/any-list.pir	(original)
+++ branches/rakudoreg/languages/perl6/src/builtins/any-list.pir	Tue Dec 16 15:28:09 2008
@@ -368,6 +368,7 @@
     .return ($I0)
 .end
 
+
 =back
 
 =cut

Modified: branches/rakudoreg/languages/perl6/src/classes/Failure.pir
==============================================================================
--- branches/rakudoreg/languages/perl6/src/classes/Failure.pir	(original)
+++ branches/rakudoreg/languages/perl6/src/classes/Failure.pir	Tue Dec 16 15:28:09 2008
@@ -8,8 +8,6 @@
     p6meta = get_hll_global ['Perl6Object'], '$!P6META'
     failureproto = p6meta.'new_class'('Failure', 'parent'=>'Undef Any', 'attr'=>'$!exception')
     p6meta.'register'('Undef', 'parent'=>failureproto, 'protoobject'=>failureproto)
-    exceptionproto = p6meta.'new_class'('Perl6Exception', 'parent'=>'Any Exception', 'attr'=>'$!exception', 'name'=>'Exception')
-    p6meta.'register'('Exception', 'protoobject'=>exceptionproto)
 
     $P0 = box 1
     set_hll_global '$WARNINGS', $P0

Modified: branches/rakudoreg/languages/perl6/src/classes/Pair.pir
==============================================================================
--- branches/rakudoreg/languages/perl6/src/classes/Pair.pir	(original)
+++ branches/rakudoreg/languages/perl6/src/classes/Pair.pir	Tue Dec 16 15:28:09 2008
@@ -62,6 +62,15 @@
 .end
 
 
+=item pairs
+
+=cut
+
+.sub 'pairs' :method
+    .tailcall self.'list'()
+.end
+
+
 =item get_string()  (vtable method)
 
 Stringify the Pair.
@@ -137,6 +146,22 @@
 .end
 
 
+.sub 'infix:cmp' :multi(['Perl6Pair'], ['Perl6Pair'])
+    .param pmc a
+    .param pmc b
+    $P0 = a.'key'()
+    $P1 = b.'key'()
+    $I0 = 'infix:cmp'($P0, $P1)
+    unless $I0 == 0 goto done
+    $P0 = a.'value'()
+    $P1 = b.'value'()
+    $I0 = 'infix:cmp'($P0, $P1)
+  done:
+    $P0 = 'infix:<=>'($I0, 0)
+    .return ($P0)
+.end
+
+
 =back
 
 =cut

Modified: branches/rakudoreg/languages/perl6/src/parser/actions.pm
==============================================================================
--- branches/rakudoreg/languages/perl6/src/parser/actions.pm	(original)
+++ branches/rakudoreg/languages/perl6/src/parser/actions.pm	Tue Dec 16 15:28:09 2008
@@ -453,6 +453,11 @@
             PAST::Var.new( :name('$_'), :scope('lexical') ),
             PAST::Var.new( :name('exception'), :scope('register') )
         ),
+        PAST::Op.new(
+            :pasttype('bind'),
+            PAST::Var.new( :name('$!'), :scope('lexical') ),
+            PAST::Var.new( :name('exception'), :scope('register') )
+        ),
         $past
     );
     our $?BLOCK;
@@ -466,6 +471,36 @@
     make PAST::Stmts.new();
 }
 
+method control_statement($/) {
+    my $past := $( $<block> );
+    $past.blocktype('immediate');
+    $past := PAST::Stmts.new(
+        PAST::Op.new(
+            :pasttype('bind'),
+            PAST::Var.new( :name('$_'), :scope('lexical') ),
+            PAST::Var.new( :name('exception'), :scope('register') )
+        ),
+        PAST::Op.new(
+            :pasttype('bind'),
+            PAST::Var.new( :name('$!'), :scope('lexical') ),
+            PAST::Var.new( :name('exception'), :scope('register') )
+        ),
+        $past
+    );
+    our $?BLOCK;
+    my $eh := PAST::Control.new(
+        $past,
+        :handle_types('CONTROL')
+    );
+    my @handlers;
+    if $?BLOCK.handlers() {
+        @handlers := $?BLOCK.handlers();
+    }
+    @handlers.unshift($eh);
+    $?BLOCK.handlers(@handlers);
+    make PAST::Stmts.new();
+}
+
 method statement_mod_loop($/) {
     my $expr := $( $<EXPR> );
     my $sym := ~$<sym>;

Modified: branches/rakudoreg/languages/perl6/src/parser/grammar.pg
==============================================================================
--- branches/rakudoreg/languages/perl6/src/parser/grammar.pg	(original)
+++ branches/rakudoreg/languages/perl6/src/parser/grammar.pg	Tue Dec 16 15:28:09 2008
@@ -243,6 +243,7 @@
     | <begin_statement> {*}                      #= begin_statement
     | <end_statement> {*}                        #= end_statement
     | <catch_statement> {*}                      #= catch_statement
+    | <control_statement> {*}                    #= control_statement
 }
 
 rule if_statement {
@@ -332,6 +333,12 @@
     {*}
 }
 
+rule control_statement {
+    $<sym>=[CONTROL]
+    <block>
+    {*}
+}
+
 rule statement_mod_loop {
     $<sym>=[while|until|for|given] <EXPR> {*}
 }

Modified: branches/rakudoreg/languages/perl6/t/spectest.data
==============================================================================
--- branches/rakudoreg/languages/perl6/t/spectest.data	(original)
+++ branches/rakudoreg/languages/perl6/t/spectest.data	Tue Dec 16 15:28:09 2008
@@ -159,6 +159,7 @@
 S06-traits/misc.t
 S09-subscript_slice/slice.t
 S10-packages/import.t
+S10-packages/use-with-class.t
 S11-modules/export.t
 S12-attributes/class2.t
 S12-attributes/class.t

Modified: branches/rakudoreg/src/pmc/filehandle.pmc
==============================================================================
--- branches/rakudoreg/src/pmc/filehandle.pmc	(original)
+++ branches/rakudoreg/src/pmc/filehandle.pmc	Tue Dec 16 15:28:09 2008
@@ -78,13 +78,13 @@
 
         /* Initialize the os_handle to the platform-specific value for closed. */
 #ifdef PIO_OS_WIN32
-        data_struct->os_handle    = (PIOHANDLE)INVALID_HANDLE_VALUE;
+    data_struct->os_handle    = (PIOHANDLE)INVALID_HANDLE_VALUE;
 #endif
 #ifdef PIO_OS_UNIX
-        data_struct->os_handle    = (PIOHANDLE)-1;
+    data_struct->os_handle    = (PIOHANDLE)-1;
 #endif
 #ifdef PIO_OS_STDIO
-        data_struct->os_handle    = (PIOHANDLE)NULL;
+    data_struct->os_handle    = (PIOHANDLE)NULL;
 #endif
 
         PObj_custom_mark_SET(SELF);

Modified: branches/rakudoreg/t/perl/testlib/answer.pir
==============================================================================
--- branches/rakudoreg/t/perl/testlib/answer.pir	(original)
+++ branches/rakudoreg/t/perl/testlib/answer.pir	Tue Dec 16 15:28:09 2008
@@ -1,5 +1,5 @@
 # Copyright (C) 2001-2008, The Perl Foundation.
-# $Id: hello-dwim.pir 25819 2008-02-18 00:16:21Z coke $
+# $Id$
 .sub _main
     print "The answer is\n"
     add $I0, 20, 23

Modified: branches/rakudoreg/t/pmc/io_iterator.t
==============================================================================
--- branches/rakudoreg/t/pmc/io_iterator.t	(original)
+++ branches/rakudoreg/t/pmc/io_iterator.t	Tue Dec 16 15:28:09 2008
@@ -22,8 +22,6 @@
 
 =cut
 
-# RT #46849 create helper functions to put data in an i/o pmc
-
 # L<PDD22/I\/O Iterator PMC API/=item new>
 pir_output_is( <<'CODE', <<'OUT', 'new', todo => 'not yet implemented' );
 .sub 'test' :main



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About