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

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

From:
coke
Date:
December 10, 2008 06:52
Subject:
[svn:parrot] r33762 - in trunk/examples: library pir shootout subs
Message ID:
20081210145207.A9D48CBA89@x12.develooper.com
Author: coke
Date: Wed Dec 10 06:52:06 2008
New Revision: 33762

Modified:
   trunk/examples/library/md5sum.pir
   trunk/examples/pir/euclid.pir
   trunk/examples/pir/hanoi.pir
   trunk/examples/pir/io.pir
   trunk/examples/pir/life.pir
   trunk/examples/pir/readline.pir
   trunk/examples/pir/substr.pir
   trunk/examples/pir/sudoku.pir
   trunk/examples/pir/uniq.pir
   trunk/examples/shootout/fasta.pir
   trunk/examples/shootout/knucleotide.pir
   trunk/examples/shootout/revcomp.pir
   trunk/examples/subs/single_retval.pir

Log:
"make examples_tests" now passes again. (update for a lot of syntax & PMC method changes)
Resolve RT #61256



Modified: trunk/examples/library/md5sum.pir
==============================================================================
--- trunk/examples/library/md5sum.pir	(original)
+++ trunk/examples/library/md5sum.pir	Wed Dec 10 06:52:06 2008
@@ -51,20 +51,12 @@
     # Get size of file
     size = stat file, .STAT_FILESIZE
     .local pmc pio, cl
-    cl = new "ParrotIO"
+    cl = new 'FileHandle'
     # slurp the file into memory
-    pio = cl."open"(file, "<", "mmap")
-    # pio = open file, "<"
-    defined $I2, pio
-    if $I2 goto found
-    printerr file
-    printerr ": Cannot find\n"
-    goto iter_cont
-found:
-    read $S1, pio, size
-    close pio
+    .local string contents
+    contents = cl.'readall'(file)
 
-    $I2 = length $S1
+    $I2 = length contents
     if $I2 == size goto size_ok
 
     printerr file
@@ -73,7 +65,7 @@
 
 size_ok:
 
-    $P0 = _md5sum ($S1)
+    $P0 = _md5sum (contents)
     _md5_print ($P0)
     print "\t"
     print file

Modified: trunk/examples/pir/euclid.pir
==============================================================================
--- trunk/examples/pir/euclid.pir	(original)
+++ trunk/examples/pir/euclid.pir	Wed Dec 10 06:52:06 2008
@@ -32,16 +32,16 @@
 =cut
 
 .sub 'example' :main
-        I1 = 96
-        I2 = 64
+        $I1 = 96
+        $I2 = 64
         print  "Algorithm E (Euclid's algorithm)\n"
-e1:     I4 = mod I1, I2
-e2:     unless I4 goto done
-e3:     I1 = I2
-        I2 = I4
+e1:     $I4 = mod $I1, $I2
+e2:     unless $I4 goto done
+e3:     $I1 = $I2
+        $I2 = $I4
         branch e1
 done:   print "The greatest common denominator of 96 and 64 is "
-        print  I2
+        print  $I2
         print  ".\n"
 .end
 

Modified: trunk/examples/pir/hanoi.pir
==============================================================================
--- trunk/examples/pir/hanoi.pir	(original)
+++ trunk/examples/pir/hanoi.pir	Wed Dec 10 06:52:06 2008
@@ -72,7 +72,7 @@
 
 =head1 TODO
 
-Replace I6 etc. with mnemonic register names.
+Replace $I6 etc. with mnemonic register names.
 
 =head1 HISTORY
 
@@ -106,8 +106,8 @@
         # Check number of command line arguments
         $I0 = argv
         if $I0 < 2 goto USE_DEFAULT_SIZE
-        S5 = argv[1]
-        size = S5
+        $S5 = argv[1]
+        size = $S5
         if size < 1 goto INVALID_SIZE
         print "Building a tower of size "
         print size
@@ -128,18 +128,18 @@
         .lex "towers", towers
         new towers, 'FixedPMCArray'
         set towers, 3
