[svn:parrot] r46069 - trunk/examples/library

mikehh at svn.parrot.org mikehh at svn.parrot.org
Tue Apr 27 18:08:56 UTC 2010


Author: mikehh
Date: Tue Apr 27 18:08:56 2010
New Revision: 46069
URL: https://trac.parrot.org/parrot/changeset/46069

Log:
replace in-place string ops - I think this example is TODOed but at least it now compiles

Modified:
   trunk/examples/library/ncurses_life.pir

Modified: trunk/examples/library/ncurses_life.pir
==============================================================================
--- trunk/examples/library/ncurses_life.pir	Tue Apr 27 17:34:53 2010	(r46068)
+++ trunk/examples/library/ncurses_life.pir	Tue Apr 27 18:08:56 2010	(r46069)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2008, Parrot Foundation.
+# Copyright (C) 2001-2010, Parrot Foundation.
 # $Id$
 
 =head1 NAME
@@ -478,7 +478,7 @@
     if count > 3 goto space
 
 star:
-    substr new_world, pos, 1, "*"
+    new_world = replace new_world, pos, 1, "*"
 
 space:    # is space already
     inc pos
@@ -608,10 +608,10 @@
     unless len goto out
     $S0 = substr line, 0,1
     eq $S0, "#", check_format
-    chopn line, 1        # \n
+    line = chopn line, 1        # \n
     dec len
     if format != PICTURE goto not_pic
-    substr world, pos, len, line
+    world = replace world, pos, len, line
     pos = pos + size
     goto loop
 
@@ -777,7 +777,7 @@
 
     # TODO abs/rel and bounds checking
     #world[c] = "*"
-    substr world, c, 1, "*"
+    world = replace world, c, 1, "*"
     if s < len goto lp2
 done:
 nok:


More information about the parrot-commits mailing list