You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
68 CHAPTER 3. LANGUAGE<br />
Because this is not very convenient a special function called Ò ØÙÔÐ ÓÒ×Ø is available to<br />
construct a tuple of a given length, where each element has the same value. Using this function,<br />
the program from above is reduced to:<br />
××Ò´ÒØÙÔÐÓÒ×Ø´½¼¼¸½½µ¸ØÙÔе<br />
which is displaed as<br />
ØÙÔÐ ÒØÙÔÐÓÒ×Ø´½¼¼¸½½µ<br />
If we want to construct a tuple with the same length as a given tuple there are two ways to get<br />
an easy solution, The first one is based on Ò ØÙÔÐ ÓÒ×Ø:<br />
××Ò´ÒØÙÔÐÓÒ×Ø´ØÙÔÐÓи½½µ¸ØÙÔÐÒÛµ<br />
which is displayed as<br />
ØÙÔÐÒÛ ÒØÙÔÐÓÒ×Ø´ØÙÔÐÓи½½µ<br />
The second one is a bit tricky and uses arithmetic functions:<br />
××Ò´´ØÙÔÐÓÐ ¼µ · ½½¸ØÙÔÐÒÛµ<br />
which is displaed as<br />
ØÙÔÐÒÛ ´ØÙÔÐÓÐ ¼µ · ½½<br />
Here we get first a tuple of the same length with every element set to zero. Then we add the<br />
constant to each element.<br />
In the case of tuples with different values we have to use the loop version to assign the values<br />
to each position:<br />
××Ò´℄¸ØÙÔе<br />
ÓÖ ½ ØÓ ½¼¼ Ý ½<br />
××Ò´ØÙÔи℄¸ØÙÔе<br />
ÒÓÖ<br />
which is displaed as<br />
ØÙÔÐ ℄<br />
ÓÖ ½ ØÓ ½¼¼ Ý ½<br />
ØÙÔÐ ØÙÔи℄<br />
ÒÓÖ<br />
In this example we construct a tuple with the square values from ½ ¾ to ½¼¼ ¾ .<br />
<strong>HDevelop</strong> / 2000-11-16