-        new P1, 'ResizableIntegerArray'
-        new P2, 'ResizableIntegerArray'
-        new P3, 'ResizableIntegerArray'
-        set towers[0], P1
-        set towers[1], P2
-        set towers[2], P3
+        new $P1, 'ResizableIntegerArray'
+        new $P2, 'ResizableIntegerArray'
+        new $P3, 'ResizableIntegerArray'
+        set towers[0], $P1
+        set towers[1], $P2
+        set towers[2], $P3
         ## towers = [[],[],[]]
 
         .local int i
         i = size
 loop_populate:
-        push P1, i
+        push $P1, i
         dec i
         if i > 0 goto loop_populate
         ## towers = [[...,3,2,1],[],[]]
@@ -177,12 +177,12 @@
         disk_size = stack[i]                 # disk_size = towers[j][i]
 print_it:
         n_spaces = tower_size - disk_size
-        repeat S0, " ", n_spaces
-        print S0
-        I6 = mul disk_size, 2                # I6 = disk_size * 2
-        repeat S1, "=", I6
-        print S1
-        print S0
+        repeat $S0, " ", n_spaces
+        print $S0
+        $I6 = mul disk_size, 2                # $I6 = disk_size * 2
+        repeat $S1, "=", $I6
+        print $S1
+        print $S0
 
         inc j
         if j == 3 goto done_loop

Modified: trunk/examples/pir/io.pir
==============================================================================
--- trunk/examples/pir/io.pir	(original)
+++ trunk/examples/pir/io.pir	Wed Dec 10 06:52:06 2008
@@ -20,25 +20,25 @@
 .sub 'example' :main
     .local string test_fn
     test_fn = "tmp_example_io.tmp"
-    P0 = open test_fn, ">"
-    seek P0, 300, 0
+    $P0 = open test_fn, ">"
+    seek $P0, 300, 0
     # 64bit version of seek with high 32bits = 0
-    #seek IO, P0, 0, 400, 0
-    print P0, "test1\n"
-    print P0, "test2\n"
-    print P0, "test3\n"
-    seek P0, 0, 0
-    print P0, "test4\n"
-    print P0, "test5\n"
-    close P0
-
-    P0 = open test_fn, "<"
-    S0 = read P0, 1024
-    print S0
+    #seek $IO, $P0, 0, 400, 0
+    print $P0, "test1\n"
+    print $P0, "test2\n"
+    print $P0, "test3\n"
+    seek $P0, 0, 0
+    print $P0, "test4\n"
+    print $P0, "test5\n"
+    close $P0
+
+    $P0 = open test_fn, "<"
+    $S0 = read $P0, 1024
+    print $S0
 
     # now clean up after ourselves.
-    P1 = new "OS"
-    P1."rm"(test_fn)
+    $P1 = new "OS"
+    $P1."rm"(test_fn)
 
 .end
 

Modified: trunk/examples/pir/life.pir
==============================================================================
--- trunk/examples/pir/life.pir	(original)
+++ trunk/examples/pir/life.pir	Wed Dec 10 06:52:06 2008
@@ -29,61 +29,61 @@
         .local int max_generations
 
 	# First the generation count
-        I15 = argv
-        if I15 < 2 goto USE_DEFAULT_MAX_GENERATIONS
-        S5 = argv[1]
-        I2 = S5
+        $I15 = argv
+        if $I15 < 2 goto USE_DEFAULT_MAX_GENERATIONS
+        $S5 = argv[1]
+        $I2 = $S5
         print "Running "
-        print I2
+        print $I2
         print " generations.\n"
         goto MAX_GENERATIONS_IS_NOW_KNOWN
 USE_DEFAULT_MAX_GENERATIONS:
         print "Running 5000 generations by default.\n"
-	set I2, 5000
+	set $I2, 5000
 MAX_GENERATIONS_IS_NOW_KNOWN:
         print "\n"
 
 	# Note the time
-	time N5
+	time $N5
 	# If true, we don't print
