00001 #include "MusimatTutorial.h" 00002 MusimatTutorialSection(B0107) { 00003 Print("*** B.1.7 Lists ***"); 00004 /***************************************************************************** 00005 00006 B.1.7 Lists 00007 00008 We can group sets of variables to keep track of their relations. 00009 An IntegerList represents a collection of Integer expressions, for example, 00010 *****************************************************************************/ 00011 00012 IntegerList iL(1, 1+1, 3, 5-1); 00013 00014 /***************************************************************************** 00015 defines a list iL containing the integers 1 through 4. 00016 A RealList represents a collection of Real expressions: 00017 *****************************************************************************/ 00018 00019 RealList rL(1.1, 2.2, 3.3, 4.4); 00020 00021 /***************************************************************************** 00022 We can obtain the length of a list of any type. For example, 00023 *****************************************************************************/ 00024 00025 Integer n = Length(rL); 00026 Print(n); 00027 00028 /***************************************************************************** 00029 prints 4. 00030 00031 The value can be seen when running this application in the console window 00032 if the output of this application has not been redirected. 00033 00034 *****************************************************************************/ 00035 }} 00036 00038 /* $Revision: 1.4 $ $Date: 2006/09/12 17:37:57 $ $Author: dgl $ $Name: $ $Id: _b0107_8cpp-source.html,v 1.4 2006/09/12 17:37:57 dgl Exp $ */ 00039 // The Musimat Tutorial © 2006 Gareth Loy 00040 // Derived from Chapter 9 and Appendix B of "Musimathics Vol. 1" © 2006 Gareth Loy 00041 // and published exclusively by The MIT Press. 00042 // This program is released WITHOUT ANY WARRANTY; without even the implied 00043 // warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00044 // For information on usage and redistribution, and for a DISCLAIMER OF ALL 00045 // WARRANTIES, see the file, "LICENSE.txt," in this distribution. 00046 // "Musimathics" is available here: http://mitpress.mit.edu/catalog/item/default.asp?ttype=2&tid=10916 00047 // Gareth Loy's Musimathics website: http://www.musimathics.com/ 00048 // The Musimat website: http://www.musimat.com/ 00049 // This program is released under the terms of the GNU General Public License 00050 // available here: http://www.gnu.org/licenses/gpl.txt 00051
1.4.7