[svn:parrot] r37596 - in trunk/examples: library pir shootout

coke at svn.parrot.org coke at svn.parrot.org
Thu Mar 19 13:57:42 UTC 2009


Author: coke
Date: Thu Mar 19 13:57:40 2009
New Revision: 37596
URL: https://trac.parrot.org/parrot/changeset/37596

Log:
Fixup usage of removed substr_r experimental opcode. (plain substr works)

Modified:
   trunk/examples/library/ncurses_life.pir
   trunk/examples/pir/life.pir
   trunk/examples/shootout/revcomp.pir

Modified: trunk/examples/library/ncurses_life.pir
==============================================================================
--- trunk/examples/library/ncurses_life.pir	Thu Mar 19 13:45:30 2009	(r37595)
+++ trunk/examples/library/ncurses_life.pir	Thu Mar 19 13:57:40 2009	(r37596)
@@ -280,7 +280,7 @@
     # TODO skip unprintable out of screen
     if CHARACTER_OFFSET >= total goto dumpend
 
-    substr_r $S0, world, CHARACTER_OFFSET, 1
+    substr $S0, world, CHARACTER_OFFSET, 1
     if $S0 != "*" goto incit
 
     X_COORD = CHAR_POS % size
@@ -391,7 +391,7 @@
     check %= len
 
     # $S0 is always overwritten, so reuse it
-    substr_r $S0, world, check, 1
+    substr $S0, world, check, 1
     if $S0 != "*" goto North
     inc count
 
@@ -401,7 +401,7 @@
     check += pos
     check %= len
 
-    substr_r $S0, world, check, 1
+    substr $S0, world, check, 1
     if $S0 != "*" goto NE
     inc count
 
@@ -412,7 +412,7 @@
     check += pos
     check %= len
 
-    substr_r $S0, world, check, 1
+    substr $S0, world, check, 1
     if $S0 != "*" goto West
     inc count
 West:
@@ -421,7 +421,7 @@
     check += pos
     check %= len
 
-    substr_r $S0, world, check, 1
+    substr $S0, world, check, 1
     if $S0 != "*" goto East
     inc count
 
@@ -431,7 +431,7 @@
     check += pos
     check %= len
 
-    substr_r $S0, world, check, 1
+    substr $S0, world, check, 1
     if $S0 != "*" goto SW
     inc count
 
@@ -441,7 +441,7 @@
     check += pos
     check %= len
 
-    substr_r $S0, world, check, 1
+    substr $S0, world, check, 1
     if $S0 != "*" goto South
     inc count
 
@@ -451,7 +451,7 @@
     check += pos
     check %= len
 
-    substr_r $S0, world, check, 1
+    substr $S0, world, check, 1
     if $S0 != "*" goto SE
     inc count
 SE:
@@ -460,12 +460,12 @@
     check += pos
     check %= len
 
-    substr_r $S0, world, check, 1
+    substr $S0, world, check, 1
     if $S0 != "*" goto checkl
     inc count
 
 checkl:
-    substr_r $S0, world, pos, 1
+    substr $S0, world, pos, 1
     if $S0 == "*" goto check_alive
 
 # If eq 3, put a star in else a space

Modified: trunk/examples/pir/life.pir
==============================================================================
--- trunk/examples/pir/life.pir	Thu Mar 19 13:45:30 2009	(r37595)
+++ trunk/examples/pir/life.pir	Thu Mar 19 13:57:40 2009	(r37596)
@@ -159,7 +159,7 @@
 	add $I3, $I3, $I1
 	mod $I3, $I3, $I0
 	# $S0 is always overwritten, so reuse it
-	substr_r $S0, $S15, $I3, 1
+	substr $S0, $S15, $I3, 1
 	ne $S0, "*", North
 	inc $I2
 North:
@@ -167,7 +167,7 @@
 	add $I3, $I3, $I0
 	add $I3, $I3, $I1
 	mod $I3, $I3, $I0
-	substr_r $S0, $S15, $I3, 1
+	substr $S0, $S15, $I3, 1
 	ne $S0, "*", NE
 	inc $I2
 NE:
@@ -175,7 +175,7 @@
 	add $I3, $I3, $I0
 	add $I3, $I3, $I1
 	mod $I3, $I3, $I0
-	substr_r $S0, $S15, $I3, 1
+	substr $S0, $S15, $I3, 1
 	ne $S0, "*", West
 	inc $I2
 West:
@@ -183,7 +183,7 @@
 	add $I3, $I3, $I0
 	add $I3, $I3, $I1
 	mod $I3, $I3, $I0
-	substr_r $S0, $S15, $I3, 1
+	substr $S0, $S15, $I3, 1
 	ne $S0, "*", East
 	inc $I2
 East:
@@ -191,7 +191,7 @@
 	add $I3, $I3, $I0
 	add $I3, $I3, $I1
 	mod $I3, $I3, $I0
-	substr_r $S0, $S15, $I3, 1
+	substr $S0, $S15, $I3, 1
 	ne $S0, "*", SW
 	inc $I2
 SW:
@@ -199,7 +199,7 @@
 	add $I3, $I3, $I0
 	add $I3, $I3, $I1
 	mod $I3, $I3, $I0
-	substr_r $S0, $S15, $I3, 1
+	substr $S0, $S15, $I3, 1
 	ne $S0, "*", South
 	inc $I2
 South:
@@ -207,7 +207,7 @@
 	add $I3, $I3, $I0
 	add $I3, $I3, $I1
 	mod $I3, $I3, $I0
-	substr_r $S0, $S15, $I3, 1
+	substr $S0, $S15, $I3, 1
 	ne $S0, "*", SE
 	inc $I2
 SE:
@@ -215,11 +215,11 @@
 	add $I3, $I3, $I0
 	add $I3, $I3, $I1
 	mod $I3, $I3, $I0
-	substr_r $S0, $S15, $I3, 1
+	substr $S0, $S15, $I3, 1
 	ne $S0, "*", check
 	inc $I2
 check:
-	substr_r $S0, $S15, $I1, 1
+	substr $S0, $S15, $I1, 1
 	eq $S0, "*", check_alive
 
 # If eq 3, put a star in else a space
@@ -259,7 +259,7 @@
 	set $I10, 0
 	set $I11, 14
 printloop:
-	substr_r $S0, $S15, $I10, 15
+	substr $S0, $S15, $I10, 15
 	print $S0
 	print "\n"
 	add $I10, $I10, 15

Modified: trunk/examples/shootout/revcomp.pir
==============================================================================
--- trunk/examples/shootout/revcomp.pir	Thu Mar 19 13:45:30 2009	(r37595)
+++ trunk/examples/shootout/revcomp.pir	Thu Mar 19 13:57:40 2009	(r37596)
@@ -76,7 +76,7 @@
 	i = 0
 	$S0 = 'x'
 print_loop:
-	$S0 = substr_r line, i, 60
+	$S0 = substr line, i, 60
 	print $S0
 	print "\n"
 	i += 60


More information about the parrot-commits mailing list