-	set I12, 0
-	set S0,  "               "
-	set S1,  "               "
-	set S2,  "               "
-        set S3,  "               "
-	set S4,  "   **          "
-	set S5,  " *    *        "
-	set S6,  "       *       "
-	set S7,  " *     *       "
-	set S8,  "  ******       "
-	set S9,  "               "
-	set S10, "               "
-	set S11, "               "
-	set S12, "               "
-	set S13, "               "
-	set S14, "               "
-	set S15, ""
-	concat S15, S0
-	concat S15, S1
-	concat S15, S2
-	concat S15, S3
-	concat S15, S4
-	concat S15, S5
-	concat S15, S6
-	concat S15, S7
-	concat S15, S8
-	concat S15, S9
-	concat S15, S10
-	concat S15, S11
-	concat S15, S12
-	concat S15, S13
-	concat S15, S14
+	set $I12, 0
+	set $S0,  "               "
+	set $S1,  "               "
+	set $S2,  "               "
+        set $S3,  "               "
+	set $S4,  "   **          "
+	set $S5,  " *    *        "
+	set $S6,  "       *       "
+	set $S7,  " *     *       "
+	set $S8,  "  ******       "
+	set $S9,  "               "
+	set $S10, "               "
+	set $S11, "               "
+	set $S12, "               "
+	set $S13, "               "
+	set $S14, "               "
+	set $S15, ""
+	concat $S15, $S0
+	concat $S15, $S1
+	concat $S15, $S2
+	concat $S15, $S3
+	concat $S15, $S4
+	concat $S15, $S5
+	concat $S15, $S6
+	concat $S15, $S7
+	concat $S15, $S8
+	concat $S15, $S9
+	concat $S15, $S10
+	concat $S15, $S11
+	concat $S15, $S12
+	concat $S15, $S13
+	concat $S15, $S14
 	bsr dump
-	set I0, 0
-loop:	ge I0, I2, getout
-	inc I0
-	mod I31,I0,100
-	if I31, skip
+	set $I0, 0
+loop:	ge $I0, $I2, getout
+	inc $I0
+	mod $I31,$I0,100
+	if $I31, skip
 	printerr "."
 skip:
 
@@ -91,180 +91,180 @@
 
 	bsr dump
 	branch loop
-getout:	time N6
-	sub N7, N6, N5
+getout:	time $N6
+	sub $N7, $N6, $N5
 	print "\n"
-	print I2
+	print $I2
 	print " generations in "
-	print N7
+	print $N7
  	print " seconds. "
-	set N8, I2
-	div N1, N8, N7
-	print N1
+	set $N8, $I2
+	div $N1, $N8, $N7
+	print $N1
 	print " generations/sec\n"
 
-	interpinfo I1, 1
+	interpinfo $I1, 1
 	print "A total of "
-	print I1
+	print $I1
 	print " bytes were allocated\n"
 
-	interpinfo I1, 2
+	interpinfo $I1, 2
 	print "A total of "
-	print I1
+	print $I1
 	print " DOD runs were made\n"
 
-	interpinfo I1, 3
+	interpinfo $I1, 3
 	print "A total of "
-	print I1
+	print $I1
 	print " collection runs were made\n"
 
-	interpinfo I1, 10
+	interpinfo $I1, 10
 	print "Copying a total of "
-	print I1
+	print $I1
 	print " bytes\n"
 
-	interpinfo I1, 5
+	interpinfo $I1, 5
 	print "There are "
-	print I1
+	print $I1
 	print " active Buffer structs\n"
 
-	interpinfo I1, 7
+	interpinfo $I1, 7
 	print "There are "
-	print I1
+	print $I1
 	print " total Buffer structs\n"
 
 
 	end
 
-# S15 has the incoming string, S0 is scratch, S1 is scratch, S2 is scratch
+# $S15 has the incoming string, $S0 is scratch, $S1 is scratch, $S2 is scratch
 #
-# I0 is the length of the string
-# I1 is the current cell we're checking
-# I2 is the count for that cell
-# I3 is the offset to the neighbor
+# $I0 is the length of the string
+# $I1 is the current cell we're checking
+# $I2 is the count for that cell
+# $I3 is the offset to the neighbor
 generate:
         .local int save_I0, save_I1, save_I2, save_I3
