[svn:parrot] r43439 - trunk/docs/user/pir
plobsing at svn.parrot.org
plobsing at svn.parrot.org
Wed Jan 13 03:09:31 UTC 2010
Author: plobsing
Date: Wed Jan 13 03:09:31 2010
New Revision: 43439
URL: https://trac.parrot.org/parrot/changeset/43439
Log:
fix docs/user/pir/intro.pod wrt t/examples/pod.t ('=begin PIR' becomes 'begin PIR_FRAGMENT')
Modified:
trunk/docs/user/pir/intro.pod
Modified: trunk/docs/user/pir/intro.pod
==============================================================================
--- trunk/docs/user/pir/intro.pod Wed Jan 13 03:04:06 2010 (r43438)
+++ trunk/docs/user/pir/intro.pod Wed Jan 13 03:09:31 2010 (r43439)
@@ -386,19 +386,19 @@
It's also possible to use named syntax when returning values from
subroutines. Into the C<.return> command I'll use:
-=begin PIR
+=begin PIR_FRAGMENT
.return ( "bar" => 20, "foo" => 10)
-=end PIR
+=end PIR_FRAGMENT
and when calling the function, I will do:
-=begin PIR
+=begin PIR_FRAGMENT
("foo" => $I0, "bar" => $I1) = func()
-=end PIR
+=end PIR_FRAGMENT
And C<$I0> will yield 10, and C<$I1> will yield 20, as expected.
@@ -410,22 +410,22 @@
pass it a string register or variable where you wish the characters
read to be placed and the number of characters you wish to read:
-=begin PIR
+=begin PIR_FRAGMENT
read $S1, 100
-=end PIR
+=end PIR_FRAGMENT
This line will read 100 characters (or until the end of the line) and
put the read string into C<$S1>. In case you need a number, just
assign the string to the correct register type:
-=begin PIR
+=begin PIR_FRAGMENT
read $S1, 100
$I1 = $S1
-=end PIR
+=end PIR_FRAGMENT
With the PIR syntax shown in this article you should be able to start
writing simple programs. Next article we will look into available
More information about the parrot-commits
mailing list