[svn:parrot] r37619 - in trunk: . docs/book

coke at svn.parrot.org coke at svn.parrot.org
Sat Mar 21 18:25:29 UTC 2009


Author: coke
Date: Sat Mar 21 18:25:28 2009
New Revision: 37619
URL: https://trac.parrot.org/parrot/changeset/37619

Log:
[t/docs] Fixup more PIR examples. Skip one with a ticket #.
Thanks to mikehh++ for the initial version of the patch.

Fixup mikehh's credit entry.

Modified:
   trunk/CREDITS
   trunk/docs/book/ch04_pir_subroutines.pod

Modified: trunk/CREDITS
==============================================================================
--- trunk/CREDITS	Sat Mar 21 18:14:58 2009	(r37618)
+++ trunk/CREDITS	Sat Mar 21 18:25:28 2009	(r37619)
@@ -644,7 +644,7 @@
 U: mikescott
 W: http://xrl.us/sml
 
-U: mikeh
+U: mikehh
 D: codingstd patches
 
 N: Michael Stevens

Modified: trunk/docs/book/ch04_pir_subroutines.pod
==============================================================================
--- trunk/docs/book/ch04_pir_subroutines.pod	Sat Mar 21 18:14:58 2009	(r37618)
+++ trunk/docs/book/ch04_pir_subroutines.pod	Sat Mar 21 18:25:28 2009	(r37619)
@@ -117,7 +117,7 @@
      count = 5
      product = 1
 
-     $I0 = fact(count, product)
+     $I0 = 'fact'(count, product)
 
      print $I0
      print "\n"
@@ -134,7 +134,7 @@
      dec c
      branch loop
   fin:
-     .return p
+     .return (p)
   .end
 
 =end PIR
@@ -168,11 +168,11 @@
 =begin PIR
 
  .sub 'MySub'
-    .param int yrs :named("age")
+    .param string yrs :named("age")
     .param string call :named("name")
     $S0 = "Hello " . call
     $S1 = "You are " . yrs
-    $S1 = $S1 . " years old
+    $S1 = $S1 . " years old"
     print $S0
     print $S1
  .end
@@ -411,7 +411,7 @@
   .sub add_two
       .param int value
       .local int val2
-      val2 = add_one(value
+      val2 = add_one(value)
       .tailcall add_one(val2)
   .end
 
@@ -419,7 +419,7 @@
       .param int a
       .local int b
       b = a + 1
-      return b
+      .return (b)
   .end
 
 =end PIR
@@ -539,14 +539,16 @@
 =begin PIR
 
   .sub 'MyOuter'
-      .lex int x
-      .lex int y
+      .local int x,y
+      .lex 'x', x
+      .lex 'y', y
       'MyInner'()
       # only x and y are visible here
   .end
 
   .sub 'MyInner' :outer('MyOuter')
-      .lex int z
+      .local int z
+      .lex 'z', z
       #x, y, and z are all "visible" here
   .end
 
@@ -636,13 +638,11 @@
 
   .sub main
       $I1 = 5           # counter
-      call fact         # same as "bsr fact"
-      print $I0
-      print "\n"
+      bsr fact
+      say $I0
       $I1 = 6           # counter
-      call fact
-      print $I0
-      print "\n"
+      bsr fact
+      say $I0
       end
 
   fact:
@@ -867,7 +867,7 @@
 You can also use the C<:invocant> flag to define a new name for the invocant
 object:
 
-=begin PIR
+=begin PIR - See TT #483
 
   .sub "MyMethod" :method
     $S0 = self                    # Already defined as "self"


More information about the parrot-commits mailing list