-	save_I0 = I0
-	save_I1 = I1
-	save_I2 = I2
-	save_I3 = I3
-	length I0, S15
-	set S1, ""
-	set I1, 0
+	save_I0 = $I0
+	save_I1 = $I1
+	save_I2 = $I2
+	save_I3 = $I3
+	length $I0, $S15
+	set $S1, ""
+	set $I1, 0
 genloop:
-	set I2, 0
+	set $I2, 0
 NW:
-	set I3, -16
-	add I3, I3, I0
-	add I3, I3, I1
-	mod I3, I3, I0
-	# S0 is always overwritten, so reuse it
-	substr_r S0, S15, I3, 1
-	ne S0, "*", North
-	inc I2
+	set $I3, -16
+	add $I3, $I3, $I0
+	add $I3, $I3, $I1
+	mod $I3, $I3, $I0
+	# $S0 is always overwritten, so reuse it
+	substr_r $S0, $S15, $I3, 1
+	ne $S0, "*", North
+	inc $I2
 North:
-	set I3, -15
-	add I3, I3, I0
-	add I3, I3, I1
-	mod I3, I3, I0
-	substr_r S0, S15, I3, 1
-	ne S0, "*", NE
-	inc I2
+	set $I3, -15
+	add $I3, $I3, $I0
+	add $I3, $I3, $I1
+	mod $I3, $I3, $I0
+	substr_r $S0, $S15, $I3, 1
+	ne $S0, "*", NE
+	inc $I2
 NE:
-	set I3, -14
-	add I3, I3, I0
-	add I3, I3, I1
-	mod I3, I3, I0
-	substr_r S0, S15, I3, 1
-	ne S0, "*", West
-	inc I2
+	set $I3, -14
+	add $I3, $I3, $I0
+	add $I3, $I3, $I1
+	mod $I3, $I3, $I0
+	substr_r $S0, $S15, $I3, 1
+	ne $S0, "*", West
+	inc $I2
 West:
-	set I3, -1
-	add I3, I3, I0
-	add I3, I3, I1
-	mod I3, I3, I0
-	substr_r S0, S15, I3, 1
-	ne S0, "*", East
-	inc I2
+	set $I3, -1
+	add $I3, $I3, $I0
+	add $I3, $I3, $I1
+	mod $I3, $I3, $I0
+	substr_r $S0, $S15, $I3, 1
+	ne $S0, "*", East
+	inc $I2
 East:
-	set I3, 1
-	add I3, I3, I0
-	add I3, I3, I1
-	mod I3, I3, I0
-	substr_r S0, S15, I3, 1
-	ne S0, "*", SW
-	inc I2
+	set $I3, 1
+	add $I3, $I3, $I0
+	add $I3, $I3, $I1
+	mod $I3, $I3, $I0
+	substr_r $S0, $S15, $I3, 1
+	ne $S0, "*", SW
+	inc $I2
 SW:
-	set I3, 14
-	add I3, I3, I0
-	add I3, I3, I1
-	mod I3, I3, I0
-	substr_r S0, S15, I3, 1
-	ne S0, "*", South
-	inc I2
+	set $I3, 14
+	add $I3, $I3, $I0
+	add $I3, $I3, $I1
+	mod $I3, $I3, $I0
+	substr_r $S0, $S15, $I3, 1
+	ne $S0, "*", South
+	inc $I2
 South:
-	set I3, 15
-	add I3, I3, I0
-	add I3, I3, I1
-	mod I3, I3, I0
-	substr_r S0, S15, I3, 1
-	ne S0, "*", SE
-	inc I2
+	set $I3, 15
+	add $I3, $I3, $I0
+	add $I3, $I3, $I1
+	mod $I3, $I3, $I0
+	substr_r $S0, $S15, $I3, 1
+	ne $S0, "*", SE
+	inc $I2
 SE:
