Update of /cvsroot/nice/Nice/web
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6393/web
Modified Files:
manual.xml
Log Message:
Use nicer syntax for printTuple (suggested by rfe #1124210).
Index: manual.xml
===================================================================
RCS file: /cvsroot/nice/Nice/web/manual.xml,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** manual.xml 8 Feb 2005 13:01:25 -0000 1.45
--- manual.xml 23 Feb 2005 16:08:59 -0000 1.46
***************
*** 1272,1282 ****
(int, int) minMax(int x, int y) = x < y ? (x, y) : (y, x);
! void printTuple((int, int) tuple)
{
- /** Declare two local variables, and assign to each the corresponding value
- in the tuple.
- */
- (int x, int y) = tuple;
-
println("(" + x + ", " + y + ")");
}
--- 1272,1277 ----
(int, int) minMax(int x, int y) = x < y ? (x, y) : (y, x);
! void printTuple((int x, int y))
{
println("(" + x + ", " + y + ")");
}
***************
*** 1288,1291 ****
--- 1283,1293 ----
}
]]></programlisting>
+
+ <para>
+ Note that <literal>printTuple</literal> has only one argument,
+ which is a tuple. We give the names <literal>x</literal> and
+ <literal>y</literal> to the two components of this tuple, so that
+ we can use them directly in the implementation of the method.
+ </para>
</example>
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
|