-	set I3, 16
-	add I3, I3, I0
-	add I3, I3, I1
-	mod I3, I3, I0
-	substr_r S0, S15, I3, 1
-	ne S0, "*", check
-	inc I2
+	set $I3, 16
+	add $I3, $I3, $I0
+	add $I3, $I3, $I1
+	mod $I3, $I3, $I0
+	substr_r $S0, $S15, $I3, 1
+	ne $S0, "*", check
+	inc $I2
 check:
-	substr_r S0, S15, I1, 1
-	eq S0, "*", check_alive
+	substr_r $S0, $S15, $I1, 1
+	eq $S0, "*", check_alive
 
 # If eq 3, put a star in else a space
 check_dead:
-	eq I2, 3, star
+	eq $I2, 3, star
 	branch space
 
 check_alive:
-	lt I2, 2, space
-	gt I2, 3, space
+	lt $I2, 2, space
+	gt $I2, 3, space
 	branch star
 
 space:
-	concat S1, " "
+	concat $S1, " "
 	branch iter_done
 star:
-	concat S1, "*"
+	concat $S1, "*"
 iter_done:
-	inc I1
-	lt I1, I0, genloop
+	inc $I1
+	lt $I1, $I0, genloop
 done:
-	set S15, S1
-	I3 = save_I3
-	I2 = save_I2
-	I1 = save_I1
-	I0 = save_I0
+	set $S15, $S1
+	$I3 = save_I3
+	$I2 = save_I2
+	$I1 = save_I1
+	$I0 = save_I0
 	ret
 
-# S15 has the incoming string, S0 is scratch
+# $S15 has the incoming string, $S0 is scratch
 dump:
-	if I12, dumpend
+	if $I12, dumpend
 	print "\f"
 	print "\n\n\n\n\n\n\n\n\n\n\n"
 	print "------------- generation "
-	print I0
+	print $I0
 	print " -------------\n"
-	set I10, 0
-	set I11, 14
+	set $I10, 0
+	set $I11, 14
 printloop:
-	substr_r S0, S15, I10, 15
-	print S0
+	substr_r $S0, $S15, $I10, 15
+	print $S0
 	print "\n"
-	add I10, I10, 15
-	dec I11
-	ge I11, 0, printloop
+	add $I10, $I10, 15
+	dec $I11
+	ge $I11, 0, printloop
 	sleep 1
 dumpend:
 	ret

Modified: trunk/examples/pir/readline.pir
==============================================================================
--- trunk/examples/pir/readline.pir	(original)
+++ trunk/examples/pir/readline.pir	Wed Dec 10 06:52:06 2008
@@ -29,12 +29,12 @@
 
 AGAIN:
 	line = readline stdin
-	I1 = length line
-	if I1 <= 1 goto MAINLOOP
+	$I1 = length line
+	if $I1 <= 1 goto MAINLOOP
 	# test for multi-char newlines
-	if I1 >=3 goto CONCAT
-	I2 = is_cclass .CCLASS_NEWLINE, line, 0
-	if I2, MAINLOOP
+	if $I1 >=3 goto CONCAT
+	$I2 = is_cclass .CCLASS_NEWLINE, line, 0
+	if $I2, MAINLOOP
 
 CONCAT:
 	concat buffer, line

Modified: trunk/examples/pir/substr.pir
==============================================================================
--- trunk/examples/pir/substr.pir	(original)
+++ trunk/examples/pir/substr.pir	Wed Dec 10 06:52:06 2008
@@ -16,23 +16,23 @@
 =cut
 
 .sub "example" :main
-        I2 = 1
-        I1 = 0
-        S1 = "Hello World"
-        I3 = 0
-        I4 = 0
-        I5 = length S1
-WAX:    S2 = substr S1, I3, I4
-        print  S2
+        $I2 = 1
+        $I1 = 0
+        $S1 = "Hello World"
+        $I3 = 0
+        $I4 = 0
+        $I5 = length $S1
+WAX:    $S2 = substr $S1, $I3, $I4
+        print  $S2
         print  "\n"
-        I4 = I4 + I2
-        if I4 == I5 goto WANE
+        $I4 = $I4 + $I2
+        if $I4 == $I5 goto WANE
 	branch WAX
-WANE:   I1 = length S1
-        print  S1
+WANE:   $I1 = length $S1
+        print  $S1
         print  "\n"
-        chopn  S1, 1
-        unless I1 == I3 goto WANE
+        chopn  $S1, 1
+        unless $I1 == $I3 goto WANE
 DONE:
 .end
 

Modified: trunk/examples/pir/sudoku.pir
==============================================================================
--- trunk/examples/pir/sudoku.pir	(original)
+++ trunk/examples/pir/sudoku.pir	Wed Dec 10 06:52:06 2008
@@ -2112,7 +2112,7 @@
     .local pmc win, f
 
     win = getattribute self, "win"
-    f = global "ncurses::mvwaddstr"
+    f = get_global "ncurses::mvwaddstr"
     f(win, r, c, s)
 .end
 
@@ -2121,7 +2121,7 @@
     .local pmc win, f
 
     win = getattribute self, "win"
-    f = global "ncurses::waddstr"
+    f = get_global "ncurses::waddstr"
     f(win, s)
 .end
 
@@ -2132,14 +2132,14 @@
 
     s = i
     win = getattribute self, "win"
-    f = global "ncurses::waddstr"
+    f = get_global "ncurses::waddstr"
     f(win, s)
 .end
 
 .sub "wait" :method
     .local pmc f
     .local int key
-    f = global "ncurses::getch"
+    f = get_global "ncurses::getch"
     key = f()
 .end
 
@@ -2155,9 +2155,9 @@
 
 .sub nc_end
     .local pmc endwin, curs_set
-    curs_set = global "ncurses::curs_set"
+    curs_set = get_global "ncurses::curs_set"
     curs_set(1)
-    endwin = global "ncurses::endwin"
+    endwin = get_global "ncurses::endwin"
     endwin()
 .end
 
@@ -2171,14 +2171,14 @@
     .local pmc NODELAY
     .local pmc KEYPAD
     .local pmc STDSCR
-    INITSCR     = global "ncurses::initscr"
-    START_COLOR = global "ncurses::start_color"
-    INIT_PAIR   = global "ncurses::init_pair"
-    COLOR_PAIR  = global "ncurses::COLOR_PAIR"
-    WATTRON     = global "ncurses::wattron"
-    CURS_SET    = global "ncurses::curs_set"
-    NODELAY     = global "ncurses::nodelay"
-    KEYPAD      = global "ncurses::keypad"
+    INITSCR     = get_global "ncurses::initscr"
+    START_COLOR = get_global "ncurses::start_color"
+    INIT_PAIR   = get_global "ncurses::init_pair"
+    COLOR_PAIR  = get_global "ncurses::COLOR_PAIR"
+    WATTRON     = get_global "ncurses::wattron"
+    CURS_SET    = get_global "ncurses::curs_set"
+    NODELAY     = get_global "ncurses::nodelay"
+    KEYPAD      = get_global "ncurses::keypad"
     STDSCR = INITSCR()
     START_COLOR()
     # Color pair 1, dark green fg, black background

Modified: trunk/examples/pir/uniq.pir
==============================================================================
--- trunk/examples/pir/uniq.pir	(original)
+++ trunk/examples/pir/uniq.pir	Wed Dec 10 06:52:06 2008
@@ -57,32 +57,32 @@
 
 SOURCE:
   # set up flag registers
-  I10 = 0
-  I11 = 0
-  I12 = 0
+  $I10 = 0
+  $I11 = 0
+  $I12 = 0
   # do some simple option parsing
   .local string option
   option = shift argv
 
   ne option, "-c", NOTC
-  I10 = 1 # count mode
+  $I10 = 1 # count mode
   option = shift argv
 
 NOTC:
   ne option, "-d", NOTD
-  I11 = 1 # duplicate mode
+  $I11 = 1 # duplicate mode
   option = shift argv
 
 NOTD:
   ne option, "-u", GO
-  I12 = 1 # unique mode
+  $I12 = 1 # unique mode
   option = shift argv
 
 GO:
   .local string file_name
   file_name = option
 
-  I1 = 1 # count
+  $I1 = 1 # count
   .local pmc in_fh
   in_fh = open file_name, "<"
   unless in_fh, ERR
@@ -97,38 +97,38 @@
 
   # different line
 
-  unless I10, NOTC2
+  unless $I10, NOTC2
   # count mode
   # we go to some lengths to make the count pretty
-  set S3, I1
-  length I2, S3
-  sub I2, 7, I2
-  set S3, " "
-  repeat S3, S3, I2
-  print S3
-  print I1
+  set $S3, $I1
+  length $I2, $S3
+  sub $I2, 7, $I2
+  set $S3, " "
+  repeat $S3, $S3, $I2
+  print $S3
+  print $I1
   print " "
   print prev_line
   branch RESET
 
 NOTC2:
-  unless I11, NOTD2
+  unless $I11, NOTD2
 
   # show duplicates mode
-  eq 1, I1, RESET
+  eq 1, $I1, RESET
   print prev_line
   branch RESET
 
 ERR:
   print "Couldn't read "
-  print S0
+  print $S0
   exit 1
 
 NOTD2:
-  unless I12, NOTU2
+  unless $I12, NOTU2
 
   # don't show lines that are duplicated mode
-  ne 1, I1, RESET
+  ne 1, $I1, RESET
   print prev_line
   branch RESET
 
@@ -139,11 +139,11 @@
   branch RESET
 
 RESET:
-  set I1, 1
+  set $I1, 1
   branch LOOP
 
 MATCH:
-  inc I1
+  inc $I1
   # fall through
 
 LOOP:

Modified: trunk/examples/shootout/fasta.pir
==============================================================================
--- trunk/examples/shootout/fasta.pir	(original)
+++ trunk/examples/shootout/fasta.pir	Wed Dec 10 06:52:06 2008
@@ -162,7 +162,7 @@
 	.local int n
 	# stdout is linebuffered per default - make it block buffered
 	stdout = getstdout
-	stdout.'setbuf'(40960)
+	stdout.'buffer_size'(40960)
 	$I0 = argv
 	if $I0 > 1 goto argsok
 	n = 1000

Modified: trunk/examples/shootout/knucleotide.pir
==============================================================================
--- trunk/examples/shootout/knucleotide.pir	(original)
+++ trunk/examples/shootout/knucleotide.pir	Wed Dec 10 06:52:06 2008
@@ -80,7 +80,7 @@
 	goto iter_loop_1
 iter_end_1:
 
-	$P0 = global "sort"
+	$P0 = get_global "sort"
 	array."sort"($P0)
 
 	$I0 = array

Modified: trunk/examples/shootout/revcomp.pir
==============================================================================
--- trunk/examples/shootout/revcomp.pir	(original)
+++ trunk/examples/shootout/revcomp.pir	Wed Dec 10 06:52:06 2008
@@ -35,7 +35,7 @@
 	stdin = getstdin
 	stdout = getstdout
 	# stdout is linebuffered per default - make it block buffered
-	stdout.'setbuf'(8192)
+	stdout.'buffer_size'(8192)
 
 	seq = ''
 

Modified: trunk/examples/subs/single_retval.pir
==============================================================================
--- trunk/examples/subs/single_retval.pir	(original)
+++ trunk/examples/subs/single_retval.pir	Wed Dec 10 06:52:06 2008
@@ -26,16 +26,16 @@
   $I1 = 8
   .local string s
   s = "nine"
-  I2  = 10
+  $I2  = 10
 
   # subs accept locals and registers
-  $I0 = foo(i, $I1, s, I2)
+  $I0 = foo(i, $I1, s, $I2)
   print "return: "
   print $I0
   print "\n"
 
   # subs accept locals and registers
-  ( $I3 ) = foo(i, $I1, s, I2)
+  ( $I3 ) = foo(i, $I1, s, $I2)
   print "return: "
   print $I3
   print "\n"



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