home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / elan1v5 / doc / h02.tex < prev    next >
LaTeX Document  |  1989-03-17  |  25.9 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Corel 10 Texture (image/corel10Texture) ext Unsupported
1% dexvert Croteam texture file (image/croteamTextureFile) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text, with CRLF line terminators default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[CRLF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 63 68 61 70 74 65 72 | 7b 41 20 42 52 49 45 46 |\chapter|{A BRIEF|
|00000010| 20 49 4e 54 52 4f 44 55 | 43 54 49 4f 4e 20 54 4f | INTRODU|CTION TO|
|00000020| 20 45 4c 41 4e 2d 30 7d | 0d 0a 0d 0a 45 6c 61 6e | ELAN-0}|....Elan|
|00000030| 2d 30 20 69 73 20 61 20 | 73 6d 61 6c 6c 20 73 75 |-0 is a |small su|
|00000040| 62 73 65 74 20 6f 66 20 | 45 6c 61 6e 2c 20 77 68 |bset of |Elan, wh|
|00000050| 69 63 68 20 69 73 20 69 | 6e 74 65 6e 64 65 64 20 |ich is i|ntended |
|00000060| 66 6f 72 20 6c 65 61 72 | 6e 69 6e 67 0d 0a 73 79 |for lear|ning..sy|
|00000070| 73 74 65 6d 61 74 69 63 | 20 54 6f 70 2d 44 6f 77 |stematic| Top-Dow|
|00000080| 6e 20 70 72 6f 67 72 61 | 6d 6d 69 6e 67 2e 20 54 |n progra|mming. T|
|00000090| 68 65 20 62 65 73 74 20 | 77 61 79 20 74 6f 20 67 |he best |way to g|
|000000a0| 65 74 20 61 63 71 75 61 | 69 6e 74 65 64 0d 0a 77 |et acqua|inted..w|
|000000b0| 69 74 68 20 20 45 6c 61 | 6e 20 61 6e 64 20 74 6f |ith Ela|n and to|
|000000c0| 20 61 70 70 72 65 63 69 | 61 74 65 20 74 68 65 20 | appreci|ate the |
|000000d0| 70 72 6f 67 72 61 6d 6d | 69 6e 67 20 73 74 79 6c |programm|ing styl|
|000000e0| 65 20 69 74 20 61 69 6d | 73 20 74 6f 0d 0a 73 75 |e it aim|s to..su|
|000000f0| 70 70 6f 72 74 20 69 73 | 20 74 6f 20 73 74 61 72 |pport is| to star|
|00000100| 74 20 77 69 74 68 20 74 | 68 65 20 45 6c 61 6e 2d |t with t|he Elan-|
|00000110| 30 20 73 75 62 73 65 74 | 2e 0d 0a 0d 0a 54 68 69 |0 subset|.....Thi|
|00000120| 73 20 63 68 61 70 74 65 | 72 20 6f 66 20 74 68 65 |s chapte|r of the|
|00000130| 20 6d 61 6e 75 61 6c 20 | 69 73 20 69 6e 74 65 6e | manual |is inten|
|00000140| 64 65 64 20 66 6f 72 20 | 72 65 61 64 65 72 73 20 |ded for |readers |
|00000150| 77 68 6f 20 61 6c 72 65 | 61 64 79 20 68 61 76 65 |who alre|ady have|
|00000160| 0d 0a 73 6f 6d 65 20 65 | 78 70 65 72 69 65 6e 63 |..some e|xperienc|
|00000170| 65 20 69 6e 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 |e in pro|gramming|
|00000180| 20 69 6e 20 61 6e 20 61 | 6c 67 6f 72 69 74 68 6d | in an a|lgorithm|
|00000190| 69 63 20 6c 61 6e 67 75 | 61 67 65 2e 0d 0a 4e 6f |ic langu|age...No|
|000001a0| 74 69 63 65 20 74 68 61 | 74 20 61 20 63 61 72 65 |tice tha|t a care|
|000001b0| 66 75 6c 20 64 69 73 74 | 69 6e 63 74 69 6f 6e 20 |ful dist|inction |
|000001c0| 69 73 20 6d 61 64 65 20 | 62 65 74 77 65 65 6e 0d |is made |between.|
|000001d0| 0a 72 65 6d 61 72 6b 73 | 20 77 68 69 63 68 20 70 |.remarks| which p|
|000001e0| 65 72 74 61 69 6e 20 74 | 6f 20 45 6c 61 6e 20 61 |ertain t|o Elan a|
|000001f0| 73 20 61 20 77 68 6f 6c | 65 20 61 6e 64 20 72 65 |s a whol|e and re|
|00000200| 6d 61 72 6b 73 20 63 6f | 6e 66 69 6e 65 64 0d 0a |marks co|nfined..|
|00000210| 74 6f 20 74 68 65 20 45 | 6c 61 6e 2d 30 20 73 75 |to the E|lan-0 su|
|00000220| 62 73 65 74 2e 20 49 6e | 20 63 68 61 70 74 65 72 |bset. In| chapter|
|00000230| 20 34 20 74 68 65 20 73 | 79 6e 74 61 78 20 6f 66 | 4 the s|yntax of|
|00000240| 20 74 68 65 20 66 75 6c | 6c 20 6c 61 6e 67 75 61 | the ful|l langua|
|00000250| 67 65 0d 0a 28 77 69 74 | 68 20 74 68 65 20 65 78 |ge..(wit|h the ex|
|00000260| 63 65 70 74 69 6f 6e 20 | 6f 66 20 70 61 63 6b 65 |ception |of packe|
|00000270| 74 73 29 20 63 61 6e 20 | 62 65 20 66 6f 75 6e 64 |ts) can |be found|
|00000280| 2c 20 77 68 69 63 68 20 | 69 73 20 61 76 61 69 6c |, which |is avail|
|00000290| 61 62 6c 65 0d 0a 69 6e | 20 74 68 65 20 45 6c 61 |able..in| the Ela|
|000002a0| 6e 20 50 72 6f 67 72 61 | 6d 6d 69 6e 67 20 45 6e |n Progra|mming En|
|000002b0| 76 69 72 6f 6e 6d 65 6e | 74 2e 0d 0a 0d 0a 5c 73 |vironmen|t.....\s|
|000002c0| 65 63 74 69 6f 6e 7b 53 | 6f 6d 65 20 63 6f 6e 63 |ection{S|ome conc|
|000002d0| 65 70 74 73 20 6f 66 20 | 70 72 6f 67 72 61 6d 6d |epts of |programm|
|000002e0| 69 6e 67 20 6c 61 6e 67 | 75 61 67 65 73 7d 0d 0a |ing lang|uages}..|
|000002f0| 0d 0a 54 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |..The fo|llowing |
|00000300| 74 65 72 6d 69 6e 6f 6c | 6f 67 79 20 61 6e 64 20 |terminol|ogy and |
|00000310| 63 6f 6e 63 65 70 74 73 | 20 61 72 65 20 61 70 70 |concepts| are app|
|00000320| 6c 69 63 61 62 6c 65 20 | 74 6f 20 61 6e 79 0d 0a |licable |to any..|
|00000330| 70 72 6f 67 72 61 6d 6d | 69 6e 67 20 6c 61 6e 67 |programm|ing lang|
|00000340| 75 61 67 65 2c 20 62 75 | 74 20 69 6e 20 70 61 72 |uage, bu|t in par|
|00000350| 74 69 63 75 6c 61 72 20 | 74 6f 20 45 6c 61 6e 2c |ticular |to Elan,|
|00000360| 20 73 69 6e 63 65 20 74 | 68 65 79 20 6c 69 65 0d | since t|hey lie.|
|00000370| 0a 61 74 20 74 68 65 20 | 68 65 61 72 74 20 6f 66 |.at the |heart of|
|00000380| 20 69 74 73 20 64 65 73 | 69 67 6e 2e 20 52 65 61 | its des|ign. Rea|
|00000390| 64 65 72 73 20 6e 6f 74 | 20 69 6e 74 65 72 65 73 |ders not| interes|
|000003a0| 74 65 64 20 69 6e 20 70 | 68 69 6c 6f 73 6f 70 68 |ted in p|hilosoph|
|000003b0| 79 0d 0a 6d 61 79 20 73 | 6b 69 70 20 74 68 69 73 |y..may s|kip this|
|000003c0| 20 73 65 63 74 69 6f 6e | 2e 0d 0a 0d 0a 5c 73 75 | section|.....\su|
|000003d0| 62 73 65 63 74 69 6f 6e | 7b 45 6e 74 69 74 69 65 |bsection|{Entitie|
|000003e0| 73 7d 0d 0a 0d 0a 41 20 | 70 72 6f 67 72 61 6d 20 |s}....A |program |
|000003f0| 69 73 20 61 20 74 65 78 | 74 2c 20 76 69 7a 2e 20 |is a tex|t, viz. |
|00000400| 74 68 65 20 66 6f 72 6d | 75 6c 61 74 69 6f 6e 20 |the form|ulation |
|00000410| 6f 66 20 73 6f 6d 65 20 | 61 6c 67 6f 72 69 74 68 |of some |algorith|
|00000420| 6d 2c 0d 0a 65 78 70 72 | 65 73 73 65 64 20 69 6e |m,..expr|essed in|
|00000430| 20 61 20 70 72 6f 67 72 | 61 6d 6d 69 6e 67 20 6c | a progr|amming l|
|00000440| 61 6e 67 75 61 67 65 2e | 20 54 68 69 73 20 74 65 |anguage.| This te|
|00000450| 78 74 20 6f 62 65 79 73 | 20 74 68 65 20 73 79 6e |xt obeys| the syn|
|00000460| 74 61 78 0d 0a 6f 66 20 | 74 68 65 20 70 72 6f 67 |tax..of |the prog|
|00000470| 72 61 6d 6d 69 6e 67 20 | 6c 61 6e 67 75 61 67 65 |ramming |language|
|00000480| 2c 20 61 6e 64 20 61 63 | 63 6f 72 64 69 6e 67 20 |, and ac|cording |
|00000490| 74 6f 20 74 68 61 74 20 | 73 79 6e 74 61 78 20 63 |to that |syntax c|
|000004a0| 6f 6e 73 69 73 74 73 0d | 0a 6f 66 20 61 20 6e 65 |onsists.|.of a ne|
|000004b0| 73 74 65 64 20 63 6f 6c | 6c 65 63 74 69 6f 6e 20 |sted col|lection |
|000004c0| 6f 66 20 63 6f 6e 73 74 | 72 75 63 74 73 2e 20 41 |of const|ructs. A|
|000004d0| 6d 6f 6e 67 20 74 68 65 | 73 65 20 63 6f 6e 73 74 |mong the|se const|
|000004e0| 72 75 63 74 73 2c 0d 0a | 74 68 72 65 65 20 67 65 |ructs,..|three ge|
|000004f0| 6e 65 72 61 6c 20 63 6c | 61 73 73 65 73 20 63 61 |neral cl|asses ca|
|00000500| 6e 20 62 65 20 64 69 73 | 74 69 6e 67 75 69 73 68 |n be dis|tinguish|
|00000510| 65 64 3a 20 7b 5c 65 6d | 20 61 6c 67 6f 72 69 74 |ed: {\em| algorit|
|00000520| 68 6d 73 7d 2c 0d 0a 7b | 5c 65 6d 20 6f 62 6a 65 |hms},..{|\em obje|
|00000530| 63 74 73 7d 20 61 6e 64 | 20 7b 5c 65 6d 20 74 79 |cts} and| {\em ty|
|00000540| 70 65 73 7d 2c 20 77 68 | 69 63 68 20 68 61 76 65 |pes}, wh|ich have|
|00000550| 20 74 68 65 20 64 69 73 | 74 69 6e 63 74 69 6f 6e | the dis|tinction|
|00000560| 20 74 68 61 74 0d 0a 74 | 68 65 79 20 63 61 6e 20 | that..t|hey can |
|00000570| 62 65 20 64 65 6e 6f 74 | 65 64 20 62 79 20 6e 61 |be denot|ed by na|
|00000580| 6d 65 73 2e 20 54 68 65 | 20 70 72 6f 67 72 61 6d |mes. The| program|
|00000590| 20 74 65 78 74 20 63 6f | 6e 73 69 73 74 73 20 6f | text co|nsists o|
|000005a0| 66 20 73 75 63 68 0d 0a | 7b 5c 65 6d 20 65 6e 74 |f such..|{\em ent|
|000005b0| 69 74 69 65 73 7d 2c 20 | 67 6c 75 65 64 20 74 6f |ities}, |glued to|
|000005c0| 67 65 74 68 65 72 20 62 | 79 20 63 6f 6e 74 72 6f |gether b|y contro|
|000005d0| 6c 20 73 74 72 75 63 74 | 75 72 65 73 2c 20 64 61 |l struct|ures, da|
|000005e0| 74 61 20 73 74 72 75 63 | 74 75 72 65 73 0d 0a 61 |ta struc|tures..a|
|000005f0| 6e 64 20 66 75 72 74 68 | 65 72 20 63 6f 6d 70 6f |nd furth|er compo|
|00000600| 73 69 74 69 6f 6e 20 6d | 65 63 68 61 6e 69 73 6d |sition m|echanism|
|00000610| 73 20 73 75 63 68 20 61 | 73 20 65 78 70 72 65 73 |s such a|s expres|
|00000620| 73 69 6f 6e 73 20 61 6e | 64 20 66 75 6e 63 74 69 |sions an|d functi|
|00000630| 6f 6e 61 6c 0d 0a 61 70 | 70 6c 69 63 61 74 69 6f |onal..ap|plicatio|
|00000640| 6e 2e 0d 0a 0d 0a 5c 73 | 75 62 73 65 63 74 69 6f |n.....\s|ubsectio|
|00000650| 6e 7b 45 6c 65 6d 65 6e | 74 61 72 79 20 61 6e 64 |n{Elemen|tary and|
|00000660| 20 63 6f 6d 70 6f 73 65 | 64 20 65 6e 74 69 74 69 | compose|d entiti|
|00000670| 65 73 7d 0d 0a 0d 0a 41 | 6e 20 65 6e 74 69 74 79 |es}....A|n entity|
|00000680| 20 77 68 69 63 68 20 69 | 73 20 64 65 6e 6f 74 65 | which i|s denote|
|00000690| 64 20 62 79 20 61 20 6e | 61 6d 65 20 77 65 20 77 |d by a n|ame we w|
|000006a0| 69 6c 6c 20 74 65 72 6d | 20 7b 5c 65 6d 20 65 6c |ill term| {\em el|
|000006b0| 65 6d 65 6e 74 61 72 79 | 7d 3b 0d 0a 74 68 65 20 |ementary|};..the |
|000006c0| 6f 74 68 65 72 73 20 61 | 72 65 20 7b 5c 65 6d 20 |others a|re {\em |
|000006d0| 63 6f 6d 70 6f 73 65 64 | 7d 2e 20 49 74 20 6d 61 |composed|}. It ma|
|000006e0| 79 20 76 65 72 79 20 77 | 65 6c 6c 20 62 65 20 74 |y very w|ell be t|
|000006f0| 68 61 74 20 61 20 63 6f | 6d 70 6f 73 65 64 0d 0a |hat a co|mposed..|
|00000700| 65 6e 74 69 74 79 20 61 | 74 20 6f 6e 65 20 70 6c |entity a|t one pl|
|00000710| 61 63 65 20 6f 66 20 74 | 68 65 20 70 72 6f 67 72 |ace of t|he progr|
|00000720| 61 6d 20 6f 62 74 61 69 | 6e 73 20 61 20 6e 61 6d |am obtai|ns a nam|
|00000730| 65 2c 20 62 79 20 6d 65 | 61 6e 73 20 6f 66 0d 0a |e, by me|ans of..|
|00000740| 61 20 7b 5c 65 6d 20 64 | 65 63 6c 61 72 61 74 69 |a {\em d|eclarati|
|00000750| 6f 6e 7d 2c 20 61 6e 64 | 20 61 74 20 6f 74 68 65 |on}, and| at othe|
|00000760| 72 20 70 6c 61 63 65 73 | 20 6f 66 20 74 68 65 20 |r places| of the |
|00000770| 70 72 6f 67 72 61 6d 20 | 69 73 20 64 65 6e 6f 74 |program |is denot|
|00000780| 65 64 0d 0a 62 79 20 74 | 68 61 74 20 6e 61 6d 65 |ed..by t|hat name|
|00000790| 2e 20 53 75 63 68 20 61 | 20 64 65 63 6c 61 72 61 |. Such a| declara|
|000007a0| 74 69 6f 6e 20 73 65 72 | 76 65 73 20 61 73 20 61 |tion ser|ves as a|
|000007b0| 6e 20 61 62 73 74 72 61 | 63 74 69 6f 6e 20 6d 65 |n abstra|ction me|
|000007c0| 63 68 61 6e 69 73 6d 2e | 0d 0a 42 65 73 69 64 65 |chanism.|..Beside|
|000007d0| 73 20 61 20 73 68 6f 72 | 74 65 6e 69 6e 67 20 6f |s a shor|tening o|
|000007e0| 66 20 74 68 65 20 70 72 | 6f 67 72 61 6d 2c 20 74 |f the pr|ogram, t|
|000007f0| 68 69 73 20 6e 61 6d 69 | 6e 67 20 6f 66 20 65 6e |his nami|ng of en|
|00000800| 74 69 74 69 65 73 0d 0a | 61 6c 6c 6f 77 73 20 74 |tities..|allows t|
|00000810| 68 65 20 69 6e 74 72 6f | 64 75 63 74 69 6f 6e 20 |he intro|duction |
|00000820| 6f 66 20 76 61 72 69 6f | 75 73 20 7b 5c 65 6d 20 |of vario|us {\em |
|00000830| 6c 65 76 65 6c 73 20 6f | 66 20 61 62 73 74 72 61 |levels o|f abstra|
|00000840| 63 74 69 6f 6e 7d 2e 0d | 0a 0d 0a 5c 73 75 62 73 |ction}..|...\subs|
|00000850| 65 63 74 69 6f 6e 7b 41 | 62 73 74 72 61 63 74 20 |ection{A|bstract |
|00000860| 61 6e 64 20 63 6f 6e 63 | 72 65 74 65 20 65 6e 74 |and conc|rete ent|
|00000870| 69 74 69 65 73 7d 0d 0a | 0d 0a 53 6f 6d 65 20 65 |ities}..|..Some e|
|00000880| 6c 65 6d 65 6e 74 61 72 | 79 20 65 6e 74 69 74 69 |lementar|y entiti|
|00000890| 65 73 20 62 65 6c 6f 6e | 67 20 74 6f 20 74 68 65 |es belon|g to the|
|000008a0| 20 6c 61 6e 67 75 61 67 | 65 20 61 6e 64 20 61 72 | languag|e and ar|
|000008b0| 65 20 61 76 61 69 6c 61 | 62 6c 65 0d 0a 77 69 74 |e availa|ble..wit|
|000008c0| 68 6f 75 74 20 66 75 72 | 74 68 65 72 20 65 66 66 |hout fur|ther eff|
|000008d0| 6f 72 74 20 62 79 20 74 | 68 65 20 70 72 6f 67 72 |ort by t|he progr|
|000008e0| 61 6d 6d 65 72 2c 20 77 | 69 74 68 20 74 68 65 69 |ammer, w|ith thei|
|000008f0| 72 20 73 70 65 63 69 66 | 69 63 0d 0a 73 65 6d 61 |r specif|ic..sema|
|00000900| 6e 74 69 63 73 2e 20 54 | 68 65 73 65 20 77 65 20 |ntics. T|hese we |
|00000910| 77 69 6c 6c 20 74 65 72 | 6d 20 7b 5c 65 6d 20 63 |will ter|m {\em c|
|00000920| 6f 6e 63 72 65 74 65 7d | 2e 20 4f 74 68 65 72 73 |oncrete}|. Others|
|00000930| 20 77 65 20 77 69 6c 6c | 0d 0a 74 65 72 6d 20 7b | we will|..term {|
|00000940| 5c 65 6d 20 61 62 73 74 | 72 61 63 74 7d 3a 20 74 |\em abst|ract}: t|
|00000950| 68 65 79 20 61 72 65 20 | 63 6f 6e 73 74 72 75 63 |hey are |construc|
|00000960| 74 65 64 20 62 79 20 74 | 68 65 20 70 72 6f 67 72 |ted by t|he progr|
|00000970| 61 6d 6d 65 72 20 61 6e | 64 0d 0a 61 62 73 74 72 |ammer an|d..abstr|
|00000980| 61 63 74 65 64 20 62 79 | 20 6d 65 61 6e 73 20 6f |acted by| means o|
|00000990| 66 20 61 20 64 65 63 6c | 61 72 61 74 69 6f 6e 2e |f a decl|aration.|
|000009a0| 20 57 65 20 6d 69 67 68 | 74 20 64 65 66 69 6e 65 | We migh|t define|
|000009b0| 20 70 72 6f 67 72 61 6d | 6d 69 6e 67 0d 0a 61 6c | program|ming..al|
|000009c0| 6f 6e 67 20 74 68 65 73 | 65 20 6c 69 6e 65 73 20 |ong thes|e lines |
|000009d0| 61 73 20 74 68 65 20 63 | 6f 6e 73 74 72 75 63 74 |as the c|onstruct|
|000009e0| 69 6f 6e 0d 0a 6f 66 20 | 61 62 73 74 72 61 63 74 |ion..of |abstract|
|000009f0| 20 61 6c 67 6f 72 69 74 | 68 6d 73 2e 0d 0a 0d 0a | algorit|hms.....|
|00000a00| 5c 73 75 62 73 65 63 74 | 69 6f 6e 7b 43 6f 6d 70 |\subsect|ion{Comp|
|00000a10| 6f 73 69 74 69 6f 6e 20 | 6d 65 63 68 61 6e 69 73 |osition |mechanis|
|00000a20| 6d 73 7d 0d 0a 0d 0a 49 | 6e 20 74 68 65 20 64 65 |ms}....I|n the de|
|00000a30| 73 69 67 6e 20 6f 66 20 | 61 6e 20 61 6c 67 6f 72 |sign of |an algor|
|00000a40| 69 74 68 6d 20 61 20 70 | 72 6f 67 72 61 6d 6d 65 |ithm a p|rogramme|
|00000a50| 72 20 73 68 6f 75 6c 64 | 20 6e 6f 74 20 74 72 79 |r should| not try|
|00000a60| 20 74 6f 0d 0a 65 78 70 | 72 65 73 73 20 69 74 20 | to..exp|ress it |
|00000a70| 69 6e 20 61 6c 6c 20 64 | 65 74 61 69 6c 20 61 74 |in all d|etail at|
|00000a80| 20 6f 6e 63 65 2e 20 49 | 6e 73 74 65 61 64 2c 20 | once. I|nstead, |
|00000a90| 74 68 65 20 70 72 6f 67 | 72 61 6d 6d 65 72 20 73 |the prog|rammer s|
|00000aa0| 68 6f 75 6c 64 0d 0a 73 | 70 6c 69 74 20 69 74 20 |hould..s|plit it |
|00000ab0| 69 6e 74 6f 20 6d 61 6a | 6f 72 20 70 61 72 74 73 |into maj|or parts|
|00000ac0| 20 77 68 69 63 68 20 63 | 61 6e 20 62 65 20 72 65 | which c|an be re|
|00000ad0| 66 69 6e 65 64 20 69 6e | 20 61 20 73 74 65 70 77 |fined in| a stepw|
|00000ae0| 69 73 65 0d 0a 66 61 73 | 68 69 6f 6e 20 64 6f 77 |ise..fas|hion dow|
|00000af0| 6e 20 74 6f 20 74 68 65 | 20 65 6c 65 6d 65 6e 74 |n to the| element|
|00000b00| 61 72 79 20 65 6e 74 69 | 74 69 65 73 20 62 65 6c |ary enti|ties bel|
|00000b10| 6f 6e 67 69 6e 67 20 74 | 6f 20 74 68 65 20 70 72 |onging t|o the pr|
|00000b20| 6f 67 72 61 6d 6d 69 6e | 67 0d 0a 6c 61 6e 67 75 |ogrammin|g..langu|
|00000b30| 61 67 65 2e 20 41 6c 67 | 6f 72 69 74 68 6d 73 20 |age. Alg|orithms |
|00000b40| 61 72 65 20 74 68 75 73 | 20 63 6f 6d 70 6f 73 65 |are thus| compose|
|00000b50| 64 20 6f 66 20 6f 74 68 | 65 72 20 61 6c 67 6f 72 |d of oth|er algor|
|00000b60| 69 74 68 6d 73 20 77 68 | 69 63 68 0d 0a 69 6e 20 |ithms wh|ich..in |
|00000b70| 74 68 65 69 72 20 74 75 | 72 6e 20 61 72 65 20 65 |their tu|rn are e|
|00000b80| 69 74 68 65 72 20 63 6f | 6d 70 6f 73 65 64 20 6f |ither co|mposed o|
|00000b90| 72 20 65 6c 65 6d 65 6e | 74 61 72 79 2e 0d 0a 0d |r elemen|tary....|
|00000ba0| 0a 50 61 72 74 69 63 75 | 6c 61 72 20 63 6f 6d 70 |.Particu|lar comp|
|00000bb0| 6f 73 69 74 69 6f 6e 20 | 6d 65 63 68 61 6e 69 73 |osition |mechanis|
|00000bc0| 6d 73 20 66 6f 72 20 74 | 68 65 20 61 6c 67 6f 72 |ms for t|he algor|
|00000bd0| 69 74 68 6d 73 20 6f 6e | 20 74 68 65 20 6f 6e 65 |ithms on| the one|
|00000be0| 0d 0a 68 61 6e 64 2c 20 | 61 6e 64 20 74 68 65 20 |..hand, |and the |
|00000bf0| 6f 62 6a 65 63 74 73 20 | 61 6e 64 20 74 79 70 65 |objects |and type|
|00000c00| 73 20 6f 6e 20 74 68 65 | 20 6f 74 68 65 72 20 68 |s on the| other h|
|00000c10| 61 6e 64 2c 20 61 72 65 | 20 74 65 72 6d 65 64 0d |and, are| termed.|
|00000c20| 0a 7b 5c 65 6d 20 63 6f | 6e 74 72 6f 6c 20 73 74 |.{\em co|ntrol st|
|00000c30| 72 75 63 74 75 72 65 73 | 7d 20 61 6e 64 20 7b 5c |ructures|} and {\|
|00000c40| 65 6d 20 64 61 74 61 20 | 73 74 72 75 63 74 75 72 |em data |structur|
|00000c50| 65 73 7d 2c 20 72 65 73 | 70 65 63 74 69 76 65 6c |es}, res|pectivel|
|00000c60| 79 2e 0d 0a 0d 0a 5c 73 | 75 62 73 65 63 74 69 6f |y.....\s|ubsectio|
|00000c70| 6e 7b 57 68 65 72 65 20 | 64 6f 65 73 20 45 6c 61 |n{Where |does Ela|
|00000c80| 6e 20 66 69 74 20 69 6e | 20 74 68 69 73 20 74 61 |n fit in| this ta|
|00000c90| 78 6f 6e 6f 6d 79 3f 7d | 0d 0a 0d 0a 54 72 61 64 |xonomy?}|....Trad|
|00000ca0| 69 74 69 6f 6e 61 6c 6c | 79 2c 20 63 6f 6d 70 6f |itionall|y, compo|
|00000cb0| 73 69 74 69 6f 6e 20 6d | 65 63 68 61 6e 69 73 6d |sition m|echanism|
|00000cc0| 73 20 68 61 76 65 20 62 | 65 65 6e 20 73 65 65 6e |s have b|een seen|
|00000cd0| 20 61 73 20 74 68 65 0d | 0a 63 65 6e 74 72 61 6c | as the.|.central|
|00000ce0| 20 6d 65 63 68 61 6e 69 | 73 6d 73 20 69 6e 20 73 | mechani|sms in s|
|00000cf0| 79 73 74 65 6d 61 74 69 | 63 20 28 60 60 73 74 72 |ystemati|c (``str|
|00000d00| 75 63 74 75 72 65 64 27 | 27 29 20 70 72 6f 67 72 |uctured'|') progr|
|00000d10| 61 6d 6d 69 6e 67 2e 0d | 0a 45 6c 61 6e 20 68 61 |amming..|.Elan ha|
|00000d20| 73 20 72 61 74 68 65 72 | 20 63 6f 6e 76 65 6e 74 |s rather| convent|
|00000d30| 69 6f 6e 61 6c 20 63 6f | 6e 74 72 6f 6c 20 73 74 |ional co|ntrol st|
|00000d40| 72 75 63 74 75 72 65 73 | 20 61 6e 64 20 72 65 6c |ructures| and rel|
|00000d50| 61 74 69 76 65 6c 79 0d | 0a 73 69 6d 70 6c 65 20 |atively.|.simple |
|00000d60| 64 61 74 61 20 73 74 72 | 75 63 74 75 72 65 73 2e |data str|uctures.|
|00000d70| 20 49 6e 20 63 6f 6e 74 | 72 61 73 74 2c 20 69 6e | In cont|rast, in|
|00000d80| 20 45 6c 61 6e 20 74 68 | 65 20 61 62 73 74 72 61 | Elan th|e abstra|
|00000d90| 63 74 69 6f 6e 20 6d 65 | 63 68 61 6e 69 73 6d 73 |ction me|chanisms|
|00000da0| 0d 0a 61 72 65 20 73 65 | 65 6e 20 61 73 20 74 68 |..are se|en as th|
|00000db0| 65 20 63 65 6e 74 72 61 | 6c 20 69 73 73 75 65 20 |e centra|l issue |
|00000dc0| 69 6e 20 61 6e 79 20 70 | 72 6f 67 72 61 6d 6d 69 |in any p|rogrammi|
|00000dd0| 6e 67 20 6d 65 74 68 6f | 64 6f 6c 6f 67 79 0d 0a |ng metho|dology..|
|00000de0| 61 6e 64 20 63 6f 6e 73 | 65 71 75 65 6e 74 6c 79 |and cons|equently|
|00000df0| 20 68 69 67 68 6c 79 20 | 64 65 76 65 6c 6f 70 65 | highly |develope|
|00000e00| 64 2e 0d 0a 0d 0a 54 68 | 65 20 45 6c 61 6e 20 50 |d.....Th|e Elan P|
|00000e10| 72 6f 67 72 61 6d 6d 69 | 6e 67 20 45 6e 76 69 72 |rogrammi|ng Envir|
|00000e20| 6f 6e 6d 65 6e 74 20 66 | 75 72 74 68 65 72 20 73 |onment f|urther s|
|00000e30| 74 72 65 73 73 65 73 20 | 74 68 69 73 20 76 69 65 |tresses |this vie|
|00000e40| 77 0d 0a 62 79 20 6d 61 | 6b 69 6e 67 20 74 68 65 |w..by ma|king the|
|00000e50| 20 64 65 66 69 6e 69 74 | 69 6f 6e 20 6f 66 20 61 | definit|ion of a|
|00000e60| 62 73 74 72 61 63 74 20 | 61 6c 67 6f 72 69 74 68 |bstract |algorith|
|00000e70| 6d 73 20 28 72 65 66 69 | 6e 65 6d 65 6e 74 73 29 |ms (refi|nements)|
|00000e80| 0d 0a 74 68 65 20 62 61 | 73 69 73 20 66 6f 72 20 |..the ba|sis for |
|00000e90| 74 68 65 20 64 65 76 65 | 6c 6f 70 6d 65 6e 74 20 |the deve|lopment |
|00000ea0| 61 6e 64 20 6d 61 6e 69 | 70 75 6c 61 74 69 6f 6e |and mani|pulation|
|00000eb0| 20 6f 66 20 70 72 6f 67 | 72 61 6d 73 2e 20 49 74 | of prog|rams. It|
|00000ec0| 0d 0a 63 6f 6e 73 69 64 | 65 72 73 20 61 20 70 72 |..consid|ers a pr|
|00000ed0| 6f 67 72 61 6d 20 61 73 | 20 61 20 63 6f 6c 6c 65 |ogram as| a colle|
|00000ee0| 63 74 69 6f 6e 20 6f 66 | 20 72 65 66 69 6e 65 6d |ction of| refinem|
|00000ef0| 65 6e 74 73 2c 20 72 61 | 74 68 65 72 20 74 68 61 |ents, ra|ther tha|
|00000f00| 6e 0d 0a 6f 6e 65 20 74 | 65 78 74 2e 0d 0a 0d 0a |n..one t|ext.....|
|00000f10| 5c 73 65 63 74 69 6f 6e | 7b 54 68 65 20 6e 6f 74 |\section|{The not|
|00000f20| 61 74 69 6f 6e 20 6f 66 | 20 61 6c 67 6f 72 69 74 |ation of| algorit|
|00000f30| 68 6d 73 7d 0d 0a 0d 0a | 5c 73 75 62 73 65 63 74 |hms}....|\subsect|
|00000f40| 69 6f 6e 7b 4e 61 6d 65 | 73 20 6f 66 20 61 6c 67 |ion{Name|s of alg|
|00000f50| 6f 72 69 74 68 6d 73 7d | 0d 0a 0d 0a 4e 61 6d 65 |orithms}|....Name|
|00000f60| 73 20 61 72 65 20 65 69 | 74 68 65 72 20 74 68 65 |s are ei|ther the|
|00000f70| 20 6e 61 6d 65 73 20 6f | 66 20 63 6f 6e 63 72 65 | names o|f concre|
|00000f80| 74 65 20 61 6c 67 6f 72 | 69 74 68 6d 73 2c 20 77 |te algor|ithms, w|
|00000f90| 68 69 63 68 20 6d 65 61 | 6e 73 0d 0a 74 68 61 74 |hich mea|ns..that|
|00000fa0| 20 74 68 65 79 20 61 72 | 65 20 70 72 65 64 65 66 | they ar|e predef|
|00000fb0| 69 6e 65 64 20 69 6e 20 | 74 68 65 20 45 6c 61 6e |ined in |the Elan|
|00000fc0| 20 49 6e 74 65 72 70 72 | 65 74 65 72 2c 20 6f 72 | Interpr|eter, or|
|00000fd0| 20 74 68 65 79 20 61 72 | 65 0d 0a 69 6e 74 72 6f | they ar|e..intro|
|00000fe0| 64 75 63 65 64 20 62 79 | 20 74 68 65 20 70 72 6f |duced by| the pro|
|00000ff0| 67 72 61 6d 6d 65 72 20 | 62 79 20 74 68 65 20 64 |grammer |by the d|
|00001000| 65 66 69 6e 69 74 69 6f | 6e 20 6f 66 20 61 62 73 |efinitio|n of abs|
|00001010| 74 72 61 63 74 20 61 6c | 67 6f 72 69 74 68 6d 73 |tract al|gorithms|
|00001020| 0d 0a 75 73 69 6e 67 20 | 72 65 66 69 6e 65 6d 65 |..using |refineme|
|00001030| 6e 74 73 2e 20 48 65 72 | 65 20 77 65 20 65 78 70 |nts. Her|e we exp|
|00001040| 6c 61 69 6e 20 74 68 65 | 69 72 20 66 6f 72 6d 61 |lain the|ir forma|
|00001050| 74 69 6f 6e 20 72 75 6c | 65 73 2e 0d 0a 0d 0a 4e |tion rul|es.....N|
|00001060| 61 6d 65 73 20 66 6f 72 | 20 61 62 73 74 72 61 63 |ames for| abstrac|
|00001070| 74 20 61 6c 67 6f 72 69 | 74 68 6d 73 20 63 61 6e |t algori|thms can|
|00001080| 20 62 65 20 66 72 65 65 | 6c 79 20 69 6e 76 65 6e | be free|ly inven|
|00001090| 74 65 64 2e 20 53 75 63 | 68 20 61 0d 0a 6e 61 6d |ted. Suc|h a..nam|
|000010a0| 65 20 68 61 73 20 74 68 | 65 20 66 6f 72 6d 20 6f |e has th|e form o|
|000010b0| 66 20 61 6e 20 7b 5c 65 | 6d 20 69 64 65 6e 74 69 |f an {\e|m identi|
|000010c0| 66 69 65 72 7d 2c 20 63 | 6f 6e 73 69 73 74 69 6e |fier}, c|onsistin|
|000010d0| 67 20 6f 66 20 61 20 6c | 65 61 64 69 6e 67 0d 0a |g of a l|eading..|
|000010e0| 28 6c 6f 77 65 72 20 63 | 61 73 65 29 20 6c 65 74 |(lower c|ase) let|
|000010f0| 74 65 72 2c 20 66 6f 6c | 6c 6f 77 65 64 20 62 79 |ter, fol|lowed by|
|00001100| 20 6c 65 74 74 65 72 73 | 2c 20 64 69 67 69 74 73 | letters|, digits|
|00001110| 2c 20 61 6e 64 20 70 6f | 73 73 69 62 6c 79 0d 0a |, and po|ssibly..|
|00001120| 65 6d 62 65 64 64 65 64 | 20 73 70 61 63 65 73 2e |embedded| spaces.|
|00001130| 20 54 68 65 20 6c 61 74 | 74 65 72 20 73 65 72 76 | The lat|ter serv|
|00001140| 65 20 74 6f 20 65 6e 68 | 61 6e 63 65 20 74 68 65 |e to enh|ance the|
|00001150| 20 72 65 61 64 61 62 69 | 6c 69 74 79 0d 0a 6f 66 | readabi|lity..of|
|00001160| 20 70 72 6f 67 72 61 6d | 73 2e 20 49 6e 20 63 6f | program|s. In co|
|00001170| 6e 74 72 61 73 74 20 74 | 6f 20 66 75 6c 6c 20 45 |ntrast t|o full E|
|00001180| 6c 61 6e 2c 20 73 75 63 | 68 20 73 70 61 63 65 73 |lan, suc|h spaces|
|00001190| 20 69 6e 20 45 6c 61 6e | 2d 30 0d 0a 61 72 65 20 | in Elan|-0..are |
|000011a0| 63 6f 6e 73 69 64 65 72 | 65 64 20 73 69 67 6e 69 |consider|ed signi|
|000011b0| 66 69 63 61 6e 74 20 61 | 6e 64 20 61 72 65 20 70 |ficant a|nd are p|
|000011c0| 61 72 74 20 6f 66 20 74 | 68 65 20 6e 61 6d 65 2e |art of t|he name.|
|000011d0| 20 53 6f 6d 65 20 65 78 | 61 6d 70 6c 65 73 3a 0d | Some ex|amples:.|
|000011e0| 0a 0d 0a 5c 62 65 67 69 | 6e 7b 65 6c 61 6e 7d 0d |...\begi|n{elan}.|
|000011f0| 0a 20 20 20 20 20 20 20 | 20 66 69 6e 64 20 75 70 |. | find up|
|00001200| 70 65 72 20 6c 69 6d 69 | 74 0d 0a 20 20 20 20 20 |per limi|t.. |
|00001210| 20 20 20 77 6f 72 64 20 | 6f 63 63 75 72 73 20 6f | word |occurs o|
|00001220| 6e 20 74 68 69 73 20 70 | 61 67 65 0d 0a 5c 65 6e |n this p|age..\en|
|00001230| 64 7b 65 6c 61 6e 7d 0d | 0a 0d 0a 5c 6e 6f 69 6e |d{elan}.|...\noin|
|00001240| 64 65 6e 74 0d 0a 4e 61 | 6d 65 73 20 73 68 61 6c |dent..Na|mes shal|
|00001250| 6c 20 62 65 20 63 68 6f | 73 65 6e 20 73 75 63 68 |l be cho|sen such|
|00001260| 20 74 68 61 74 20 74 68 | 65 79 20 65 78 70 72 65 | that th|ey expre|
|00001270| 73 73 20 63 6f 6e 63 69 | 73 65 6c 79 20 7b 5c 65 |ss conci|sely {\e|
|00001280| 6d 20 77 68 61 74 7d 0d | 0a 69 73 20 64 6f 6e 65 |m what}.|.is done|
|00001290| 20 62 79 20 61 6e 20 61 | 6c 67 6f 72 69 74 68 6d | by an a|lgorithm|
|000012a0| 2c 20 6e 6f 74 0d 0a 73 | 70 65 6c 6c 69 6e 67 20 |, not..s|pelling |
|000012b0| 6f 75 74 20 69 6e 20 64 | 65 74 61 69 6c 20 7b 5c |out in d|etail {\|
|000012c0| 65 6d 20 68 6f 77 7d 20 | 69 74 20 69 73 20 70 65 |em how} |it is pe|
|000012d0| 72 66 6f 72 6d 65 64 2e | 20 49 6e 76 65 6e 74 69 |rformed.| Inventi|
|000012e0| 6e 67 20 73 75 69 74 61 | 62 6c 65 0d 0a 6e 61 6d |ng suita|ble..nam|
|000012f0| 65 73 20 69 73 20 61 20 | 6e 6f 6e 2d 74 72 69 76 |es is a |non-triv|
|00001300| 69 61 6c 20 74 61 73 6b | 20 61 6e 64 20 6e 65 65 |ial task| and nee|
|00001310| 64 73 20 65 78 70 65 72 | 69 65 6e 63 65 20 77 68 |ds exper|ience wh|
|00001320| 69 63 68 20 63 61 6e 20 | 62 65 0d 0a 67 61 69 6e |ich can |be..gain|
|00001330| 65 64 20 6f 6e 6c 79 20 | 62 79 20 74 68 65 20 73 |ed only |by the s|
|00001340| 74 75 64 79 20 6f 66 20 | 67 6f 6f 64 20 65 78 61 |tudy of |good exa|
|00001350| 6d 70 6c 65 73 2c 20 65 | 78 65 72 63 69 73 65 73 |mples, e|xercises|
|00001360| 2c 20 61 6e 64 20 62 79 | 0d 0a 74 68 65 20 63 6f |, and by|..the co|
|00001370| 6e 74 65 6d 70 6c 61 74 | 69 6f 6e 20 6f 66 20 70 |ntemplat|ion of p|
|00001380| 72 6f 67 72 61 6d 6d 69 | 6e 67 20 70 72 6f 62 6c |rogrammi|ng probl|
|00001390| 65 6d 73 2e 0d 0a 0d 0a | 5c 73 75 62 73 65 63 74 |ems.....|\subsect|
|000013a0| 69 6f 6e 7b 43 6f 6e 74 | 72 6f 6c 20 73 74 72 75 |ion{Cont|rol stru|
|000013b0| 63 74 75 72 65 73 7d 0d | 0a 0d 0a 54 68 65 20 66 |ctures}.|...The f|
|000013c0| 69 72 73 74 20 73 74 65 | 70 20 74 6f 77 61 72 64 |irst ste|p toward|
|000013d0| 73 20 61 20 70 72 65 63 | 69 73 65 20 64 65 73 63 |s a prec|ise desc|
|000013e0| 72 69 70 74 69 6f 6e 20 | 6f 66 20 61 6c 67 6f 72 |ription |of algor|
|000013f0| 69 74 68 6d 73 20 69 73 | 0d 0a 74 68 65 20 75 73 |ithms is|..the us|
|00001400| 65 20 6f 66 20 61 20 63 | 6f 6c 6c 65 63 74 69 6f |e of a c|ollectio|
|00001410| 6e 20 6f 66 20 73 74 79 | 6c 69 73 74 69 63 20 70 |n of sty|listic p|
|00001420| 61 74 74 65 72 6e 73 20 | 66 6f 72 20 63 6f 6e 6e |atterns |for conn|
|00001430| 65 63 74 69 6e 67 0d 0a | 74 6f 67 65 74 68 65 72 |ecting..|together|
|00001440| 20 74 68 65 20 61 6c 67 | 6f 72 69 74 68 6d 69 63 | the alg|orithmic|
|00001450| 20 73 74 65 70 73 20 70 | 65 72 66 6f 72 6d 65 64 | steps p|erformed|
|00001460| 20 69 6e 20 74 68 65 20 | 65 78 65 63 75 74 69 6f | in the |executio|
|00001470| 6e 20 6f 66 0d 0a 70 72 | 6f 67 72 61 6d 73 2e 20 |n of..pr|ograms. |
|00001480| 54 68 65 73 65 20 70 61 | 74 74 65 72 6e 73 20 61 |These pa|tterns a|
|00001490| 72 65 20 63 61 6c 6c 65 | 64 20 7b 5c 65 6d 20 63 |re calle|d {\em c|
|000014a0| 6f 6e 74 72 6f 6c 20 73 | 74 72 75 63 74 75 72 65 |ontrol s|tructure|
|000014b0| 73 7d 2e 0d 0a 45 6c 61 | 6e 2d 30 20 6b 6e 6f 77 |s}...Ela|n-0 know|
|000014c0| 73 20 74 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 3a |s the fo|llowing:|
|000014d0| 0d 0a 0d 0a 5c 62 65 67 | 69 6e 7b 69 74 65 6d 69 |....\beg|in{itemi|
|000014e0| 7a 65 7d 0d 0a 5c 69 74 | 65 6d 20 73 65 71 75 65 |ze}..\it|em seque|
|000014f0| 6e 63 65 3b 0d 0a 5c 69 | 74 65 6d 20 72 65 70 65 |nce;..\i|tem repe|
|00001500| 74 69 74 69 6f 6e 3b 0d | 0a 5c 69 74 65 6d 20 63 |tition;.|.\item c|
|00001510| 68 6f 69 63 65 2e 0d 0a | 5c 65 6e 64 7b 69 74 65 |hoice...|\end{ite|
|00001520| 6d 69 7a 65 7d 0d 0a 0d | 0a 5c 6e 6f 69 6e 64 65 |mize}...|.\noinde|
|00001530| 6e 74 0d 0a 54 68 65 20 | 66 6f 72 6d 73 20 61 76 |nt..The |forms av|
|00001540| 61 69 6c 61 62 6c 65 20 | 69 6e 20 45 6c 61 6e 20 |ailable |in Elan |
|00001550| 61 72 65 20 61 6c 73 6f | 20 61 76 61 69 6c 61 62 |are also| availab|
|00001560| 6c 65 20 69 6e 20 6d 6f | 73 74 20 6f 74 68 65 72 |le in mo|st other|
|00001570| 0d 0a 70 72 6f 67 72 61 | 6d 6d 69 6e 67 20 6c 61 |..progra|mming la|
|00001580| 6e 67 75 61 67 65 73 2e | 20 45 6c 61 6e 20 75 73 |nguages.| Elan us|
|00001590| 65 73 20 61 20 6e 6f 74 | 61 74 69 6f 6e 20 77 69 |es a not|ation wi|
|000015a0| 74 68 20 6b 65 79 77 6f | 72 64 73 20 77 72 69 74 |th keywo|rds writ|
|000015b0| 74 65 6e 0d 0a 69 6e 20 | 75 70 70 65 72 20 63 61 |ten..in |upper ca|
|000015c0| 73 65 2e 20 54 68 65 79 | 20 77 69 6c 6c 20 62 65 |se. They| will be|
|000015d0| 20 69 6e 74 72 6f 64 75 | 63 65 64 20 62 79 20 77 | introdu|ced by w|
|000015e0| 61 79 20 6f 66 20 65 78 | 61 6d 70 6c 65 73 20 69 |ay of ex|amples i|
|000015f0| 6e 0d 0a 74 68 65 20 6e | 65 78 74 20 73 75 62 63 |n..the n|ext subc|
|00001600| 68 61 70 74 65 72 73 2e | 0d 0a 0d 0a 5c 73 75 62 |hapters.|....\sub|
|00001610| 73 75 62 73 65 63 74 69 | 6f 6e 7b 53 65 71 75 65 |subsecti|on{Seque|
|00001620| 6e 63 65 7d 0d 0a 0d 0a | 54 68 65 20 73 65 71 75 |nce}....|The sequ|
|00001630| 65 6e 74 69 61 6c 20 65 | 78 65 63 75 74 69 6f 6e |ential e|xecution|
|00001640| 20 6f 66 20 74 68 65 20 | 73 74 65 70 73 20 6f 66 | of the |steps of|
|00001650| 20 61 6e 20 61 6c 67 6f | 72 69 74 68 6d 20 69 73 | an algo|rithm is|
|00001660| 20 64 65 6e 6f 74 65 64 | 0d 0a 62 79 20 70 6c 61 | denoted|..by pla|
|00001670| 63 69 6e 67 20 61 20 73 | 65 6d 69 63 6f 6c 6f 6e |cing a s|emicolon|
|00001680| 20 62 65 74 77 65 65 6e | 20 74 68 65 6d 2e 0d 0a | between| them...|
|00001690| 0d 0a 5c 62 65 67 69 6e | 7b 65 6c 61 6e 7d 0d 0a |..\begin|{elan}..|
|000016a0| 20 20 20 20 20 20 20 20 | 72 65 61 64 20 74 68 65 | |read the|
|000016b0| 20 63 75 72 72 65 6e 74 | 20 70 61 67 65 20 3b 0d | current| page ;.|
|000016c0| 0a 20 20 20 20 20 20 20 | 20 74 75 72 6e 20 70 61 |. | turn pa|
|000016d0| 67 65 20 6f 76 65 72 20 | 3b 0d 0a 20 20 20 20 20 |ge over |;.. |
|000016e0| 20 20 20 72 65 61 64 20 | 74 68 65 20 63 75 72 72 | read |the curr|
|000016f0| 65 6e 74 20 70 61 67 65 | 0d 0a 5c 65 6e 64 7b 65 |ent page|..\end{e|
|00001700| 6c 61 6e 7d 0d 0a 0d 0a | 5c 6e 6f 69 6e 64 65 6e |lan}....|\noinden|
|00001710| 74 0d 0a 54 68 65 73 65 | 20 61 72 65 20 74 68 65 |t..These| are the|
|00001720| 20 6e 61 6d 65 73 20 6f | 66 20 74 68 72 65 65 20 | names o|f three |
|00001730| 61 62 73 74 72 61 63 74 | 20 61 6c 67 6f 72 69 74 |abstract| algorit|
|00001740| 68 6d 73 20 74 6f 20 62 | 65 20 65 78 65 63 75 74 |hms to b|e execut|
|00001750| 65 64 0d 0a 6f 6e 65 20 | 61 66 74 65 72 20 74 68 |ed..one |after th|
|00001760| 65 20 6f 74 68 65 72 2e | 20 54 68 65 20 73 65 6d |e other.| The sem|
|00001770| 69 63 6f 6c 6f 6e 20 69 | 73 20 61 20 7b 5c 65 6d |icolon i|s a {\em|
|00001780| 20 73 65 70 61 72 61 74 | 6f 72 7d 20 62 65 74 77 | separat|or} betw|
|00001790| 65 65 6e 0d 0a 74 68 65 | 6d 20 28 6e 6f 74 20 61 |een..the|m (not a|
|000017a0| 20 74 65 72 6d 69 6e 61 | 74 6f 72 29 2c 20 61 6e | termina|tor), an|
|000017b0| 64 20 63 61 6e 20 62 65 | 20 72 65 61 64 20 61 73 |d can be| read as|
|000017c0| 20 60 60 61 6e 64 20 74 | 68 65 6e 27 27 2e 0d 0a | ``and t|hen''...|
|000017d0| 0d 0a 57 65 20 63 61 6c | 6c 20 73 75 63 68 20 61 |..We cal|l such a|
|000017e0| 20 73 65 71 75 65 6e 63 | 65 20 61 20 7b 5c 65 6d | sequenc|e a {\em|
|000017f0| 20 70 61 72 61 67 72 61 | 70 68 7d 2c 20 61 6e 64 | paragra|ph}, and|
|00001800| 20 69 74 73 20 63 6f 6e | 73 74 69 74 75 65 6e 74 | its con|stituent|
|00001810| 73 0d 0a 7b 5c 65 6d 20 | 75 6e 69 74 73 7d 2e 20 |s..{\em |units}. |
|00001820| 54 68 65 20 65 78 61 6d | 70 6c 65 20 70 61 72 61 |The exam|ple para|
|00001830| 67 72 61 70 68 20 61 62 | 6f 76 65 20 63 6f 6e 74 |graph ab|ove cont|
|00001840| 61 69 6e 73 20 33 20 73 | 75 63 68 20 75 6e 69 74 |ains 3 s|uch unit|
|00001850| 73 0d 0a 61 6e 64 20 69 | 74 73 20 65 78 65 63 75 |s..and i|ts execu|
|00001860| 74 69 6f 6e 20 63 6f 6e | 73 69 73 74 73 20 6f 66 |tion con|sists of|
|00001870| 20 74 68 65 20 65 78 65 | 63 75 74 69 6f 6e 2c 20 | the exe|cution, |
|00001880| 69 6e 20 74 68 61 74 20 | 6f 72 64 65 72 2c 20 6f |in that |order, o|
|00001890| 66 0d 0a 74 68 65 20 74 | 68 72 65 65 20 75 6e 69 |f..the t|hree uni|
|000018a0| 74 73 2e 20 49 6e 20 74 | 68 69 73 20 77 61 79 20 |ts. In t|his way |
|000018b0| 74 68 65 20 7b 5c 65 6d | 20 65 66 66 65 63 74 7d |the {\em| effect}|
|000018c0| 20 6f 66 20 74 68 65 20 | 70 61 72 61 67 72 61 70 | of the |paragrap|
|000018d0| 68 0d 0a 69 73 20 74 68 | 65 20 63 6f 6d 70 6f 73 |h..is th|e compos|
|000018e0| 69 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 65 66 66 |ition of| the eff|
|000018f0| 65 63 74 73 20 6f 66 20 | 69 74 73 20 75 6e 69 74 |ects of |its unit|
|00001900| 73 2e 20 54 68 65 20 7b | 5c 65 6d 20 76 61 6c 75 |s. The {|\em valu|
|00001910| 65 7d 0d 0a 6f 66 20 61 | 20 70 61 72 61 67 72 61 |e}..of a| paragra|
|00001920| 70 68 20 28 69 66 20 61 | 6e 79 29 20 69 73 20 74 |ph (if a|ny) is t|
|00001930| 68 65 20 76 61 6c 75 65 | 20 6f 66 20 69 74 73 20 |he value| of its |
|00001940| 6c 61 73 74 20 75 6e 69 | 74 2e 0d 0a 0d 0a 5c 73 |last uni|t.....\s|
|00001950| 75 62 73 75 62 73 65 63 | 74 69 6f 6e 7b 52 65 70 |ubsubsec|tion{Rep|
|00001960| 65 74 69 74 69 6f 6e 7d | 0d 0a 0d 0a 52 65 70 65 |etition}|....Repe|
|00001970| 74 69 74 69 6f 6e 20 63 | 61 6e 20 62 65 20 65 78 |tition c|an be ex|
|00001980| 70 72 65 73 73 65 64 20 | 69 6e 20 61 20 6e 75 6d |pressed |in a num|
|00001990| 62 65 72 20 6f 66 20 77 | 61 79 73 2e 20 41 6e 20 |ber of w|ays. An |
|000019a0| 69 6d 70 6f 72 74 61 6e | 74 0d 0a 70 61 72 61 64 |importan|t..parad|
|000019b0| 69 67 6d 20 6f 66 20 72 | 65 70 65 74 69 74 69 6f |igm of r|epetitio|
|000019c0| 6e 20 69 73 20 74 68 65 | 20 77 68 69 6c 65 2d 6c |n is the| while-l|
|000019d0| 6f 6f 70 2c 20 65 2e 67 | 2e 0d 0a 0d 0a 5c 62 65 |oop, e.g|.....\be|
|000019e0| 67 69 6e 7b 65 6c 61 6e | 7d 0d 0a 20 20 20 20 20 |gin{elan|}.. |
|000019f0| 20 20 20 57 48 49 4c 45 | 0d 0a 20 20 20 20 20 20 | WHILE|.. |
|00001a00| 20 20 20 20 74 68 65 20 | 77 6f 72 64 20 64 6f 65 | the |word doe|
|00001a10| 73 20 6e 6f 74 20 6f 63 | 63 75 72 20 6f 6e 20 74 |s not oc|cur on t|
|00001a20| 68 69 73 20 70 61 67 65 | 0d 0a 20 20 20 20 20 20 |his page|.. |
|00001a30| 20 20 52 45 50 0d 0a 20 | 20 20 20 20 20 20 20 20 | REP.. | |
|00001a40| 20 6c 6f 6f 6b 20 61 74 | 20 74 68 65 20 66 6f 6c | look at| the fol|
|00001a50| 6c 6f 77 69 6e 67 20 70 | 61 67 65 0d 0a 20 20 20 |lowing p|age.. |
|00001a60| 20 20 20 20 20 45 4e 44 | 52 45 50 0d 0a 5c 65 6e | END|REP..\en|
|00001a70| 64 7b 65 6c 61 6e 7d 0d | 0a 0d 0a 5c 6e 6f 69 6e |d{elan}.|...\noin|
|00001a80| 64 65 6e 74 0d 0a 54 68 | 65 20 7b 5c 65 6d 20 63 |dent..Th|e {\em c|
|00001a90| 6f 6e 64 69 74 69 6f 6e | 7d 20 62 65 74 77 65 65 |ondition|} betwee|
|00001aa0| 6e 20 7b 5c 74 74 20 57 | 48 49 4c 45 7d 20 61 6e |n {\tt W|HILE} an|
|00001ab0| 64 20 7b 5c 74 74 20 52 | 45 50 7d 20 69 73 20 61 |d {\tt R|EP} is a|
|00001ac0| 20 75 6e 69 74 0d 0a 77 | 68 69 63 68 2c 20 75 70 | unit..w|hich, up|
|00001ad0| 6f 6e 20 65 76 61 6c 75 | 61 74 69 6f 6e 2c 20 79 |on evalu|ation, y|
|00001ae0| 69 65 6c 64 73 20 61 20 | 74 72 75 74 68 20 76 61 |ields a |truth va|
|00001af0| 6c 75 65 20 28 74 72 75 | 65 20 6f 72 20 66 61 6c |lue (tru|e or fal|
|00001b00| 73 65 29 2e 0d 0a 0d 0a | 54 68 65 20 70 61 72 61 |se).....|The para|
|00001b10| 67 72 61 70 68 20 62 65 | 74 77 65 65 6e 20 74 68 |graph be|tween th|
|00001b20| 65 20 6b 65 79 77 6f 72 | 64 73 20 7b 5c 74 74 20 |e keywor|ds {\tt |
|00001b30| 52 45 50 7d 20 61 6e 64 | 20 7b 5c 74 74 20 45 4e |REP} and| {\tt EN|
|00001b40| 44 52 45 50 7d 0d 0a 69 | 73 20 65 78 65 63 75 74 |DREP}..i|s execut|
|00001b50| 65 64 20 6f 6e 6c 79 20 | 69 66 20 74 68 65 20 63 |ed only |if the c|
|00001b60| 6f 6e 64 69 74 69 6f 6e | 20 79 69 65 6c 64 73 20 |ondition| yields |
|00001b70| 74 72 75 65 2e 20 41 66 | 74 65 72 20 74 68 65 20 |true. Af|ter the |
|00001b80| 65 78 65 63 75 74 69 6f | 6e 0d 0a 6f 66 20 74 68 |executio|n..of th|
|00001b90| 65 20 70 61 72 61 67 72 | 61 70 68 20 28 74 68 65 |e paragr|aph (the|
|00001ba0| 20 60 60 6c 6f 6f 70 2d | 62 6f 64 79 27 27 29 20 | ``loop-|body'') |
|00001bb0| 74 68 65 20 63 6f 6e 64 | 69 74 69 6f 6e 20 69 73 |the cond|ition is|
|00001bc0| 20 65 76 61 6c 75 61 74 | 65 64 0d 0a 61 67 61 69 | evaluat|ed..agai|
|00001bd0| 6e 2c 20 61 6e 64 20 61 | 63 63 6f 72 64 69 6e 67 |n, and a|ccording|
|00001be0| 6c 79 20 74 68 65 20 6c | 6f 6f 70 2d 62 6f 64 79 |ly the l|oop-body|
|00001bf0| 20 6d 61 79 20 62 65 20 | 65 78 65 63 75 74 65 64 | may be |executed|
|00001c00| 20 72 65 70 65 61 74 65 | 64 6c 79 2e 0d 0a 54 68 | repeate|dly...Th|
|00001c10| 65 20 65 78 65 63 75 74 | 69 6f 6e 20 65 6e 64 73 |e execut|ion ends|
|00001c20| 20 61 73 20 73 6f 6f 6e | 20 61 73 20 74 68 65 20 | as soon| as the |
|00001c30| 63 6f 6e 64 69 74 69 6f | 6e 20 75 70 6f 6e 20 65 |conditio|n upon e|
|00001c40| 76 61 6c 75 61 74 69 6f | 6e 20 79 69 65 6c 64 73 |valuatio|n yields|
|00001c50| 0d 0a 66 61 6c 73 65 2e | 20 46 6f 72 20 74 68 6f |..false.| For tho|
|00001c60| 73 65 20 77 68 6f 20 70 | 72 65 66 65 72 20 6d 6f |se who p|refer mo|
|00001c70| 72 65 20 72 65 61 64 61 | 62 6c 65 20 6b 65 79 77 |re reada|ble keyw|
|00001c80| 6f 72 64 73 2c 20 7b 5c | 74 74 20 52 45 50 7d 0d |ords, {\|tt REP}.|
|00001c90| 0a 6d 61 79 20 62 65 20 | 61 6c 73 6f 20 77 72 69 |.may be |also wri|
|00001ca0| 74 74 65 6e 20 61 73 20 | 7b 5c 74 74 20 52 45 50 |tten as |{\tt REP|
|00001cb0| 45 41 54 7d 2c 20 61 6e | 64 20 7b 5c 74 74 20 45 |EAT}, an|d {\tt E|
|00001cc0| 4e 44 52 45 50 7d 20 61 | 73 20 7b 5c 74 74 20 45 |NDREP} a|s {\tt E|
|00001cd0| 4e 44 52 45 50 45 41 54 | 7d 2e 0d 0a 0d 0a 5c 70 |NDREPEAT|}.....\p|
|00001ce0| 61 67 65 62 72 65 61 6b | 0d 0a 5c 62 65 67 69 6e |agebreak|..\begin|
|00001cf0| 7b 65 6c 61 6e 7d 0d 0a | 20 20 20 20 20 20 20 20 |{elan}..| |
|00001d00| 57 48 49 4c 45 0d 0a 20 | 20 20 20 20 20 20 20 20 |WHILE.. | |
|00001d10| 20 74 68 65 20 73 75 6e | 20 69 73 20 73 68 69 6e | the sun| is shin|
|00001d20| 69 6e 67 0d 0a 20 20 20 | 20 20 20 20 20 52 45 50 |ing.. | REP|
|00001d30| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 68 61 76 65 |.. | have|
|00001d40| 20 61 20 64 72 69 6e 6b | 20 3b 0d 0a 20 20 20 20 | a drink| ;.. |
|00001d50| 20 20 20 20 20 20 73 69 | 6e 67 20 61 6e 6f 74 68 | si|ng anoth|
|00001d60| 65 72 20 73 6f 6e 67 0d | 0a 20 20 20 20 20 20 20 |er song.|. |
|00001d70| 20 45 4e 44 52 45 50 0d | 0a 5c 65 6e 64 7b 65 6c | ENDREP.|.\end{el|
|00001d80| 61 6e 7d 0d 0a 0d 0a 5c | 6e 6f 69 6e 64 65 6e 74 |an}....\|noindent|
|00001d90| 0d 0a 49 6e 20 74 68 69 | 73 20 6b 69 6e 64 20 6f |..In thi|s kind o|
|00001da0| 66 20 72 65 70 65 74 69 | 74 69 6f 6e 20 61 20 74 |f repeti|tion a t|
|00001db0| 65 73 74 20 6f 66 20 61 | 70 70 6c 69 63 61 62 69 |est of a|pplicabi|
|00001dc0| 6c 69 74 79 20 69 73 20 | 70 65 72 66 6f 72 6d 65 |lity is |performe|
|00001dd0| 64 0d 0a 62 65 66 6f 72 | 65 20 65 61 63 68 20 63 |d..befor|e each c|
|00001de0| 79 63 6c 65 20 28 60 60 | 70 72 65 2d 63 68 65 63 |ycle (``|pre-chec|
|00001df0| 6b 65 64 2d 6c 6f 6f 70 | 27 27 29 2e 20 49 66 20 |ked-loop|''). If |
|00001e00| 69 6e 20 74 68 69 73 20 | 65 78 61 6d 70 6c 65 0d |in this |example.|
|00001e10| 0a 69 74 20 69 73 20 72 | 61 69 6e 79 2c 20 74 68 |.it is r|ainy, th|
|00001e20| 65 20 6c 6f 6f 70 2d 62 | 6f 64 79 20 69 73 20 6e |e loop-b|ody is n|
|00001e30| 65 76 65 72 20 65 78 65 | 63 75 74 65 64 2c 20 61 |ever exe|cuted, a|
|00001e40| 6e 64 20 79 6f 75 20 68 | 61 76 65 20 74 6f 0d 0a |nd you h|ave to..|
|00001e50| 73 74 61 79 20 73 6f 62 | 65 72 2e 0d 0a 0d 0a 46 |stay sob|er.....F|
|00001e60| 6f 72 20 63 61 73 65 73 | 20 77 68 65 72 65 20 74 |or cases| where t|
|00001e70| 68 65 72 65 20 69 73 20 | 61 6c 77 61 79 73 20 73 |here is |always s|
|00001e80| 6f 6d 65 74 68 69 6e 67 | 20 74 6f 20 62 65 20 64 |omething| to be d|
|00001e90| 6f 6e 65 20 66 69 72 73 | 74 2c 20 61 6e 64 0d 0a |one firs|t, and..|
|00001ea0| 63 68 65 63 6b 65 64 20 | 66 6f 72 20 72 65 70 65 |checked |for repe|
|00001eb0| 74 69 74 69 6f 6e 20 61 | 66 74 65 72 77 61 72 64 |tition a|fterward|
|00001ec0| 73 20 28 60 60 70 6f 73 | 74 2d 63 68 65 63 6b 65 |s (``pos|t-checke|
|00001ed0| 64 2d 6c 6f 6f 70 27 27 | 29 20 45 6c 61 6e 0d 0a |d-loop''|) Elan..|
|00001ee0| 68 61 73 20 74 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |has the |followin|
|00001ef0| 67 20 63 6f 6d 70 6c 65 | 6d 65 6e 74 61 72 79 20 |g comple|mentary |
|00001f00| 72 65 70 65 74 69 74 69 | 76 65 20 63 6f 6e 73 74 |repetiti|ve const|
|00001f10| 72 75 63 74 3a 0d 0a 0d | 0a 5c 62 65 67 69 6e 7b |ruct:...|.\begin{|
|00001f20| 65 6c 61 6e 7d 0d 0a 20 | 20 20 20 20 20 20 20 52 |elan}.. | R|
|00001f30| 45 50 0d 0a 20 20 20 20 | 20 20 20 20 20 20 64 72 |EP.. | dr|
|00001f40| 69 6e 6b 20 61 20 67 6c | 61 73 73 20 6f 66 20 74 |ink a gl|ass of t|
|00001f50| 65 61 20 77 69 74 68 20 | 72 75 6d 20 3b 0d 0a 20 |ea with |rum ;.. |
|00001f60| 20 20 20 20 20 20 20 20 | 20 73 69 6e 67 20 61 20 | | sing a |
|00001f70| 63 68 72 69 73 74 6d 61 | 73 20 63 61 72 6f 6c 0d |christma|s carol.|
|00001f80| 0a 20 20 20 20 20 20 20 | 20 55 4e 54 49 4c 0d 0a |. | UNTIL..|
|00001f90| 20 20 20 20 20 20 20 20 | 20 20 69 74 20 73 74 6f | | it sto|
|00001fa0| 70 73 20 73 6e 6f 77 69 | 6e 67 0d 0a 20 20 20 20 |ps snowi|ng.. |
|00001fb0| 20 20 20 20 45 4e 44 52 | 45 50 0d 0a 5c 65 6e 64 | ENDR|EP..\end|
|00001fc0| 7b 65 6c 61 6e 7d 0d 0a | 0d 0a 5c 6e 6f 69 6e 64 |{elan}..|..\noind|
|00001fd0| 65 6e 74 0d 0a 49 6e 20 | 74 68 69 73 20 63 61 73 |ent..In |this cas|
|00001fe0| 65 20 74 68 65 20 63 6f | 6e 64 69 74 69 6f 6e 20 |e the co|ndition |
|00001ff0| 77 68 69 63 68 20 73 74 | 61 6e 64 73 20 62 65 74 |which st|ands bet|
|00002000| 77 65 65 6e 20 7b 5c 74 | 74 20 55 4e 54 49 4c 7d |ween {\t|t UNTIL}|
|00002010| 20 61 6e 64 0d 0a 7b 5c | 74 74 20 45 4e 44 52 45 | and..{\|tt ENDRE|
|00002020| 50 7d 20 69 73 20 65 78 | 65 63 75 74 65 64 20 61 |P} is ex|ecuted a|
|00002030| 66 74 65 72 20 65 61 63 | 68 20 65 78 65 63 75 74 |fter eac|h execut|
|00002040| 69 6f 6e 20 6f 66 20 74 | 68 65 20 66 69 72 73 74 |ion of t|he first|
|00002050| 20 70 61 72 61 67 72 61 | 70 68 2c 0d 0a 74 68 65 | paragra|ph,..the|
|00002060| 20 72 65 70 65 74 69 74 | 69 6f 6e 20 63 6f 6e 74 | repetit|ion cont|
|00002070| 69 6e 75 65 73 20 69 66 | 20 74 68 65 20 63 6f 6e |inues if| the con|
|00002080| 64 69 74 69 6f 6e 20 79 | 69 65 6c 64 73 20 66 61 |dition y|ields fa|
|00002090| 6c 73 65 20 61 6e 64 20 | 73 74 6f 70 73 0d 0a 69 |lse and |stops..i|
|000020a0| 66 20 74 68 65 20 63 6f | 6e 64 69 74 69 6f 6e 20 |f the co|ndition |
|000020b0| 79 69 65 6c 64 73 20 74 | 72 75 65 2e 0d 0a 0d 0a |yields t|rue.....|
|000020c0| 46 6f 72 20 63 61 73 65 | 73 20 77 68 65 72 65 20 |For case|s where |
|000020d0| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 72 65 |the numb|er of re|
|000020e0| 70 65 74 69 74 69 6f 6e | 73 20 69 73 20 6b 6e 6f |petition|s is kno|
|000020f0| 77 6e 20 69 6e 20 61 64 | 76 61 6e 63 65 2c 0d 0a |wn in ad|vance,..|
|00002100| 45 6c 61 6e 20 6f 66 66 | 65 72 73 20 61 20 60 60 |Elan off|ers a ``|
|00002110| 63 6f 75 6e 74 69 6e 67 | 2d 6c 6f 6f 70 27 27 2c |counting|-loop'',|
|00002120| 20 61 6c 73 6f 20 63 61 | 6c 6c 65 64 20 66 6f 72 | also ca|lled for|
|00002130| 2d 6c 6f 6f 70 2e 0d 0a | 0d 0a 5c 62 65 67 69 6e |-loop...|..\begin|
|00002140| 7b 65 6c 61 6e 7d 0d 0a | 20 20 20 20 20 20 20 20 |{elan}..| |
|00002150| 46 4f 52 20 69 20 46 52 | 4f 4d 20 6d 69 6e 20 55 |FOR i FR|OM min U|
|00002160| 50 54 4f 20 6d 61 78 0d | 0a 20 20 20 20 20 20 20 |PTO max.|. |
|00002170| 20 52 45 50 0d 0a 20 20 | 20 20 20 20 20 20 20 20 | REP.. | |
|00002180| 74 61 6c 6c 79 20 69 20 | 74 68 20 65 6e 74 72 79 |tally i |th entry|
|00002190| 0d 0a 20 20 20 20 20 20 | 20 20 45 4e 44 52 45 50 |.. | ENDREP|
|000021a0| 0d 0a 5c 65 6e 64 7b 65 | 6c 61 6e 7d 0d 0a 0d 0a |..\end{e|lan}....|
|000021b0| 5c 6e 6f 69 6e 64 65 6e | 74 0d 0a 54 68 65 20 75 |\noinden|t..The u|
|000021c0| 6e 69 74 73 20 7b 5c 74 | 74 20 6d 69 6e 7d 20 61 |nits {\t|t min} a|
|000021d0| 6e 64 20 7b 5c 74 74 20 | 6d 61 78 7d 20 79 69 65 |nd {\tt |max} yie|
|000021e0| 6c 64 69 6e 67 20 69 6e | 74 65 67 65 72 73 20 61 |lding in|tegers a|
|000021f0| 72 65 20 65 76 61 6c 75 | 61 74 65 64 0d 0a 6f 6e |re evalu|ated..on|
|00002200| 63 65 20 61 74 20 74 68 | 65 20 62 65 67 69 6e 6e |ce at th|e beginn|
|00002210| 69 6e 67 20 6f 66 20 74 | 68 65 20 66 6f 72 2d 6c |ing of t|he for-l|
|00002220| 6f 6f 70 2e 20 54 68 65 | 20 63 6f 6e 74 72 6f 6c |oop. The| control|
|00002230| 6c 65 64 20 69 6e 74 65 | 67 65 72 20 76 61 72 69 |led inte|ger vari|
|00002240| 61 62 6c 65 0d 0a 7b 5c | 74 74 20 69 7d 20 67 65 |able..{\|tt i} ge|
|00002250| 74 73 20 74 68 65 20 76 | 61 6c 75 65 20 6f 66 20 |ts the v|alue of |
|00002260| 7b 5c 74 74 20 6d 69 6e | 7d 2e 20 41 73 20 6c 6f |{\tt min|}. As lo|
|00002270| 6e 67 20 61 73 20 7b 5c | 74 74 20 69 7d 20 69 73 |ng as {\|tt i} is|
|00002280| 20 6c 65 73 73 0d 0a 6f | 72 20 65 71 75 61 6c 20 | less..o|r equal |
|00002290| 74 6f 20 7b 5c 74 74 20 | 6d 61 78 7d 2c 20 74 68 |to {\tt |max}, th|
|000022a0| 65 20 6c 6f 6f 70 2d 62 | 6f 64 79 20 62 65 74 77 |e loop-b|ody betw|
|000022b0| 65 65 6e 20 7b 5c 74 74 | 20 52 45 50 7d 20 61 6e |een {\tt| REP} an|
|000022c0| 64 20 7b 5c 74 74 0d 0a | 45 4e 44 52 45 50 7d 20 |d {\tt..|ENDREP} |
|000022d0| 69 73 20 65 78 65 63 75 | 74 65 64 2c 20 66 6f 6c |is execu|ted, fol|
|000022e0| 6c 6f 77 65 64 20 62 79 | 20 61 6e 20 69 6e 63 72 |lowed by| an incr|
|000022f0| 65 6d 65 6e 74 20 6f 66 | 20 74 68 65 20 60 60 6c |ement of| the ``l|
|00002300| 6f 6f 70 2d 76 61 72 69 | 61 62 6c 65 27 27 0d 0a |oop-vari|able''..|
|00002310| 7b 5c 74 74 20 69 7d 20 | 62 79 20 6f 6e 65 2e 20 |{\tt i} |by one. |
|00002320| 57 69 74 68 69 6e 20 74 | 68 65 20 6c 6f 6f 70 2d |Within t|he loop-|
|00002330| 62 6f 64 79 20 7b 5c 74 | 74 20 69 7d 20 6d 61 79 |body {\t|t i} may|
|00002340| 20 62 65 20 75 73 65 64 | 2c 20 62 75 74 0d 0a 6e | be used|, but..n|
|00002350| 6f 74 20 61 73 73 69 67 | 6e 65 64 20 74 6f 2e 20 |ot assig|ned to. |
|00002360| 49 74 73 20 76 61 6c 75 | 65 20 69 73 20 75 6e 64 |Its valu|e is und|
|00002370| 65 66 69 6e 65 64 20 61 | 66 74 65 72 20 74 68 65 |efined a|fter the|
|00002380| 20 65 78 65 63 75 74 69 | 6f 6e 20 6f 66 0d 0a 74 | executi|on of..t|
|00002390| 68 65 20 66 6f 72 2d 6c | 6f 6f 70 2e 0d 0a 0d 0a |he for-l|oop.....|
|000023a0| 49 6e 20 63 61 73 65 20 | 79 6f 75 20 77 61 6e 74 |In case |you want|
|000023b0| 20 74 6f 20 63 6f 75 6e | 74 20 6e 6f 74 20 75 70 | to coun|t not up|
|000023c0| 77 61 72 64 73 2c 20 62 | 75 74 20 64 6f 77 6e 77 |wards, b|ut downw|
|000023d0| 61 72 64 73 20 66 72 6f | 6d 20 61 20 6c 61 72 67 |ards fro|m a larg|
|000023e0| 65 72 0d 0a 76 61 6c 75 | 65 20 74 6f 20 61 20 73 |er..valu|e to a s|
|000023f0| 6d 61 6c 6c 65 72 20 6f | 6e 65 2c 20 74 68 65 72 |maller o|ne, ther|
|00002400| 65 20 69 73 20 61 20 76 | 61 72 69 61 6e 74 20 6f |e is a v|ariant o|
|00002410| 66 20 74 68 65 20 63 6f | 75 6e 74 69 6e 67 2d 6c |f the co|unting-l|
|00002420| 6f 6f 70 3a 0d 0a 0d 0a | 5c 62 65 67 69 6e 7b 65 |oop:....|\begin{e|
|00002430| 6c 61 6e 7d 0d 0a 20 20 | 20 20 20 20 20 20 46 4f |lan}.. | FO|
|00002440| 52 20 6e 72 20 46 52 4f | 4d 20 73 74 6f 63 6b 20 |R nr FRO|M stock |
|00002450| 44 4f 57 4e 54 4f 20 6d | 69 6e 69 6d 75 6d 0d 0a |DOWNTO m|inimum..|
|00002460| 20 20 20 20 20 20 20 20 | 52 45 50 0d 0a 20 20 20 | |REP.. |
|00002470| 20 20 20 20 20 20 20 73 | 65 6c 6c 20 6f 6e 65 0d | s|ell one.|
|00002480| 0a 20 20 20 20 20 20 20 | 20 45 4e 44 52 45 50 0d |. | ENDREP.|
|00002490| 0a 5c 65 6e 64 7b 65 6c | 61 6e 7d 0d 0a 20 0d 0a |.\end{el|an}.. ..|
|000024a0| 5c 6e 6f 69 6e 64 65 6e | 74 0d 0a 49 6e 20 74 68 |\noinden|t..In th|
|000024b0| 69 73 20 76 61 72 69 61 | 6e 74 2c 20 7b 5c 74 74 |is varia|nt, {\tt|
|000024c0| 20 6e 72 7d 20 69 73 20 | 63 6f 75 6e 74 65 64 20 | nr} is |counted |
|000024d0| 64 6f 77 6e 20 66 72 6f | 6d 20 7b 5c 74 74 20 73 |down fro|m {\tt s|
|000024e0| 74 6f 63 6b 7d 20 74 6f | 0d 0a 7b 5c 74 74 20 6d |tock} to|..{\tt m|
|000024f0| 69 6e 69 6d 75 6d 7d 2e | 20 49 66 20 7b 5c 74 74 |inimum}.| If {\tt|
|00002500| 20 73 74 6f 63 6b 7d 20 | 77 61 73 20 61 6c 72 65 | stock} |was alre|
|00002510| 61 64 79 20 62 65 6c 6f | 77 20 7b 5c 74 74 20 6d |ady belo|w {\tt m|
|00002520| 69 6e 69 6d 75 6d 7d 2c | 0d 0a 74 68 65 6e 20 74 |inimum},|..then t|
|00002530| 68 65 20 6c 6f 6f 70 2d | 62 6f 64 79 20 69 73 20 |he loop-|body is |
|00002540| 6e 6f 74 20 65 78 65 63 | 75 74 65 64 2e 0d 0a 0d |not exec|uted....|
|00002550| 0a 49 6e 20 63 61 73 65 | 20 74 68 65 20 76 61 6c |.In case| the val|
|00002560| 75 65 20 6f 66 20 74 68 | 65 20 66 72 6f 6d 2d 70 |ue of th|e from-p|
|00002570| 61 72 74 20 69 73 20 6f | 6e 65 20 61 6e 64 20 74 |art is o|ne and t|
|00002580| 68 65 20 63 6f 6e 74 72 | 6f 6c 6c 65 64 0d 0a 76 |he contr|olled..v|
|00002590| 61 72 69 61 62 6c 65 20 | 69 73 20 6f 66 20 6e 6f |ariable |is of no|
|000025a0| 20 69 6e 74 65 72 65 73 | 74 2c 20 74 68 65 20 66 | interes|t, the f|
|000025b0| 6f 72 2d 20 61 6e 64 20 | 66 72 6f 6d 2d 70 61 72 |or- and |from-par|
|000025c0| 74 73 20 6d 61 79 20 62 | 65 20 6c 65 66 74 0d 0a |ts may b|e left..|
|000025d0| 6f 75 74 2c 20 6c 65 61 | 64 69 6e 67 20 74 6f 20 |out, lea|ding to |
|000025e0| 74 68 65 20 73 68 6f 72 | 74 65 72 20 66 6f 72 6d |the shor|ter form|
|000025f0| 0d 0a 0d 0a 5c 70 61 67 | 65 62 72 65 61 6b 0d 0a |....\pag|ebreak..|
|00002600| 5c 62 65 67 69 6e 7b 65 | 6c 61 6e 7d 0d 0a 20 20 |\begin{e|lan}.. |
|00002610| 20 20 20 20 20 20 55 50 | 54 4f 20 32 30 0d 0a 20 | UP|TO 20.. |
|00002620| 20 20 20 20 20 20 20 52 | 45 50 0d 0a 20 20 20 20 | R|EP.. |
|00002630| 20 20 20 20 20 20 68 69 | 74 20 68 69 6d 20 6f 76 | hi|t him ov|
|00002640| 65 72 20 74 68 65 20 68 | 65 61 64 20 3b 0d 0a 20 |er the h|ead ;.. |
|00002650| 20 20 20 20 20 20 20 20 | 20 70 69 63 6b 20 68 69 | | pick hi|
|00002660| 6d 20 75 70 0d 0a 20 20 | 20 20 20 20 20 20 45 4e |m up.. | EN|
|00002670| 44 52 45 50 0d 0a 5c 65 | 6e 64 7b 65 6c 61 6e 7d |DREP..\e|nd{elan}|
|00002680| 0d 0a 0d 0a 5c 6e 6f 69 | 6e 64 65 6e 74 0d 0a 41 |....\noi|ndent..A|
|00002690| 20 6c 61 74 65 72 20 73 | 65 63 74 69 6f 6e 20 77 | later s|ection w|
|000026a0| 69 6c 6c 20 64 65 6d 6f | 6e 73 74 72 61 74 65 20 |ill demo|nstrate |
|000026b0| 74 68 65 20 75 73 65 20 | 6f 66 20 74 68 65 20 63 |the use |of the c|
|000026c0| 6f 75 6e 74 69 6e 67 2d | 6c 6f 6f 70 0d 0a 69 6e |ounting-|loop..in|
|000026d0| 20 70 72 6f 63 65 73 73 | 69 6e 67 20 72 6f 77 73 | process|ing rows|
|000026e0| 20 6f 66 20 64 61 74 61 | 20 65 6c 65 6d 65 6e 74 | of data| element|
|000026f0| 73 2e 0d 0a 0d 0a 5c 73 | 75 62 73 75 62 73 65 63 |s.....\s|ubsubsec|
|00002700| 74 69 6f 6e 7b 43 68 6f | 69 63 65 7d 0d 0a 0d 0a |tion{Cho|ice}....|
|00002710| 43 68 6f 6f 73 69 6e 67 | 20 62 65 74 77 65 65 6e |Choosing| between|
|00002720| 20 74 77 6f 20 61 6c 74 | 65 72 6e 61 74 69 76 65 | two alt|ernative|
|00002730| 73 20 64 65 70 65 6e 64 | 69 6e 67 20 6f 6e 20 61 |s depend|ing on a|
|00002740| 20 63 6f 6e 64 69 74 69 | 6f 6e 20 69 73 0d 0a 77 | conditi|on is..w|
|00002750| 72 69 74 74 65 6e 20 69 | 6e 20 45 6c 61 6e 20 61 |ritten i|n Elan a|
|00002760| 73 3a 0d 0a 0d 0a 5c 62 | 65 67 69 6e 7b 65 6c 61 |s:....\b|egin{ela|
|00002770| 6e 7d 0d 0a 20 20 20 20 | 20 20 20 20 49 46 20 63 |n}.. | IF c|
|00002780| 6f 6e 64 69 74 69 6f 6e | 0d 0a 20 20 20 20 20 20 |ondition|.. |
|00002790| 20 20 54 48 45 4e 0d 0a | 20 20 20 20 20 20 20 20 | THEN..| |
|000027a0| 20 20 70 61 72 74 20 66 | 6f 72 20 63 6f 6e 64 69 | part f|or condi|
|000027b0| 74 69 6f 6e 20 74 72 75 | 65 0d 0a 20 20 20 20 20 |tion tru|e.. |
|000027c0| 20 20 20 45 4c 53 45 0d | 0a 20 20 20 20 20 20 20 | ELSE.|. |
|000027d0| 20 20 20 70 61 72 74 20 | 66 6f 72 20 63 6f 6e 64 | part |for cond|
|000027e0| 69 74 69 6f 6e 20 66 61 | 6c 73 65 0d 0a 20 20 20 |ition fa|lse.. |
|000027f0| 20 20 20 20 20 46 49 0d | 0a 5c 65 6e 64 7b 65 6c | FI.|.\end{el|
|00002800| 61 6e 7d 0d 0a 0d 0a 5c | 6e 6f 69 6e 64 65 6e 74 |an}....\|noindent|
|00002810| 0d 0a 49 66 20 74 68 65 | 20 63 6f 6e 64 69 74 69 |..If the| conditi|
|00002820| 6f 6e 20 65 76 61 6c 75 | 61 74 65 73 20 74 6f 20 |on evalu|ates to |
|00002830| 74 72 75 65 2c 20 74 68 | 65 6e 20 74 68 65 20 70 |true, th|en the p|
|00002840| 61 72 61 67 72 61 70 68 | 0d 0a 62 65 74 77 65 65 |aragraph|..betwee|
|00002850| 6e 20 7b 5c 74 74 20 54 | 48 45 4e 7d 20 61 6e 64 |n {\tt T|HEN} and|
|00002860| 20 7b 5c 74 74 20 45 4c | 53 45 7d 20 28 74 68 65 | {\tt EL|SE} (the|
|00002870| 20 60 60 74 68 65 6e 2d | 70 61 72 74 27 27 29 20 | ``then-|part'') |
|00002880| 69 73 20 65 78 65 63 75 | 74 65 64 2c 0d 0a 61 6e |is execu|ted,..an|
|00002890| 64 20 74 68 65 20 72 65 | 73 74 20 75 70 20 74 6f |d the re|st up to|
|000028a0| 20 74 68 65 20 7b 5c 74 | 74 20 46 49 7d 20 73 6b | the {\t|t FI} sk|
|000028b0| 69 70 70 65 64 2e 20 49 | 6e 20 74 68 65 20 63 6f |ipped. I|n the co|
|000028c0| 6e 74 72 61 72 79 20 63 | 61 73 65 2c 0d 0a 74 68 |ntrary c|ase,..th|
|000028d0| 65 20 74 68 65 6e 2d 70 | 61 72 74 20 69 73 20 73 |e then-p|art is s|
|000028e0| 6b 69 70 70 65 64 2c 20 | 61 6e 64 20 74 68 65 20 |kipped, |and the |
|000028f0| 70 61 72 61 67 72 61 70 | 68 20 62 65 74 77 65 65 |paragrap|h betwee|
|00002900| 6e 20 7b 5c 74 74 20 45 | 4c 53 45 7d 0d 0a 61 6e |n {\tt E|LSE}..an|
|00002910| 64 20 7b 5c 74 74 20 46 | 49 7d 20 69 73 20 65 78 |d {\tt F|I} is ex|
|00002920| 65 63 75 74 65 64 20 28 | 74 68 65 20 60 60 65 6c |ecuted (|the ``el|
|00002930| 73 65 2d 70 61 72 74 27 | 27 29 2e 0d 0a 54 68 65 |se-part'|')...The|
|00002940| 20 6b 65 79 77 6f 72 64 | 20 7b 5c 74 74 20 46 49 | keyword| {\tt FI|
|00002950| 7d 20 6d 61 79 20 61 6c | 73 6f 20 62 65 20 73 70 |} may al|so be sp|
|00002960| 65 6c 6c 65 64 20 61 73 | 20 7b 5c 74 74 20 45 4e |elled as| {\tt EN|
|00002970| 44 49 46 7d 2e 0d 0a 0d | 0a 54 68 69 73 20 70 72 |DIF}....|.This pr|
|00002980| 69 6d 61 72 79 20 66 6f | 72 6d 20 6f 66 20 63 68 |imary fo|rm of ch|
|00002990| 6f 69 63 65 20 68 61 73 | 20 74 77 6f 20 76 61 72 |oice has| two var|
|000029a0| 69 61 74 69 6f 6e 73 20 | 66 6f 72 20 63 6f 6d 6d |iations |for comm|
|000029b0| 6f 6e 20 6e 65 65 64 73 | 2e 0d 0a 49 66 20 74 68 |on needs|...If th|
|000029c0| 65 72 65 20 69 73 20 6e | 6f 74 68 69 6e 67 20 74 |ere is n|othing t|
|000029d0| 6f 20 64 6f 20 69 6e 20 | 74 68 65 20 65 6c 73 65 |o do in |the else|
|000029e0| 2d 70 61 72 74 2c 20 74 | 68 65 6e 20 74 68 65 20 |-part, t|hen the |
|000029f0| 63 68 6f 69 63 65 20 63 | 61 6e 0d 0a 62 65 20 73 |choice c|an..be s|
|00002a00| 69 6d 70 6c 69 66 69 65 | 64 20 62 79 20 6c 65 61 |implifie|d by lea|
|00002a10| 76 69 6e 67 20 6f 75 74 | 20 74 68 65 20 65 6c 73 |ving out| the els|
|00002a20| 65 2d 70 61 72 74 3a 0d | 0a 0d 0a 5c 62 65 67 69 |e-part:.|...\begi|
|00002a30| 6e 7b 65 6c 61 6e 7d 0d | 0a 20 20 20 20 20 20 20 |n{elan}.|. |
|00002a40| 20 49 46 20 69 74 20 6c | 6f 6f 6b 73 20 6c 69 6b | IF it l|ooks lik|
|00002a50| 65 20 72 61 69 6e 0d 0a | 20 20 20 20 20 20 20 20 |e rain..| |
|00002a60| 54 48 45 4e 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |THEN.. | |
|00002a70| 74 61 6b 65 20 74 68 65 | 20 75 6d 62 72 65 6c 6c |take the| umbrell|
|00002a80| 61 20 77 69 74 68 20 79 | 6f 75 0d 0a 20 20 20 20 |a with y|ou.. |
|00002a90| 20 20 20 20 46 49 0d 0a | 5c 65 6e 64 7b 65 6c 61 | FI..|\end{ela|
|00002aa0| 6e 7d 0d 0a 0d 0a 5c 6e | 6f 69 6e 64 65 6e 74 0d |n}....\n|oindent.|
|00002ab0| 0a 49 6e 20 63 61 73 65 | 20 74 68 65 20 77 65 61 |.In case| the wea|
|00002ac0| 74 68 65 72 20 69 73 20 | 66 69 6e 65 20 79 6f 75 |ther is |fine you|
|00002ad0| 20 64 6f 20 6e 6f 74 68 | 69 6e 67 20 28 7b 5c 74 | do noth|ing ({\t|
|00002ae0| 74 20 45 4c 53 45 20 64 | 6f 20 6e 6f 74 68 69 6e |t ELSE d|o nothin|
|00002af0| 67 7d 0d 0a 77 61 73 20 | 6f 6d 69 74 74 65 64 29 |g}..was |omitted)|
|00002b00| 2e 0d 0a 46 6f 72 20 64 | 65 63 69 73 69 6f 6e 20 |...For d|ecision |
|00002b10| 63 61 73 63 61 64 65 73 | 20 6c 69 6b 65 0d 0a 0d |cascades| like...|
|00002b20| 0a 5c 62 65 67 69 6e 7b | 65 6c 61 6e 7d 0d 0a 20 |.\begin{|elan}.. |
|00002b30| 20 20 20 20 20 20 20 49 | 46 20 63 6f 6e 64 69 74 | I|F condit|
|00002b40| 69 6f 6e 20 31 0d 0a 20 | 20 20 20 20 20 20 20 54 |ion 1.. | T|
|00002b50| 48 45 4e 0d 0a 20 20 20 | 20 20 20 20 20 20 20 61 |HEN.. | a|
|00002b60| 63 74 69 6f 6e 20 31 0d | 0a 20 20 20 20 20 20 20 |ction 1.|. |
|00002b70| 20 45 4c 53 45 0d 0a 20 | 20 20 20 20 20 20 20 20 | ELSE.. | |
|00002b80| 20 49 46 20 63 6f 6e 64 | 69 74 69 6f 6e 20 32 0d | IF cond|ition 2.|
|00002b90| 0a 20 20 20 20 20 20 20 | 20 20 20 54 48 45 4e 0d |. | THEN.|
|00002ba0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 61 63 74 |. | act|
|00002bb0| 69 6f 6e 20 32 0d 0a 20 | 20 20 20 20 20 20 20 20 |ion 2.. | |
|00002bc0| 20 45 4c 53 45 0d 0a 20 | 20 20 20 20 20 20 20 20 | ELSE.. | |
|00002bd0| 20 20 20 49 46 0d 0a 20 | 20 20 20 20 20 20 20 20 | IF.. | |
|00002be0| 20 20 20 20 20 2e 2e 2e | 0d 0a 20 20 20 20 20 20 | ...|.. |
|00002bf0| 20 20 20 20 20 20 46 49 | 0d 0a 20 20 20 20 20 20 | FI|.. |
|00002c00| 20 20 20 20 46 49 0d 0a | 20 20 20 20 20 20 20 20 | FI..| |
|00002c10| 46 49 0d 0a 5c 65 6e 64 | 7b 65 6c 61 6e 7d 0d 0a |FI..\end|{elan}..|
|00002c20| 0d 0a 5c 6e 6f 69 6e 64 | 65 6e 74 0d 0a 45 6c 61 |..\noind|ent..Ela|
|00002c30| 6e 20 6f 66 66 65 72 73 | 20 61 6e 6f 74 68 65 72 |n offers| another|
|00002c40| 20 76 61 72 69 61 6e 74 | 20 6f 66 20 74 68 65 20 | variant| of the |
|00002c50| 63 68 6f 69 63 65 20 63 | 6f 6e 73 74 72 75 63 74 |choice c|onstruct|
|00002c60| 69 6f 6e 3a 0d 0a 0d 0a | 5c 62 65 67 69 6e 7b 65 |ion:....|\begin{e|
|00002c70| 6c 61 6e 7d 0d 0a 20 20 | 20 20 20 20 20 20 49 46 |lan}.. | IF|
|00002c80| 20 63 6f 6e 64 69 74 69 | 6f 6e 20 31 0d 0a 20 20 | conditi|on 1.. |
|00002c90| 20 20 20 20 20 20 54 48 | 45 4e 0d 0a 20 20 20 20 | TH|EN.. |
|00002ca0| 20 20 20 20 20 20 61 63 | 74 69 6f 6e 20 31 0d 0a | ac|tion 1..|
|00002cb0| 20 20 20 20 20 20 20 20 | 45 4c 49 46 20 63 6f 6e | |ELIF con|
|00002cc0| 64 69 74 69 6f 6e 20 32 | 0d 0a 20 20 20 20 20 20 |dition 2|.. |
|00002cd0| 20 20 54 48 45 4e 0d 0a | 20 20 20 20 20 20 20 20 | THEN..| |
|00002ce0| 20 20 61 63 74 69 6f 6e | 20 32 0d 0a 20 20 20 20 | action| 2.. |
|00002cf0| 20 20 20 20 45 4c 49 46 | 0d 0a 20 20 20 20 20 20 | ELIF|.. |
|00002d00| 20 20 20 20 2e 2e 2e 0d | 0a 20 20 20 20 20 20 20 | ....|. |
|00002d10| 20 45 4c 53 45 0d 0a 20 | 20 20 20 20 20 20 20 20 | ELSE.. | |
|00002d20| 20 61 63 74 69 6f 6e 20 | 66 6f 72 20 61 6c 6c 20 | action |for all |
|00002d30| 63 6f 6e 64 69 74 69 6f | 6e 73 20 61 62 6f 76 65 |conditio|ns above|
|00002d40| 20 66 61 69 6c 69 6e 67 | 0d 0a 20 20 20 20 20 20 | failing|.. |
|00002d50| 20 20 46 49 0d 0a 5c 65 | 6e 64 7b 65 6c 61 6e 7d | FI..\e|nd{elan}|
|00002d60| 0d 0a 0d 0a 5c 6e 6f 69 | 6e 64 65 6e 74 0d 0a 41 |....\noi|ndent..A|
|00002d70| 6c 73 6f 20 69 6e 20 74 | 68 69 73 20 63 61 73 65 |lso in t|his case|
|00002d80| 2c 20 61 6e 20 65 6d 70 | 74 79 20 65 6c 73 65 2d |, an emp|ty else-|
|00002d90| 70 61 72 74 20 6d 61 79 | 20 62 65 20 6f 6d 69 74 |part may| be omit|
|00002da0| 74 65 64 2e 0d 0a 0d 0a | 5c 73 75 62 73 75 62 73 |ted.....|\subsubs|
|00002db0| 65 63 74 69 6f 6e 7b 43 | 6f 6e 74 72 6f 6c 20 73 |ection{C|ontrol s|
|00002dc0| 74 72 75 63 74 75 72 65 | 73 20 79 69 65 6c 64 69 |tructure|s yieldi|
|00002dd0| 6e 67 20 61 20 76 61 6c | 75 65 7d 0d 0a 0d 0a 54 |ng a val|ue}....T|
|00002de0| 68 65 20 65 78 65 63 75 | 74 69 6f 6e 20 6f 66 20 |he execu|tion of |
|00002df0| 61 20 70 61 72 61 67 72 | 61 70 68 20 6f 72 20 61 |a paragr|aph or a|
|00002e00| 20 63 68 6f 69 63 65 20 | 63 61 6e 20 61 6c 73 6f | choice |can also|
|00002e10| 20 7b 5c 65 6d 20 79 69 | 65 6c 64 7d 0d 0a 61 20 | {\em yi|eld}..a |
|00002e20| 76 61 6c 75 65 2c 20 6e | 61 6d 65 6c 79 20 74 68 |value, n|amely th|
|00002e30| 61 74 20 6f 66 20 74 68 | 65 20 6c 61 73 74 20 75 |at of th|e last u|
|00002e40| 6e 69 74 20 65 78 65 63 | 75 74 65 64 2e 20 54 68 |nit exec|uted. Th|
|00002e50| 65 20 70 61 72 61 67 72 | 61 70 68 0d 0a 0d 0a 5c |e paragr|aph....\|
|00002e60| 62 65 67 69 6e 7b 65 6c | 61 6e 7d 0d 0a 20 20 20 |begin{el|an}.. |
|00002e70| 20 20 20 20 20 63 6f 6d | 70 75 74 65 20 73 75 6d | com|pute sum|
|00002e80| 20 6f 66 20 69 6e 74 65 | 67 65 72 73 20 31 20 74 | of inte|gers 1 t|
|00002e90| 6f 20 31 30 20 3b 0d 0a | 20 20 20 20 20 20 20 20 |o 10 ;..| |
|00002ea0| 74 68 61 74 20 73 75 6d | 20 2b 20 31 0d 0a 5c 65 |that sum| + 1..\e|
|00002eb0| 6e 64 7b 65 6c 61 6e 7d | 0d 0a 0d 0a 5c 6e 6f 69 |nd{elan}|....\noi|
|00002ec0| 6e 64 65 6e 74 0d 0a 73 | 75 67 67 65 73 74 73 20 |ndent..s|uggests |
|00002ed0| 74 68 61 74 20 66 69 72 | 73 74 20 74 68 65 20 69 |that fir|st the i|
|00002ee0| 6e 74 65 67 65 72 73 20 | 31 2c 20 32 2c 20 2e 2e |ntegers |1, 2, ..|
|00002ef0| 2e 20 31 30 20 61 72 65 | 20 73 75 6d 6d 65 64 20 |. 10 are| summed |
|00002f00| 75 70 2c 0d 0a 72 65 73 | 75 6c 74 69 6e 67 20 69 |up,..res|ulting i|
|00002f10| 6e 20 61 20 76 61 6c 75 | 65 20 6f 66 20 35 35 2c |n a valu|e of 55,|
|00002f20| 20 61 6e 64 20 74 68 65 | 6e 20 74 68 65 20 76 61 | and the|n the va|
|00002f30| 6c 75 65 20 35 36 20 69 | 73 20 79 69 65 6c 64 65 |lue 56 i|s yielde|
|00002f40| 64 0d 0a 62 79 20 74 68 | 61 74 20 70 61 72 61 67 |d..by th|at parag|
|00002f50| 72 61 70 68 2e 20 49 66 | 20 74 68 65 20 6c 61 73 |raph. If| the las|
|00002f60| 74 20 75 6e 69 74 20 6f | 66 20 61 20 70 61 72 61 |t unit o|f a para|
|00002f70| 67 72 61 70 68 20 79 69 | 65 6c 64 73 20 61 20 76 |graph yi|elds a v|
|00002f80| 61 6c 75 65 2c 0d 0a 74 | 68 65 6e 20 74 68 65 20 |alue,..t|hen the |
|00002f90| 70 61 72 61 67 72 61 70 | 68 20 61 73 20 61 20 77 |paragrap|h as a w|
|00002fa0| 68 6f 6c 65 20 79 69 65 | 6c 64 73 20 74 68 61 74 |hole yie|lds that|
|00002fb0| 20 76 61 6c 75 65 2e 0d | 0a 0d 0a 49 6e 20 63 61 | value..|...In ca|
|00002fc0| 73 65 20 6f 66 20 61 20 | 63 68 6f 69 63 65 2c 20 |se of a |choice, |
|00002fd0| 74 68 65 20 76 61 6c 75 | 65 20 79 69 65 6c 64 65 |the valu|e yielde|
|00002fe0| 64 20 69 73 20 74 68 61 | 74 20 6f 66 20 74 68 65 |d is tha|t of the|
|00002ff0| 20 70 61 72 61 67 72 61 | 70 68 0d 0a 69 6e 20 74 | paragra|ph..in t|
|00003000| 68 65 20 74 68 65 6e 2d | 70 61 72 74 20 6f 72 20 |he then-|part or |
|00003010| 69 6e 20 74 68 65 20 65 | 6c 73 65 2d 70 61 72 74 |in the e|lse-part|
|00003020| 2c 20 64 65 70 65 6e 64 | 69 6e 67 20 6f 6e 20 74 |, depend|ing on t|
|00003030| 68 65 20 63 6f 6e 64 69 | 74 69 6f 6e 2e 0d 0a 54 |he condi|tion...T|
|00003040| 68 65 73 65 20 76 61 6c | 75 65 73 20 6d 75 73 74 |hese val|ues must|
|00003050| 20 68 61 76 65 20 74 68 | 65 20 73 61 6d 65 20 74 | have th|e same t|
|00003060| 79 70 65 2e 20 41 73 20 | 61 6e 20 65 78 61 6d 70 |ype. As |an examp|
|00003070| 6c 65 2c 20 74 68 65 20 | 75 6e 69 74 0d 0a 0d 0a |le, the |unit....|
|00003080| 5c 62 65 67 69 6e 7b 65 | 6c 61 6e 7d 0d 0a 20 20 |\begin{e|lan}.. |
|00003090| 20 20 20 20 20 20 49 46 | 20 61 20 3c 20 62 20 54 | IF| a < b T|
|000030a0| 48 45 4e 20 61 20 45 4c | 53 45 20 62 20 46 49 0d |HEN a EL|SE b FI.|
|000030b0| 0a 5c 65 6e 64 7b 65 6c | 61 6e 7d 0d 0a 0d 0a 5c |.\end{el|an}....\|
|000030c0| 6e 6f 69 6e 64 65 6e 74 | 0d 0a 79 69 65 6c 64 73 |noindent|..yields|
|000030d0| 20 74 68 65 20 73 6d 61 | 6c 6c 65 72 20 6f 66 20 | the sma|ller of |
|000030e0| 74 68 65 20 74 77 6f 20 | 69 6e 74 65 67 65 72 20 |the two |integer |
|000030f0| 76 61 6c 75 65 73 20 7b | 5c 74 74 20 61 7d 20 61 |values {|\tt a} a|
|00003100| 6e 64 20 7b 5c 74 74 20 | 62 7d 2e 0d 0a 52 65 70 |nd {\tt |b}...Rep|
|00003110| 65 74 69 74 69 6f 6e 73 | 20 63 61 6e 6e 6f 74 20 |etitions| cannot |
|00003120| 79 69 65 6c 64 20 61 20 | 76 61 6c 75 65 2e 0d 0a |yield a |value...|
|00003130| 0d 0a 5c 73 75 62 73 65 | 63 74 69 6f 6e 7b 52 65 |..\subse|ction{Re|
|00003140| 66 69 6e 65 6d 65 6e 74 | 7d 0d 0a 0d 0a 54 68 65 |finement|}....The|
|00003150| 20 6d 6f 73 74 20 73 74 | 72 69 6b 69 6e 67 20 63 | most st|riking c|
|00003160| 6f 6e 73 74 72 75 63 74 | 20 6f 66 20 45 6c 61 6e |onstruct| of Elan|
|00003170| 20 69 73 20 74 68 65 20 | 7b 5c 65 6d 20 72 65 66 | is the |{\em ref|
|00003180| 69 6e 65 6d 65 6e 74 7d | 2c 0d 0a 61 20 73 69 6d |inement}|,..a sim|
|00003190| 70 6c 65 20 6d 65 63 68 | 61 6e 69 73 6d 20 66 6f |ple mech|anism fo|
|000031a0| 72 20 64 65 66 69 6e 69 | 6e 67 20 61 62 73 74 72 |r defini|ng abstr|
|000031b0| 61 63 74 20 61 6c 67 6f | 72 69 74 68 6d 73 20 77 |act algo|rithms w|
|000031c0| 68 69 63 68 20 66 6f 72 | 6d 73 0d 0a 74 68 65 20 |hich for|ms..the |
|000031d0| 62 61 73 69 73 20 66 6f | 72 20 74 68 65 20 7b 5c |basis fo|r the {\|
|000031e0| 65 6d 20 54 6f 70 2d 44 | 6f 77 6e 7d 20 70 72 6f |em Top-D|own} pro|
|000031f0| 67 72 61 6d 6d 69 6e 67 | 20 73 74 79 6c 65 2c 20 |gramming| style, |
|00003200| 77 68 69 63 68 20 63 61 | 6e 20 62 65 20 73 75 6d |which ca|n be sum|
|00003210| 6d 61 72 69 7a 65 64 3a | 0d 0a 0d 0a 5c 62 65 67 |marized:|....\beg|
|00003220| 69 6e 7b 71 75 6f 74 65 | 7d 0d 0a 20 20 20 60 60 |in{quote|}.. ``|
|00003230| 41 20 70 72 6f 67 72 61 | 6d 20 69 73 20 64 65 76 |A progra|m is dev|
|00003240| 65 6c 6f 70 65 64 20 62 | 79 20 66 69 72 73 74 20 |eloped b|y first |
|00003250| 67 69 76 69 6e 67 20 61 | 20 72 6f 75 67 68 20 62 |giving a| rough b|
|00003260| 75 74 20 70 6f 74 65 6e | 74 69 61 6c 6c 79 0d 0a |ut poten|tially..|
|00003270| 20 20 20 63 6f 72 72 65 | 63 74 20 66 6f 72 6d 75 | corre|ct formu|
|00003280| 6c 61 74 69 6f 6e 20 63 | 6f 6d 70 6f 73 65 64 20 |lation c|omposed |
|00003290| 6f 66 20 61 62 73 74 72 | 61 63 74 20 65 6e 74 69 |of abstr|act enti|
|000032a0| 74 69 65 73 2e 20 54 68 | 65 72 65 75 70 6f 6e 0d |ties. Th|ereupon.|
|000032b0| 0a 20 20 20 65 61 63 68 | 20 6f 66 20 74 68 65 73 |. each| of thes|
|000032c0| 65 20 61 62 73 74 72 61 | 63 74 20 65 6e 74 69 74 |e abstra|ct entit|
|000032d0| 69 65 73 20 69 73 20 73 | 69 6d 69 6c 61 72 6c 79 |ies is s|imilarly|
|000032e0| 20 64 65 66 69 6e 65 64 | 2c 20 69 6e 20 74 65 72 | defined|, in ter|
|000032f0| 6d 73 0d 0a 20 20 20 6f | 66 20 6f 74 68 65 72 20 |ms.. o|f other |
|00003300| 61 62 73 74 72 61 63 74 | 20 61 6e 64 20 63 6f 6e |abstract| and con|
|00003310| 63 72 65 74 65 20 65 6e | 74 69 74 69 65 73 2c 20 |crete en|tities, |
|00003320| 75 6e 74 69 6c 20 61 74 | 20 6c 61 73 74 20 61 6c |until at| last al|
|00003330| 6c 0d 0a 20 20 20 6e 65 | 63 65 73 73 61 72 79 20 |l.. ne|cessary |
|00003340| 61 62 73 74 72 61 63 74 | 20 65 6e 74 69 74 69 65 |abstract| entitie|
|00003350| 73 20 68 61 76 65 20 61 | 20 73 75 69 74 61 62 6c |s have a| suitabl|
|00003360| 65 20 64 65 66 69 6e 69 | 74 69 6f 6e 2e 27 27 0d |e defini|tion.''.|
|00003370| 0a 5c 65 6e 64 7b 71 75 | 6f 74 65 7d 0d 0a 0d 0a |.\end{qu|ote}....|
|00003380| 5c 6e 6f 69 6e 64 65 6e | 74 0d 0a 41 20 72 65 66 |\noinden|t..A ref|
|00003390| 69 6e 65 6d 65 6e 74 20 | 67 69 76 65 73 20 61 20 |inement |gives a |
|000033a0| 6e 61 6d 65 20 74 6f 20 | 61 20 70 61 72 61 67 72 |name to |a paragr|
|000033b0| 61 70 68 2c 20 61 6e 64 | 20 6c 6f 6f 6b 73 20 6c |aph, and| looks l|
|000033c0| 69 6b 65 0d 0a 0d 0a 5c | 62 65 67 69 6e 7b 65 6c |ike....\|begin{el|
|000033d0| 61 6e 7d 0d 0a 20 20 20 | 20 20 20 20 20 6e 61 6d |an}.. | nam|
|000033e0| 65 3a 20 70 61 72 61 67 | 72 61 70 68 2e 0d 0a 5c |e: parag|raph...\|
|000033f0| 65 6e 64 7b 65 6c 61 6e | 7d 0d 0a 0d 0a 5c 6e 6f |end{elan|}....\no|
|00003400| 69 6e 64 65 6e 74 0d 0a | 45 78 65 63 75 74 69 6e |indent..|Executin|
|00003410| 67 20 74 68 65 20 6e 61 | 6d 65 20 6f 66 20 61 20 |g the na|me of a |
|00003420| 72 65 66 69 6e 65 6d 65 | 6e 74 20 6d 65 61 6e 73 |refineme|nt means|
|00003430| 20 65 78 65 63 75 74 69 | 6e 67 20 69 74 73 20 63 | executi|ng its c|
|00003440| 6f 6e 73 74 69 74 75 65 | 6e 74 0d 0a 70 61 72 61 |onstitue|nt..para|
|00003450| 67 72 61 70 68 20 28 69 | 74 73 20 7b 5c 65 6d 20 |graph (i|ts {\em |
|00003460| 62 6f 64 79 7d 29 2e 20 | 54 68 65 20 76 61 6c 75 |body}). |The valu|
|00003470| 65 20 6f 66 20 74 68 65 | 20 72 65 66 69 6e 65 6d |e of the| refinem|
|00003480| 65 6e 74 20 69 73 20 74 | 68 65 0d 0a 76 61 6c 75 |ent is t|he..valu|
|00003490| 65 20 6f 66 20 69 74 73 | 20 62 6f 64 79 2e 0d 0a |e of its| body...|
|000034a0| 0d 0a 49 6e 20 64 69 73 | 74 69 6e 63 74 69 6f 6e |..In dis|tinction|
|000034b0| 20 74 6f 20 70 72 6f 63 | 65 64 75 72 65 73 20 28 | to proc|edures (|
|000034c0| 77 68 69 63 68 20 63 6f | 75 6c 64 20 61 6c 73 6f |which co|uld also|
|000034d0| 20 69 6e 20 70 72 69 6e | 63 69 70 6c 65 20 62 65 | in prin|ciple be|
|000034e0| 0d 0a 75 73 65 64 20 61 | 73 20 72 65 66 69 6e 65 |..used a|s refine|
|000034f0| 6d 65 6e 74 73 29 20 72 | 65 66 69 6e 65 6d 65 6e |ments) r|efinemen|
|00003500| 74 73 20 6d 61 79 20 61 | 70 70 65 61 72 20 69 6e |ts may a|ppear in|
|00003510| 20 61 6e 79 20 6f 72 64 | 65 72 2c 20 61 6e 64 0d | any ord|er, and.|
|00003520| 0a 6d 61 79 20 69 6e 20 | 70 61 72 74 69 63 75 6c |.may in |particul|
|00003530| 61 72 20 61 70 70 65 61 | 72 20 61 66 74 65 72 20 |ar appea|r after |
|00003540| 61 6e 79 20 69 6e 76 6f | 63 61 74 69 6f 6e 20 6f |any invo|cation o|
|00003550| 66 20 74 68 65 20 72 65 | 66 69 6e 65 6d 65 6e 74 |f the re|finement|
|00003560| 2e 0d 0a 52 65 66 69 6e | 65 6d 65 6e 74 73 20 63 |...Refin|ements c|
|00003570| 61 6e 20 6e 6f 74 20 68 | 61 76 65 20 70 61 72 61 |an not h|ave para|
|00003580| 6d 65 74 65 72 73 2c 20 | 69 6e 20 6f 72 64 65 72 |meters, |in order|
|00003590| 20 74 6f 20 6b 65 65 70 | 20 74 68 65 20 60 60 76 | to keep| the ``v|
|000035a0| 69 73 75 61 6c 0d 0a 6f | 76 65 72 68 65 61 64 27 |isual..o|verhead'|
|000035b0| 27 20 69 6e 20 74 68 65 | 69 72 20 64 65 66 69 6e |' in the|ir defin|
|000035c0| 69 74 69 6f 6e 20 61 6e | 64 20 61 70 70 6c 69 63 |ition an|d applic|
|000035d0| 61 74 69 6f 6e 20 74 6f | 20 61 20 6d 69 6e 69 6d |ation to| a minim|
|000035e0| 75 6d 2e 0d 0a 41 20 72 | 65 66 69 6e 65 6d 65 6e |um...A r|efinemen|
|000035f0| 74 20 64 6f 65 73 20 6e | 6f 74 20 66 6f 72 6d 20 |t does n|ot form |
|00003600| 61 20 73 65 70 61 72 61 | 74 65 20 73 63 6f 70 65 |a separa|te scope|
|00003610| 20 6f 66 20 6e 61 6d 69 | 6e 67 2e 20 54 68 65 72 | of nami|ng. Ther|
|00003620| 65 66 6f 72 65 0d 0a 69 | 74 20 69 73 20 70 6f 73 |efore..i|t is pos|
|00003630| 73 69 62 6c 65 20 74 6f | 20 70 75 74 20 61 20 64 |sible to| put a d|
|00003640| 65 63 6c 61 72 61 74 69 | 6f 6e 20 69 6e 20 6f 6e |eclarati|on in on|
|00003650| 65 20 72 65 66 69 6e 65 | 6d 65 6e 74 20 61 6e 64 |e refine|ment and|
|00003660| 20 75 73 65 0d 0a 69 74 | 20 69 6e 20 61 6e 6f 74 | use..it| in anot|
|00003670| 68 65 72 2e 20 46 6f 72 | 20 74 68 65 73 65 20 72 |her. For| these r|
|00003680| 65 61 73 6f 6e 73 2c 20 | 72 65 66 69 6e 65 6d 65 |easons, |refineme|
|00003690| 6e 74 73 20 61 72 65 20 | 62 65 74 74 65 72 20 73 |nts are |better s|
|000036a0| 75 69 74 65 64 0d 0a 74 | 68 61 6e 20 70 72 6f 63 |uited..t|han proc|
|000036b0| 65 64 75 72 65 73 20 66 | 6f 72 20 63 61 70 74 75 |edures f|or captu|
|000036c0| 72 69 6e 67 20 74 68 65 | 20 60 60 66 6c 65 65 74 |ring the| ``fleet|
|000036d0| 69 6e 67 20 61 62 73 74 | 72 61 63 74 69 6f 6e 73 |ing abst|ractions|
|000036e0| 27 27 20 69 6e 0d 0a 70 | 72 6f 67 72 61 6d 6d 69 |'' in..p|rogrammi|
|000036f0| 6e 67 2e 0d 0a 0d 0a 49 | 6e 20 45 6c 61 6e 2d 30 |ng.....I|n Elan-0|
|00003700| 2c 20 61 20 70 72 6f 67 | 72 61 6d 20 63 6f 6e 73 |, a prog|ram cons|
|00003710| 69 73 74 73 20 6f 66 20 | 6f 6e 65 20 6f 72 20 6d |ists of |one or m|
|00003720| 6f 72 65 20 72 65 66 69 | 6e 65 6d 65 6e 74 73 2c |ore refi|nements,|
|00003730| 20 77 68 65 72 65 0d 0a | 74 68 65 20 66 69 72 73 | where..|the firs|
|00003740| 74 20 72 65 66 69 6e 65 | 6d 65 6e 74 20 69 73 20 |t refine|ment is |
|00003750| 74 68 65 20 7b 5c 65 6d | 20 72 6f 6f 74 7d 20 6f |the {\em| root} o|
|00003760| 66 20 74 68 65 20 70 72 | 6f 67 72 61 6d 2e 20 53 |f the pr|ogram. S|
|00003770| 75 63 68 20 70 72 6f 67 | 72 61 6d 73 0d 0a 63 6f |uch prog|rams..co|
|00003780| 72 72 65 73 70 6f 6e 64 | 20 74 6f 20 70 72 6f 63 |rrespond| to proc|
|00003790| 65 64 75 72 65 2d 62 6f | 64 69 65 73 20 69 6e 20 |edure-bo|dies in |
|000037a0| 66 75 6c 6c 20 45 6c 61 | 6e 2e 0d 0a 0d 0a 5c 73 |full Ela|n.....\s|
|000037b0| 75 62 73 65 63 74 69 6f | 6e 7b 4c 65 61 76 65 2d |ubsectio|n{Leave-|
|000037c0| 73 74 61 74 65 6d 65 6e | 74 7d 0d 0a 0d 0a 45 6c |statemen|t}....El|
|000037d0| 61 6e 20 68 61 73 20 61 | 20 73 70 65 63 69 61 6c |an has a| special|
|000037e0| 20 6d 65 63 68 61 6e 69 | 73 6d 20 66 6f 72 20 74 | mechani|sm for t|
|000037f0| 65 72 6d 69 6e 61 74 69 | 6e 67 20 74 68 65 20 65 |erminati|ng the e|
|00003800| 78 65 63 75 74 69 6f 6e | 20 6f 66 0d 0a 61 20 70 |xecution| of..a p|
|00003810| 61 72 74 69 63 75 6c 61 | 72 20 72 65 66 69 6e 65 |articula|r refine|
|00003820| 6d 65 6e 74 2c 20 77 68 | 69 63 68 20 6c 6f 6f 6b |ment, wh|ich look|
|00003830| 73 20 6c 69 6b 65 0d 0a | 0d 0a 5c 62 65 67 69 6e |s like..|..\begin|
|00003840| 7b 65 6c 61 6e 7d 0d 0a | 20 20 20 20 20 20 20 20 |{elan}..| |
|00003850| 4c 45 41 56 45 20 72 65 | 66 69 6e 65 6d 65 6e 74 |LEAVE re|finement|
|00003860| 20 6e 61 6d 65 0d 0a 5c | 65 6e 64 7b 65 6c 61 6e | name..\|end{elan|
|00003870| 7d 0d 0a 0d 0a 5c 6e 6f | 69 6e 64 65 6e 74 0d 0a |}....\no|indent..|
|00003880| 54 68 69 73 20 6d 65 63 | 68 61 6e 69 73 6d 20 63 |This mec|hanism c|
|00003890| 61 6e 20 69 6e 20 70 61 | 72 74 69 63 75 6c 61 72 |an in pa|rticular|
|000038a0| 20 62 65 20 75 73 65 64 | 20 74 6f 20 74 65 72 6d | be used| to term|
|000038b0| 69 6e 61 74 65 20 72 65 | 70 65 74 69 74 69 6f 6e |inate re|petition|
|000038c0| 73 0d 0a 66 72 6f 6d 20 | 74 68 65 20 69 6e 73 69 |s..from |the insi|
|000038d0| 64 65 2e 0d 0a 0d 0a 41 | 6c 74 68 6f 75 67 68 20 |de.....A|lthough |
|000038e0| 69 74 20 6c 6f 6f 6b 73 | 20 6d 75 63 68 20 6c 69 |it looks| much li|
|000038f0| 6b 65 20 74 68 65 20 69 | 6e 66 61 6d 6f 75 73 20 |ke the i|nfamous |
|00003900| 67 6f 74 6f 2d 73 74 61 | 74 65 6d 65 6e 74 2c 20 |goto-sta|tement, |
|00003910| 74 68 65 0d 0a 6c 65 61 | 76 65 2d 73 74 61 74 65 |the..lea|ve-state|
|00003920| 6d 65 6e 74 20 69 73 20 | 76 65 72 79 20 64 69 66 |ment is |very dif|
|00003930| 66 65 72 65 6e 74 3a 20 | 49 74 20 64 6f 65 73 20 |ferent: |It does |
|00003940| 6e 6f 74 20 61 6c 6c 6f | 77 20 61 72 62 69 74 72 |not allo|w arbitr|
|00003950| 61 72 79 0d 0a 63 6f 6e | 74 69 6e 75 61 74 69 6f |ary..con|tinuatio|
|00003960| 6e 20 6f 66 20 70 72 6f | 67 72 61 6d 20 65 78 65 |n of pro|gram exe|
|00003970| 63 75 74 69 6f 6e 20 61 | 74 20 73 6f 6d 65 20 6f |cution a|t some o|
|00003980| 74 68 65 72 20 70 61 72 | 74 20 6f 66 20 74 68 65 |ther par|t of the|
|00003990| 20 70 72 6f 67 72 61 6d | 0d 0a 77 69 74 68 20 61 | program|..with a|
|000039a0| 6c 6c 20 69 74 73 20 6b | 6e 6f 77 6e 20 64 61 6e |ll its k|nown dan|
|000039b0| 67 65 72 73 2c 20 62 75 | 74 20 63 6f 6d 70 6c 65 |gers, bu|t comple|
|000039c0| 74 65 73 20 74 68 65 20 | 65 78 65 63 75 74 69 6f |tes the |executio|
|000039d0| 6e 20 6f 66 20 61 6e 0d | 0a 61 6c 67 6f 72 69 74 |n of an.|.algorit|
|000039e0| 68 6d 2e 20 46 6f 72 20 | 74 68 69 73 20 72 65 61 |hm. For |this rea|
|000039f0| 73 6f 6e 2c 20 79 6f 75 | 20 6d 61 79 20 6e 61 6d |son, you| may nam|
|00003a00| 65 20 69 6e 20 61 20 6c | 65 61 76 65 2d 73 74 61 |e in a l|eave-sta|
|00003a10| 74 65 6d 65 6e 74 0d 0a | 6f 6e 6c 79 20 61 20 72 |tement..|only a r|
|00003a20| 65 66 69 6e 65 6d 65 6e | 74 20 6f 66 20 77 68 6f |efinemen|t of who|
|00003a30| 73 65 20 65 78 65 63 75 | 74 69 6f 6e 20 74 68 65 |se execu|tion the|
|00003a40| 20 65 78 65 63 75 74 69 | 6f 6e 20 6f 66 20 74 68 | executi|on of th|
|00003a50| 65 20 6c 65 61 76 65 2d | 73 74 61 74 65 6d 65 6e |e leave-|statemen|
|00003a60| 74 0d 0a 69 73 20 70 61 | 72 74 2e 0d 0a 49 74 20 |t..is pa|rt...It |
|00003a70| 69 73 20 65 76 65 6e 20 | 70 6f 73 73 69 62 6c 65 |is even |possible|
|00003a80| 20 74 6f 20 6c 65 61 76 | 65 20 61 20 72 65 66 69 | to leav|e a refi|
|00003a90| 6e 65 6d 65 6e 74 20 77 | 69 74 68 20 61 20 76 61 |nement w|ith a va|
|00003aa0| 6c 75 65 2c 20 62 79 0d | 0a 0d 0a 5c 62 65 67 69 |lue, by.|...\begi|
|00003ab0| 6e 7b 65 6c 61 6e 7d 0d | 0a 20 20 20 20 20 20 20 |n{elan}.|. |
|00003ac0| 20 4c 45 41 56 45 20 72 | 65 66 69 6e 65 6d 65 6e | LEAVE r|efinemen|
|00003ad0| 74 20 6e 61 6d 65 20 57 | 49 54 48 20 65 78 70 72 |t name W|ITH expr|
|00003ae0| 65 73 73 69 6f 6e 0d 0a | 5c 65 6e 64 7b 65 6c 61 |ession..|\end{ela|
|00003af0| 6e 7d 0d 0a 0d 0a 5c 6e | 6f 69 6e 64 65 6e 74 0d |n}....\n|oindent.|
|00003b00| 0a 54 68 69 73 20 63 61 | 75 73 65 73 20 74 68 65 |.This ca|uses the|
|00003b10| 20 72 65 66 69 6e 65 6d | 65 6e 74 20 77 69 74 68 | refinem|ent with|
|00003b20| 20 74 68 61 74 20 6e 61 | 6d 65 20 74 6f 20 62 65 | that na|me to be|
|00003b30| 20 6c 65 66 74 2c 20 79 | 69 65 6c 64 69 6e 67 0d | left, y|ielding.|
|00003b40| 0a 74 68 65 20 76 61 6c | 75 65 20 6f 66 20 74 68 |.the val|ue of th|
|00003b50| 65 20 65 78 70 72 65 73 | 73 69 6f 6e 2e 0d 0a 0d |e expres|sion....|
|00003b60| 0a 5c 73 65 63 74 69 6f | 6e 7b 54 68 65 20 6e 6f |.\sectio|n{The no|
|00003b70| 74 61 74 69 6f 6e 20 6f | 66 20 6f 62 6a 65 63 74 |tation o|f object|
|00003b80| 73 7d 0d 0a 0d 0a 41 6c | 67 6f 72 69 74 68 6d 73 |s}....Al|gorithms|
|00003b90| 20 74 6f 20 62 65 20 65 | 78 65 63 75 74 65 64 20 | to be e|xecuted |
|00003ba0| 6f 6e 20 61 20 63 6f 6d | 70 75 74 65 72 20 64 6f |on a com|puter do|
|00003bb0| 20 6e 6f 74 20 77 6f 72 | 6b 20 6f 6e 20 74 68 69 | not wor|k on thi|
|00003bc0| 6e 0d 0a 61 69 72 2c 20 | 62 75 74 20 6e 65 65 64 |n..air, |but need|
|00003bd0| 20 6f 62 6a 65 63 74 73 | 20 74 6f 20 6f 70 65 72 | objects| to oper|
|00003be0| 61 74 65 20 6f 6e 2e 20 | 49 6e 20 74 68 69 73 20 |ate on. |In this |
|00003bf0| 63 68 61 70 74 65 72 20 | 77 65 20 64 65 73 63 72 |chapter |we descr|
|00003c00| 69 62 65 0d 0a 77 68 61 | 74 20 6b 69 6e 64 73 20 |ibe..wha|t kinds |
|00003c10| 6f 66 20 6f 62 6a 65 63 | 74 73 20 61 72 65 20 61 |of objec|ts are a|
|00003c20| 76 61 69 6c 61 62 6c 65 | 20 69 6e 20 45 6c 61 6e |vailable| in Elan|
|00003c30| 2d 30 2c 20 61 6e 64 20 | 77 68 61 74 20 61 72 65 |-0, and |what are|
|00003c40| 20 74 68 65 0d 0a 62 61 | 73 69 63 20 61 6c 67 6f | the..ba|sic algo|
|00003c50| 72 69 74 68 6d 73 20 74 | 6f 20 68 61 6e 64 6c 65 |rithms t|o handle|
|00003c60| 20 74 68 65 6d 2e 0d 0a | 4f 62 6a 65 63 74 73 20 | them...|Objects |
|00003c70| 6f 63 63 75 72 20 69 6e | 20 70 72 6f 67 72 61 6d |occur in| program|
|00003c80| 73 20 69 6e 20 74 77 6f | 20 66 6f 72 6d 73 3a 0d |s in two| forms:.|
|00003c90| 0a 0d 0a 5c 62 65 67 69 | 6e 7b 69 74 65 6d 69 7a |...\begi|n{itemiz|
|00003ca0| 65 7d 0d 0a 5c 69 74 65 | 6d 20 45 6c 65 6d 65 6e |e}..\ite|m Elemen|
|00003cb0| 74 61 72 79 20 6f 62 6a | 65 63 74 73 20 61 72 65 |tary obj|ects are|
|00003cc0| 20 76 61 72 69 61 62 6c | 65 73 20 61 6e 64 20 63 | variabl|es and c|
|00003cd0| 6f 6e 73 74 61 6e 74 73 | 20 77 68 69 63 68 20 63 |onstants| which c|
|00003ce0| 6f 6d 65 0d 0a 69 6e 74 | 6f 20 6c 69 66 65 20 62 |ome..int|o life b|
|00003cf0| 79 20 74 68 65 20 65 78 | 65 63 75 74 69 6f 6e 20 |y the ex|ecution |
|00003d00| 6f 66 20 7b 5c 65 6d 20 | 64 65 63 6c 61 72 61 74 |of {\em |declarat|
|00003d10| 69 6f 6e 73 7d 3b 0d 0a | 5c 69 74 65 6d 20 43 6f |ions};..|\item Co|
|00003d20| 6d 70 6f 73 65 64 20 6f | 62 6a 65 63 74 73 20 61 |mposed o|bjects a|
|00003d30| 72 65 20 74 68 65 20 7b | 5c 65 6d 20 65 78 70 72 |re the {|\em expr|
|00003d40| 65 73 73 69 6f 6e 73 7d | 2e 20 45 78 70 72 65 73 |essions}|. Expres|
|00003d50| 73 69 6f 6e 73 0d 0a 61 | 72 65 20 61 20 63 6f 6e |sions..a|re a con|
|00003d60| 76 65 6e 69 65 6e 74 20 | 6e 6f 74 61 74 69 6f 6e |venient |notation|
|00003d70| 20 66 6f 72 20 74 68 65 | 20 63 6f 6d 70 75 74 61 | for the| computa|
|00003d80| 74 69 6f 6e 20 6f 66 20 | 76 61 6c 75 65 73 2e 20 |tion of |values. |
|00003d90| 41 0d 0a 70 61 72 74 69 | 63 75 6c 61 72 20 6b 69 |A..parti|cular ki|
|00003da0| 6e 64 20 6f 66 20 65 78 | 70 72 65 73 73 69 6f 6e |nd of ex|pression|
|00003db0| 20 61 72 65 20 7b 5c 65 | 6d 20 64 65 6e 6f 74 61 | are {\e|m denota|
|00003dc0| 74 69 6f 6e 73 7d 2c 20 | 61 20 77 61 79 20 6f 66 |tions}, |a way of|
|00003dd0| 0d 0a 77 72 69 74 69 6e | 67 20 64 6f 77 6e 20 76 |..writin|g down v|
|00003de0| 61 6c 75 65 73 20 69 6e | 20 74 68 65 20 70 72 6f |alues in| the pro|
|00003df0| 67 72 61 6d 20 74 65 78 | 74 2e 0d 0a 5c 65 6e 64 |gram tex|t...\end|
|00003e00| 7b 69 74 65 6d 69 7a 65 | 7d 0d 0a 0d 0a 5c 73 75 |{itemize|}....\su|
|00003e10| 62 73 65 63 74 69 6f 6e | 7b 44 65 63 6c 61 72 69 |bsection|{Declari|
|00003e20| 6e 67 20 6f 62 6a 65 63 | 74 73 7d 0d 0a 0d 0a 49 |ng objec|ts}....I|
|00003e30| 6e 20 45 6c 61 6e 20 61 | 6c 6c 20 65 6c 65 6d 65 |n Elan a|ll eleme|
|00003e40| 6e 74 61 72 79 20 6f 62 | 6a 65 63 74 73 20 6d 75 |ntary ob|jects mu|
|00003e50| 73 74 20 62 65 20 64 65 | 63 6c 61 72 65 64 2e 20 |st be de|clared. |
|00003e60| 54 68 69 73 20 64 65 63 | 6c 61 72 61 74 69 6f 6e |This dec|laration|
|00003e70| 0d 0a 6d 61 79 20 6f 63 | 63 75 72 20 61 74 20 61 |..may oc|cur at a|
|00003e80| 6e 79 20 70 6c 61 63 65 | 20 69 6e 20 74 68 65 20 |ny place| in the |
|00003e90| 70 72 6f 67 72 61 6d 2c | 20 70 72 6f 76 69 64 65 |program,| provide|
|00003ea0| 64 20 74 68 65 72 65 20 | 69 73 20 6f 6e 6c 79 0d |d there |is only.|
|00003eb0| 0a 6f 6e 65 20 73 75 63 | 68 20 70 6c 61 63 65 2c |.one suc|h place,|
|00003ec0| 20 61 6e 64 20 69 6e 20 | 65 78 65 63 75 74 69 6e | and in |executin|
|00003ed0| 67 20 74 68 65 20 70 72 | 6f 67 72 61 6d 20 74 68 |g the pr|ogram th|
|00003ee0| 65 20 64 65 63 6c 61 72 | 61 74 69 6f 6e 0d 0a 6f |e declar|ation..o|
|00003ef0| 66 20 61 6e 20 6f 62 6a | 65 63 74 20 70 72 65 63 |f an obj|ect prec|
|00003f00| 65 64 65 73 20 61 6c 6c | 20 69 74 73 20 61 70 70 |edes all| its app|
|00003f10| 6c 69 63 61 74 69 6f 6e | 73 2e 20 54 68 75 73 20 |lication|s. Thus |
|00003f20| 74 68 65 72 65 20 69 73 | 20 6e 6f 0d 0a 6e 65 63 |there is| no..nec|
|00003f30| 65 73 73 69 74 79 20 74 | 6f 20 63 6f 6c 6c 65 63 |essity t|o collec|
|00003f40| 74 20 61 6c 6c 20 64 65 | 63 6c 61 72 61 74 69 6f |t all de|claratio|
|00003f50| 6e 73 20 61 74 20 74 68 | 65 20 68 65 61 64 20 6f |ns at th|e head o|
|00003f60| 66 20 74 68 65 20 70 72 | 6f 67 72 61 6d 0d 0a 62 |f the pr|ogram..b|
|00003f70| 75 74 20 64 65 63 6c 61 | 72 61 74 69 6f 6e 73 20 |ut decla|rations |
|00003f80| 63 61 6e 20 61 70 70 65 | 61 72 20 61 74 20 74 68 |can appe|ar at th|
|00003f90| 65 20 70 6c 61 63 65 20 | 77 68 65 72 65 20 74 68 |e place |where th|
|00003fa0| 65 79 20 61 72 65 20 66 | 69 72 73 74 0d 0a 6e 65 |ey are f|irst..ne|
|00003fb0| 65 64 65 64 2e 20 41 20 | 64 65 63 6c 61 72 61 74 |eded. A |declarat|
|00003fc0| 69 6f 6e 20 6d 61 79 20 | 65 76 65 6e 20 6f 63 63 |ion may |even occ|
|00003fd0| 75 72 20 77 69 74 68 69 | 6e 20 74 68 65 20 62 6f |ur withi|n the bo|
|00003fe0| 64 79 20 6f 66 20 61 20 | 6c 6f 6f 70 2e 0d 0a 0d |dy of a |loop....|
|00003ff0| 0a 41 20 64 65 63 6c 61 | 72 61 74 69 6f 6e 20 69 |.A decla|ration i|
|00004000| 73 20 61 20 75 6e 69 74 | 20 77 68 69 63 68 20 69 |s a unit| which i|
|00004010| 6e 74 72 6f 64 75 63 65 | 73 20 61 6e 20 65 6c 65 |ntroduce|s an ele|
|00004020| 6d 65 6e 74 61 72 79 20 | 6f 62 6a 65 63 74 0d 0a |mentary |object..|
|00004030| 77 69 74 68 20 66 6f 75 | 72 20 61 74 74 72 69 62 |with fou|r attrib|
|00004040| 75 74 65 73 3a 0d 0a 0d | 0a 5c 62 65 67 69 6e 7b |utes:...|.\begin{|
|00004050| 69 74 65 6d 69 7a 65 7d | 0d 0a 5c 69 74 65 6d 20 |itemize}|..\item |
|00004060| 61 20 74 79 70 65 3b 0d | 0a 5c 69 74 65 6d 20 61 |a type;.|.\item a|
|00004070| 20 6e 61 6d 65 3b 0d 0a | 5c 69 74 65 6d 20 61 20 | name;..|\item a |
|00004080| 76 61 6c 75 65 2c 20 77 | 68 69 63 68 20 6d 61 79 |value, w|hich may|
|00004090| 20 62 65 20 75 6e 64 65 | 66 69 6e 65 64 3b 20 61 | be unde|fined; a|
|000040a0| 6e 64 0d 0a 5c 69 74 65 | 6d 20 61 6e 20 61 63 63 |nd..\ite|m an acc|
|000040b0| 65 73 73 20 72 69 67 68 | 74 2e 0d 0a 5c 65 6e 64 |ess righ|t...\end|
|000040c0| 7b 69 74 65 6d 69 7a 65 | 7d 0d 0a 0d 0a 5c 6e 6f |{itemize|}....\no|
|000040d0| 69 6e 64 65 6e 74 0d 0a | 41 20 64 65 63 6c 61 72 |indent..|A declar|
|000040e0| 61 74 69 6f 6e 20 6d 61 | 6b 65 73 20 74 68 65 20 |ation ma|kes the |
|000040f0| 6e 61 6d 65 20 6f 66 20 | 74 68 65 20 6f 62 6a 65 |name of |the obje|
|00004100| 63 74 20 6b 6e 6f 77 6e | 20 74 68 72 6f 75 67 68 |ct known| through|
|00004110| 6f 75 74 20 74 68 65 0d | 0a 77 68 6f 6c 65 20 45 |out the.|.whole E|
|00004120| 6c 61 6e 20 70 72 6f 67 | 72 61 6d 2e 0d 0a 0d 0a |lan prog|ram.....|
|00004130| 5c 73 75 62 73 75 62 73 | 65 63 74 69 6f 6e 7b 4e |\subsubs|ection{N|
|00004140| 61 6d 65 73 7d 0d 0a 0d | 0a 54 68 65 20 6e 61 6d |ames}...|.The nam|
|00004150| 65 73 20 6f 66 20 6f 62 | 6a 65 63 74 73 20 61 72 |es of ob|jects ar|
|00004160| 65 20 69 64 65 6e 74 69 | 66 69 65 72 73 2c 20 6a |e identi|fiers, j|
|00004170| 75 73 74 20 6c 69 6b 65 | 20 74 68 6f 73 65 20 66 |ust like| those f|
|00004180| 6f 72 20 61 6c 67 6f 72 | 69 74 68 6d 73 2c 0d 0a |or algor|ithms,..|
|00004190| 61 6e 64 20 6d 61 79 20 | 62 65 20 63 68 6f 73 65 |and may |be chose|
|000041a0| 6e 20 66 72 65 65 6c 79 | 2c 20 61 73 20 6c 6f 6e |n freely|, as lon|
|000041b0| 67 20 61 73 20 74 68 65 | 79 20 64 69 66 66 65 72 |g as the|y differ|
|000041c0| 20 66 72 6f 6d 20 74 68 | 65 20 6e 61 6d 65 73 0d | from th|e names.|
|000041d0| 0a 6f 66 20 61 6e 79 20 | 6f 74 68 65 72 20 65 6e |.of any |other en|
|000041e0| 74 69 74 69 65 73 20 69 | 6e 20 74 68 65 20 70 72 |tities i|n the pr|
|000041f0| 6f 67 72 61 6d 2e 0d 0a | 0d 0a 5c 73 75 62 73 75 |ogram...|..\subsu|
|00004200| 62 73 65 63 74 69 6f 6e | 7b 54 79 70 65 73 7d 0d |bsection|{Types}.|
|00004210| 0a 0d 0a 54 68 65 20 74 | 79 70 65 20 6f 66 20 61 |...The t|ype of a|
|00004220| 6e 20 6f 62 6a 65 63 74 | 20 73 65 72 76 65 73 20 |n object| serves |
|00004230| 74 77 6f 20 70 75 72 70 | 6f 73 65 73 3a 0d 0a 0d |two purp|oses:...|
|00004240| 0a 5c 62 65 67 69 6e 7b | 69 74 65 6d 69 7a 65 7d |.\begin{|itemize}|
|00004250| 0d 0a 5c 69 74 65 6d 20 | 49 74 20 65 78 70 72 65 |..\item |It expre|
|00004260| 73 73 65 73 20 77 68 61 | 74 20 6f 70 65 72 61 74 |sses wha|t operat|
|00004270| 69 6f 6e 73 20 63 61 6e | 20 62 65 20 61 70 70 6c |ions can| be appl|
|00004280| 69 65 64 20 74 6f 20 74 | 68 65 20 6f 62 6a 65 63 |ied to t|he objec|
|00004290| 74 73 0d 0a 69 6e 20 71 | 75 65 73 74 69 6f 6e 2e |ts..in q|uestion.|
|000042a0| 20 49 6e 20 61 20 77 61 | 79 2c 20 69 74 20 63 6f | In a wa|y, it co|
|000042b0| 6e 74 72 6f 6c 73 20 74 | 68 61 74 20 61 70 70 6c |ntrols t|hat appl|
|000042c0| 65 73 20 63 61 6e 6e 6f | 74 20 62 65 20 61 64 64 |es canno|t be add|
|000042d0| 65 64 0d 0a 74 6f 20 6f | 72 61 6e 67 65 73 3b 0d |ed..to o|ranges;.|
|000042e0| 0a 5c 69 74 65 6d 20 49 | 74 20 64 65 74 65 72 6d |.\item I|t determ|
|000042f0| 69 6e 65 73 20 74 68 65 | 20 69 6e 74 65 72 6e 61 |ines the| interna|
|00004300| 6c 20 72 65 70 72 65 73 | 65 6e 74 61 74 69 6f 6e |l repres|entation|
|00004310| 20 6f 66 20 76 61 6c 75 | 65 73 20 69 6e 0d 0a 74 | of valu|es in..t|
|00004320| 68 65 20 63 6f 6d 70 75 | 74 65 72 27 73 20 6d 65 |he compu|ter's me|
|00004330| 6d 6f 72 79 2e 0d 0a 5c | 65 6e 64 7b 69 74 65 6d |mory...\|end{item|
|00004340| 69 7a 65 7d 0d 0a 0d 0a | 5c 6e 6f 69 6e 64 65 6e |ize}....|\noinden|
|00004350| 74 0d 0a 54 68 65 72 65 | 20 61 72 65 20 66 6f 75 |t..There| are fou|
|00004360| 72 20 62 61 73 69 63 20 | 74 79 70 65 73 20 69 6e |r basic |types in|
|00004370| 20 45 6c 61 6e 2c 20 64 | 65 6e 6f 74 65 64 20 69 | Elan, d|enoted i|
|00004380| 6e 20 70 72 6f 67 72 61 | 6d 20 74 65 78 74 73 0d |n progra|m texts.|
|00004390| 0a 62 79 20 74 68 65 20 | 6b 65 79 77 6f 72 64 73 |.by the |keywords|
|000043a0| 3a 0d 0a 0d 0a 5c 62 65 | 67 69 6e 7b 69 74 65 6d |:....\be|gin{item|
|000043b0| 69 7a 65 7d 0d 0a 5c 69 | 74 65 6d 20 7b 5c 74 74 |ize}..\i|tem {\tt|
|000043c0| 20 49 4e 54 20 20 20 7d | 5c 5c 0d 0a 20 20 20 20 | INT }|\\.. |
|000043d0| 20 20 69 6e 74 65 67 72 | 61 6c 20 6e 75 6d 62 65 | integr|al numbe|
|000043e0| 72 73 20 69 6e 20 74 68 | 65 20 72 61 6e 67 65 20 |rs in th|e range |
|000043f0| 2d 32 31 34 37 34 38 33 | 36 34 37 20 74 6f 20 32 |-2147483|647 to 2|
|00004400| 31 34 37 34 38 33 36 34 | 37 3b 0d 0a 5c 69 74 65 |14748364|7;..\ite|
|00004410| 6d 20 7b 5c 74 74 20 52 | 45 41 4c 20 20 7d 5c 5c |m {\tt R|EAL }\\|
|00004420| 0d 0a 20 20 20 20 20 20 | 72 65 61 6c 20 6e 75 6d |.. |real num|
|00004430| 62 65 72 73 20 69 6e 20 | 61 20 70 72 65 63 69 73 |bers in |a precis|
|00004440| 69 6f 6e 20 6f 66 20 20 | 31 34 20 64 65 63 69 6d |ion of |14 decim|
|00004450| 61 6c 73 3b 0d 0a 5c 69 | 74 65 6d 20 7b 5c 74 74 |als;..\i|tem {\tt|
|00004460| 20 42 4f 4f 4c 20 20 7d | 5c 5c 0d 0a 20 20 20 20 | BOOL }|\\.. |
|00004470| 20 20 74 72 75 74 68 20 | 76 61 6c 75 65 73 2c 20 | truth |values, |
|00004480| 74 72 75 65 20 61 6e 64 | 20 66 61 6c 73 65 3b 20 |true and| false; |
|00004490| 61 6e 64 0d 0a 5c 69 74 | 65 6d 20 7b 5c 74 74 20 |and..\it|em {\tt |
|000044a0| 54 45 58 54 20 20 7d 5c | 5c 0d 0a 20 20 20 20 20 |TEXT }\|\.. |
|000044b0| 20 73 65 71 75 65 6e 63 | 65 73 20 6f 66 20 63 68 | sequenc|es of ch|
|000044c0| 61 72 61 63 74 65 72 73 | 2e 0d 0a 5c 65 6e 64 7b |aracters|...\end{|
|000044d0| 69 74 65 6d 69 7a 65 7d | 0d 0a 0d 0a 5c 6e 6f 69 |itemize}|....\noi|
|000044e0| 6e 64 65 6e 74 0d 0a 46 | 75 72 74 68 65 72 6d 6f |ndent..F|urthermo|
|000044f0| 72 65 2c 20 6f 62 6a 65 | 63 74 73 20 6f 66 20 61 |re, obje|cts of a|
|00004500| 6e 79 20 74 79 70 65 20 | 63 61 6e 20 62 65 20 63 |ny type |can be c|
|00004510| 6f 6d 70 6f 73 65 64 20 | 69 6e 74 6f 20 6f 6e 65 |omposed |into one|
|00004520| 20 64 69 6d 65 6e 73 69 | 6f 6e 61 6c 0d 0a 72 6f | dimensi|onal..ro|
|00004530| 77 73 2e 20 54 68 65 73 | 65 20 63 6f 6d 70 6f 73 |ws. Thes|e compos|
|00004540| 65 64 20 74 79 70 65 73 | 20 61 72 65 20 64 69 73 |ed types| are dis|
|00004550| 63 75 73 73 65 64 20 69 | 6e 20 74 68 65 20 73 75 |cussed i|n the su|
|00004560| 62 63 68 61 70 74 65 72 | 20 6f 6e 0d 0a 72 6f 77 |bchapter| on..row|
|00004570| 73 2e 0d 0a 0d 0a 5c 73 | 75 62 73 75 62 73 65 63 |s.....\s|ubsubsec|
|00004580| 74 69 6f 6e 7b 56 61 6c | 75 65 73 7d 0d 0a 0d 0a |tion{Val|ues}....|
|00004590| 53 69 6e 63 65 20 76 61 | 6c 75 65 73 20 6f 66 20 |Since va|lues of |
|000045a0| 74 68 65 20 76 61 72 69 | 6f 75 73 20 74 79 70 65 |the vari|ous type|
|000045b0| 73 20 61 72 65 20 6b 65 | 70 74 20 77 69 74 68 69 |s are ke|pt withi|
|000045c0| 6e 20 74 68 65 20 6d 65 | 6d 6f 72 79 0d 0a 6f 66 |n the me|mory..of|
|000045d0| 20 74 68 65 20 63 6f 6d | 70 75 74 65 72 2c 20 6c | the com|puter, l|
|000045e0| 69 74 74 6c 65 20 63 61 | 6e 20 62 65 20 73 61 69 |ittle ca|n be sai|
|000045f0| 64 20 61 62 6f 75 74 20 | 74 68 65 6d 2e 20 4b 6e |d about |them. Kn|
|00004600| 6f 77 6c 65 64 67 65 20 | 6f 66 0d 0a 74 68 65 69 |owledge |of..thei|
|00004610| 72 20 69 6e 74 65 72 6e | 61 6c 20 72 65 70 72 65 |r intern|al repre|
|00004620| 73 65 6e 74 61 74 69 6f | 6e 20 69 73 20 6e 6f 74 |sentatio|n is not|
|00004630| 20 61 74 20 61 6c 6c 20 | 6e 65 63 65 73 73 61 72 | at all |necessar|
|00004640| 79 20 74 6f 20 75 6e 64 | 65 72 73 74 61 6e 64 0d |y to und|erstand.|
|00004650| 0a 74 68 65 69 72 20 72 | 65 6c 65 76 61 6e 74 20 |.their r|elevant |
|00004660| 70 72 6f 70 65 72 74 69 | 65 73 2e 20 49 74 20 73 |properti|es. It s|
|00004670| 68 6f 75 6c 64 20 62 65 | 20 6e 6f 74 65 64 20 74 |hould be| noted t|
|00004680| 68 61 74 20 74 68 65 20 | 45 6c 61 6e 20 70 72 6f |hat the |Elan pro|
|00004690| 67 72 61 6d 6d 69 6e 67 | 0d 0a 65 6e 76 69 72 6f |gramming|..enviro|
|000046a0| 6e 6d 65 6e 74 20 64 65 | 74 65 63 74 73 20 61 6e |nment de|tects an|
|000046b0| 64 20 72 65 70 6f 72 74 | 73 20 74 68 65 20 6d 61 |d report|s the ma|
|000046c0| 6e 69 70 75 6c 61 74 69 | 6f 6e 20 6f 66 20 75 6e |nipulati|on of un|
|000046d0| 64 65 66 69 6e 65 64 0d | 0a 76 61 6c 75 65 73 2c |defined.|.values,|
|000046e0| 20 65 2e 67 2e 20 61 6e | 20 61 74 74 65 6d 70 74 | e.g. an| attempt|
|000046f0| 20 74 6f 20 75 73 65 20 | 74 68 65 20 76 61 6c 75 | to use |the valu|
|00004700| 65 20 6f 66 20 61 6e 20 | 75 6e 69 6e 69 74 69 61 |e of an |uninitia|
|00004710| 6c 69 7a 65 64 0d 0a 76 | 61 72 69 61 62 6c 65 2e |lized..v|ariable.|
|00004720| 0d 0a 0d 0a 5c 73 75 62 | 73 75 62 73 65 63 74 69 |....\sub|subsecti|
|00004730| 6f 6e 7b 41 63 63 65 73 | 73 20 61 74 74 72 69 62 |on{Acces|s attrib|
|00004740| 75 74 65 73 7d 0d 0a 0d | 0a 54 68 65 20 61 63 63 |utes}...|.The acc|
|00004750| 65 73 73 20 61 74 74 72 | 69 62 75 74 65 20 6f 66 |ess attr|ibute of|
|00004760| 20 61 6e 20 6f 62 6a 65 | 63 74 20 69 73 20 65 69 | an obje|ct is ei|
|00004770| 74 68 65 72 20 7b 5c 74 | 74 20 56 41 52 7d 20 6f |ther {\t|t VAR} o|
|00004780| 72 20 7b 5c 74 74 20 43 | 4f 4e 53 54 7d 0d 0a 61 |r {\tt C|ONST}..a|
|00004790| 6e 64 20 74 68 65 20 6f | 62 6a 65 63 74 73 20 61 |nd the o|bjects a|
|000047a0| 72 65 20 63 6f 72 72 65 | 73 70 6f 6e 64 69 6e 67 |re corre|sponding|
|000047b0| 6c 79 20 63 6c 61 73 73 | 65 64 20 61 73 20 76 61 |ly class|ed as va|
|000047c0| 72 69 61 62 6c 65 73 0d | 0a 61 6e 64 20 63 6f 6e |riables.|.and con|
|000047d0| 73 74 61 6e 74 73 2e 20 | 54 68 65 20 76 61 6c 75 |stants. |The valu|
|000047e0| 65 20 6f 66 20 61 20 76 | 61 72 69 61 62 6c 65 20 |e of a v|ariable |
|000047f0| 63 61 6e 20 62 65 20 63 | 68 61 6e 67 65 64 20 62 |can be c|hanged b|
|00004800| 79 20 61 6e 20 61 73 73 | 69 67 6e 6d 65 6e 74 2c |y an ass|ignment,|
|00004810| 0d 0a 77 68 65 72 65 61 | 73 20 74 68 65 20 76 61 |..wherea|s the va|
|00004820| 6c 75 65 20 6f 66 20 61 | 20 63 6f 6e 73 74 61 6e |lue of a| constan|
|00004830| 74 20 63 61 6e 6e 6f 74 | 2e 0d 0a 0d 0a 5c 73 75 |t cannot|.....\su|
|00004840| 62 73 65 63 74 69 6f 6e | 7b 44 65 63 6c 61 72 61 |bsection|{Declara|
|00004850| 74 69 6f 6e 73 7d 0d 0a | 0d 0a 41 20 76 61 72 69 |tions}..|..A vari|
|00004860| 61 62 6c 65 20 64 65 63 | 6c 61 72 61 74 69 6f 6e |able dec|laration|
|00004870| 20 6d 61 79 20 67 69 76 | 65 20 61 6e 20 69 6e 69 | may giv|e an ini|
|00004880| 74 69 61 6c 20 76 61 6c | 75 65 20 74 6f 20 61 20 |tial val|ue to a |
|00004890| 76 61 72 69 61 62 6c 65 | 2c 0d 0a 0d 0a 5c 62 65 |variable|,....\be|
|000048a0| 67 69 6e 7b 65 6c 61 6e | 7d 0d 0a 20 20 20 20 20 |gin{elan|}.. |
|000048b0| 20 20 20 49 4e 54 20 56 | 41 52 20 6d 69 64 64 6c | INT V|AR middl|
|000048c0| 65 20 3a 3a 20 28 20 31 | 20 2b 20 6d 61 78 20 29 |e :: ( 1| + max )|
|000048d0| 20 44 49 56 20 32 0d 0a | 5c 65 6e 64 7b 65 6c 61 | DIV 2..|\end{ela|
|000048e0| 6e 7d 0d 0a 0d 0a 5c 6e | 6f 69 6e 64 65 6e 74 0d |n}....\n|oindent.|
|000048f0| 0a 6f 74 68 65 72 77 69 | 73 65 20 69 74 73 20 69 |.otherwi|se its i|
|00004900| 6e 69 74 69 61 6c 20 76 | 61 6c 75 65 20 69 73 20 |nitial v|alue is |
|00004910| 75 6e 64 65 66 69 6e 65 | 64 2c 20 61 73 20 69 6e |undefine|d, as in|
|00004920| 0d 0a 0d 0a 5c 62 65 67 | 69 6e 7b 65 6c 61 6e 7d |....\beg|in{elan}|
|00004930| 0d 0a 20 20 20 20 20 20 | 20 20 56 41 52 20 78 0d |.. | VAR x.|
|00004940| 0a 5c 65 6e 64 7b 65 6c | 61 6e 7d 0d 0a 0d 0a 5c |.\end{el|an}....\|
|00004950| 6e 6f 69 6e 64 65 6e 74 | 0d 0a 54 77 6f 20 6f 72 |noindent|..Two or|
|00004960| 20 6d 6f 72 65 20 76 61 | 72 69 61 62 6c 65 20 64 | more va|riable d|
|00004970| 65 63 6c 61 72 61 74 69 | 6f 6e 73 20 63 61 6e 20 |eclarati|ons can |
|00004980| 62 65 20 63 6f 6d 62 69 | 6e 65 64 20 69 6e 74 6f |be combi|ned into|
|00004990| 20 6f 6e 65 20 75 6e 69 | 74 0d 0a 0d 0a 5c 62 65 | one uni|t....\be|
|000049a0| 67 69 6e 7b 65 6c 61 6e | 7d 0d 0a 20 20 20 20 20 |gin{elan|}.. |
|000049b0| 20 20 20 56 41 52 20 6c | 65 66 74 20 70 6f 69 6e | VAR l|eft poin|
|000049c0| 74 65 72 20 3a 3a 20 31 | 20 2c 0d 0a 20 20 20 20 |ter :: 1| ,.. |
|000049d0| 20 20 20 20 20 20 20 20 | 72 69 67 68 74 20 70 6f | |right po|
|000049e0| 69 6e 74 65 72 20 3a 3a | 20 6d 61 78 20 2c 0d 0a |inter ::| max ,..|
|000049f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 6d 69 64 64 | | midd|
|00004a00| 6c 65 20 70 6f 69 6e 74 | 65 72 0d 0a 5c 65 6e 64 |le point|er..\end|
|00004a10| 7b 65 6c 61 6e 7d 0d 0a | 0d 0a 5c 6e 6f 69 6e 64 |{elan}..|..\noind|
|00004a20| 65 6e 74 0d 0a 41 20 63 | 6f 6e 73 74 61 6e 74 20 |ent..A c|onstant |
|00004a30| 64 65 63 6c 61 72 61 74 | 69 6f 6e 20 6d 75 73 74 |declarat|ion must|
|00004a40| 20 67 69 76 65 20 61 6e | 20 69 6e 69 74 69 61 6c | give an| initial|
|00004a50| 20 76 61 6c 75 65 20 74 | 6f 20 61 20 63 6f 6e 73 | value t|o a cons|
|00004a60| 74 61 6e 74 0d 0a 0d 0a | 5c 62 65 67 69 6e 7b 65 |tant....|\begin{e|
|00004a70| 6c 61 6e 7d 0d 0a 20 20 | 20 20 20 20 20 20 49 4e |lan}.. | IN|
|00004a80| 54 20 43 4f 4e 53 54 20 | 73 6d 61 6c 6c 20 3a 3a |T CONST |small ::|
|00004a90| 20 34 37 31 31 20 3b 0d | 0a 20 20 20 20 20 20 20 | 4711 ;.|. |
|00004aa0| 20 54 45 58 54 20 43 4f | 4e 53 54 20 63 61 70 69 | TEXT CO|NST capi|
|00004ab0| 74 61 6c 20 3a 3a 20 22 | 6d 6f 6e 61 63 6f 22 0d |tal :: "|monaco".|
|00004ac0| 0a 5c 65 6e 64 7b 65 6c | 61 6e 7d 0d 0a 0d 0a 5c |.\end{el|an}....\|
|00004ad0| 6e 6f 69 6e 64 65 6e 74 | 0d 0a 45 61 63 68 20 65 |noindent|..Each e|
|00004ae0| 78 65 63 75 74 69 6f 6e | 20 6f 66 20 61 20 64 65 |xecution| of a de|
|00004af0| 63 6c 61 72 61 74 69 6f | 6e 20 63 61 75 73 65 73 |claratio|n causes|
|00004b00| 20 61 20 6e 65 77 20 65 | 6c 61 62 6f 72 61 74 69 | a new e|laborati|
|00004b10| 6f 6e 20 6f 66 20 74 68 | 65 0d 0a 69 6e 69 74 69 |on of th|e..initi|
|00004b20| 61 6c 69 7a 61 74 69 6f | 6e 2e 20 49 6e 20 74 68 |alizatio|n. In th|
|00004b30| 69 73 20 77 61 79 20 61 | 20 63 6f 6e 73 74 61 6e |is way a| constan|
|00004b40| 74 20 6d 61 79 20 68 61 | 76 65 20 61 20 64 69 66 |t may ha|ve a dif|
|00004b50| 66 65 72 65 6e 74 20 76 | 61 6c 75 65 0d 0a 61 66 |ferent v|alue..af|
|00004b60| 74 65 72 20 65 61 63 68 | 20 64 65 63 6c 61 72 61 |ter each| declara|
|00004b70| 74 69 6f 6e 20 65 78 65 | 63 75 74 65 64 2e 20 54 |tion exe|cuted. T|
|00004b80| 68 65 20 74 65 72 6d 20 | 60 60 63 6f 6e 73 74 61 |he term |``consta|
|00004b90| 6e 74 27 27 20 69 73 20 | 74 68 65 72 65 66 6f 72 |nt'' is |therefor|
|00004ba0| 65 0d 0a 73 6f 6d 65 77 | 68 61 74 20 6d 69 73 6c |e..somew|hat misl|
|00004bb0| 65 61 64 69 6e 67 3a 20 | 69 74 73 20 76 61 6c 75 |eading: |its valu|
|00004bc0| 65 20 69 73 20 6e 6f 74 | 20 63 68 61 6e 67 65 61 |e is not| changea|
|00004bd0| 62 6c 65 20 62 79 20 61 | 6e 20 61 73 73 69 67 6e |ble by a|n assign|
|00004be0| 6d 65 6e 74 2c 0d 0a 74 | 68 65 72 65 66 6f 72 65 |ment,..t|herefore|
|00004bf0| 20 69 74 20 69 73 20 63 | 6f 6e 73 74 61 6e 74 20 | it is c|onstant |
|00004c00| 6f 76 65 72 20 70 61 72 | 74 20 6f 72 20 61 6c 6c |over par|t or all|
|00004c10| 20 6f 66 20 74 68 65 20 | 70 72 6f 67 72 61 6d 2e | of the |program.|
|00004c20| 0d 0a 0d 0a 5c 73 75 62 | 73 65 63 74 69 6f 6e 7b |....\sub|section{|
|00004c30| 44 65 6e 6f 74 61 74 69 | 6f 6e 73 7d 0d 0a 0d 0a |Denotati|ons}....|
|00004c40| 56 61 6c 75 65 73 20 6f | 66 20 62 61 73 69 63 20 |Values o|f basic |
|00004c50| 74 79 70 65 20 63 61 6e | 20 62 65 20 77 72 69 74 |type can| be writ|
|00004c60| 74 65 6e 20 64 6f 77 6e | 20 28 64 65 6e 6f 74 65 |ten down| (denote|
|00004c70| 64 29 20 69 6e 20 61 20 | 70 72 6f 67 72 61 6d 0d |d) in a |program.|
|00004c80| 0a 74 65 78 74 20 62 79 | 20 64 65 6e 6f 74 61 74 |.text by| denotat|
|00004c90| 69 6f 6e 73 3a 0d 0a 0d | 0a 5c 62 65 67 69 6e 7b |ions:...|.\begin{|
|00004ca0| 69 74 65 6d 69 7a 65 7d | 0d 0a 5c 69 74 65 6d 20 |itemize}|..\item |
|00004cb0| 7b 5c 74 74 20 49 4e 54 | 7d 5c 5c 0d 0a 20 20 20 |{\tt INT|}\\.. |
|00004cc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 4e 61 74 | | Nat|
|00004cd0| 75 72 61 6c 20 6e 75 6d | 62 65 72 73 20 63 61 6e |ural num|bers can|
|00004ce0| 20 62 65 20 77 72 69 74 | 74 65 6e 20 61 73 20 61 | be writ|ten as a|
|00004cf0| 20 73 65 71 75 65 6e 63 | 65 20 6f 66 20 64 69 67 | sequenc|e of dig|
|00004d00| 69 74 73 2c 20 65 2e 67 | 2e 0d 0a 20 20 20 20 20 |its, e.g|... |
|00004d10| 20 20 20 20 20 20 20 20 | 20 20 20 7b 5c 74 74 20 | | {\tt |
|00004d20| 33 7d 2c 20 7b 5c 74 74 | 20 31 39 38 7d 2c 20 7b |3}, {\tt| 198}, {|
|00004d30| 5c 74 74 20 31 30 30 30 | 30 7d 0d 0a 20 20 20 20 |\tt 1000|0}.. |
|00004d40| 20 20 20 20 20 20 20 20 | 20 20 20 20 61 72 65 20 | | are |
|00004d50| 61 6c 6c 20 74 68 72 65 | 65 20 76 61 6c 69 64 20 |all thre|e valid |
|00004d60| 7b 5c 74 74 20 49 4e 54 | 7d 20 64 65 6e 6f 74 61 |{\tt INT|} denota|
|00004d70| 74 69 6f 6e 73 2e 0d 0a | 0d 0a 20 20 20 20 20 20 |tions...|.. |
|00004d80| 20 20 20 20 20 20 20 20 | 20 20 4e 65 67 61 74 69 | | Negati|
|00004d90| 76 65 20 6e 75 6d 62 65 | 72 73 20 63 61 6e 20 62 |ve numbe|rs can b|
|00004da0| 65 20 77 72 69 74 74 65 | 6e 20 61 73 20 65 78 70 |e writte|n as exp|
|00004db0| 72 65 73 73 69 6f 6e 73 | 20 63 6f 6e 73 69 73 74 |ressions| consist|
|00004dc0| 69 6e 67 20 6f 66 20 61 | 0d 0a 20 20 20 20 20 20 |ing of a|.. |
|00004dd0| 20 20 20 20 20 20 20 20 | 20 20 6d 6f 6e 61 64 69 | | monadi|
|00004de0| 63 20 6d 69 6e 75 73 20 | 6f 70 65 72 61 74 6f 72 |c minus |operator|
|00004df0| 20 61 6e 64 20 61 6e 20 | 7b 5c 74 74 20 49 4e 54 | and an |{\tt INT|
|00004e00| 7d 20 64 65 6e 6f 74 61 | 74 69 6f 6e 2c 20 65 2e |} denota|tion, e.|
|00004e10| 67 2e 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |g... | |
|00004e20| 20 20 20 20 7b 5c 74 74 | 20 2d 35 37 7d 2c 20 61 | {\tt| -57}, a|
|00004e30| 73 20 79 6f 75 20 6d 69 | 67 68 74 20 68 61 76 65 |s you mi|ght have|
|00004e40| 20 73 75 73 70 65 63 74 | 65 64 2e 0d 0a 5c 69 74 | suspect|ed...\it|
|00004e50| 65 6d 20 7b 5c 74 74 20 | 52 45 41 4c 7d 5c 5c 0d |em {\tt |REAL}\\.|
|00004e60| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00004e70| 20 45 6c 61 6e 20 61 64 | 6d 69 74 73 20 74 68 65 | Elan ad|mits the|
|00004e80| 20 63 6f 6e 76 65 6e 74 | 69 6f 6e 61 6c 20 66 69 | convent|ional fi|
|00004e90| 78 65 64 20 70 6f 69 6e | 74 20 61 6e 64 20 66 6c |xed poin|t and fl|
|00004ea0| 6f 61 74 69 6e 67 20 70 | 6f 69 6e 74 0d 0a 20 20 |oating p|oint.. |
|00004eb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 72 65 | | re|
|00004ec0| 70 72 65 73 65 6e 74 61 | 74 69 6f 6e 20 66 6f 72 |presenta|tion for|
|00004ed0| 20 28 61 70 70 72 6f 78 | 69 6d 61 74 69 6f 6e 73 | (approx|imations|
|00004ee0| 29 20 6f 66 20 72 65 61 | 6c 20 6e 75 6d 62 65 72 |) of rea|l number|
|00004ef0| 73 2c 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |s,.. | |
|00004f00| 20 20 20 20 6c 69 6b 65 | 20 7b 5c 74 74 20 33 2e | like| {\tt 3.|
|00004f10| 31 34 31 35 32 36 39 7d | 2c 20 7b 5c 74 74 20 31 |1415269}|, {\tt 1|
|00004f20| 2e 33 65 2d 38 7d 2e 0d | 0a 5c 69 74 65 6d 20 7b |.3e-8}..|.\item {|
|00004f30| 5c 74 74 20 42 4f 4f 4c | 7d 5c 5c 0d 0a 20 20 20 |\tt BOOL|}\\.. |
|00004f40| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 54 68 65 | | The|
|00004f50| 72 65 20 61 72 65 20 6f | 6e 6c 79 20 74 77 6f 20 |re are o|nly two |
|00004f60| 76 61 6c 75 65 73 20 66 | 6f 72 20 74 72 75 74 68 |values f|or truth|
|00004f70| 20 76 61 6c 75 65 73 2c | 20 77 68 69 63 68 20 61 | values,| which a|
|00004f80| 72 65 20 64 65 6e 6f 74 | 65 64 0d 0a 20 20 20 20 |re denot|ed.. |
|00004f90| 20 20 20 20 20 20 20 20 | 20 20 20 20 62 79 20 74 | | by t|
|00004fa0| 68 65 20 63 6f 6e 73 74 | 61 6e 74 73 20 7b 5c 74 |he const|ants {\t|
|00004fb0| 74 20 54 52 55 45 7d 20 | 61 6e 64 20 7b 5c 74 74 |t TRUE} |and {\tt|
|00004fc0| 20 46 41 4c 53 45 7d 20 | 72 65 73 70 65 63 74 69 | FALSE} |respecti|
|00004fd0| 76 65 6c 79 2e 0d 0a 20 | 20 20 20 20 20 20 20 20 |vely... | |
|00004fe0| 20 20 20 20 20 20 20 50 | 65 6f 70 6c 65 20 61 6c | P|eople al|
|00004ff0| 6c 65 72 67 69 63 20 74 | 6f 20 63 61 70 69 74 61 |lergic t|o capita|
|00005000| 6c 20 6c 65 74 74 65 72 | 73 20 6d 61 79 20 75 73 |l letter|s may us|
|00005010| 65 20 74 68 65 20 63 6f | 6e 63 72 65 74 65 0d 0a |e the co|ncrete..|
|00005020| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005030| 73 74 61 6e 64 61 72 64 | 20 63 6f 6e 73 74 61 6e |standard| constan|
|00005040| 74 73 20 7b 5c 74 74 20 | 74 72 75 65 7d 20 61 6e |ts {\tt |true} an|
|00005050| 64 20 7b 5c 74 74 20 66 | 61 6c 73 65 7d 20 69 6e |d {\tt f|alse} in|
|00005060| 73 74 65 61 64 2e 0d 0a | 5c 69 74 65 6d 20 7b 5c |stead...|\item {\|
|00005070| 74 74 20 54 45 58 54 7d | 5c 5c 0d 0a 20 20 20 20 |tt TEXT}|\\.. |
|00005080| 20 20 20 20 20 20 20 20 | 20 20 20 20 54 65 78 74 | | Text|
|00005090| 20 64 65 6e 6f 74 61 74 | 69 6f 6e 73 20 63 6f 6e | denotat|ions con|
|000050a0| 73 69 73 74 20 6f 66 20 | 73 65 71 75 65 6e 63 65 |sist of |sequence|
|000050b0| 73 20 6f 66 20 63 68 61 | 72 61 63 74 65 72 73 0d |s of cha|racters.|
|000050c0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|000050d0| 20 65 6e 63 6c 6f 73 65 | 64 20 69 6e 20 71 75 6f | enclose|d in quo|
|000050e0| 74 61 74 69 6f 6e 20 6d | 61 72 6b 73 2c 20 65 2e |tation m|arks, e.|
|000050f0| 67 2e 20 7b 5c 74 74 20 | 22 48 65 6c 6c 6f 20 77 |g. {\tt |"Hello w|
|00005100| 6f 72 6c 64 21 22 7d 5c | 5c 0d 0a 20 20 20 20 20 |orld!"}\|\.. |
|00005110| 20 20 20 20 20 20 20 20 | 20 20 20 41 6c 6c 20 70 | | All p|
|00005120| 72 69 6e 74 61 62 6c 65 | 20 63 68 61 72 61 63 74 |rintable| charact|
|00005130| 65 72 73 20 6f 66 20 79 | 6f 75 72 20 63 6f 6d 70 |ers of y|our comp|
|00005140| 75 74 65 72 20 61 72 65 | 20 61 6c 6c 6f 77 65 64 |uter are| allowed|
|00005150| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|00005160| 20 20 77 69 74 68 69 6e | 20 74 65 78 74 20 64 65 | within| text de|
|00005170| 6e 6f 74 61 74 69 6f 6e | 73 2e 20 49 66 20 61 20 |notation|s. If a |
|00005180| 71 75 6f 74 65 20 63 68 | 61 72 61 63 74 65 72 20 |quote ch|aracter |
|00005190| 69 73 20 74 6f 20 61 70 | 70 65 61 72 0d 0a 20 20 |is to ap|pear.. |
|000051a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 69 6e | | in|
|000051b0| 20 61 20 74 65 78 74 20 | 64 65 6e 6f 74 61 74 69 | a text |denotati|
|000051c0| 6f 6e 2c 20 74 68 65 6e | 20 69 74 20 68 61 73 20 |on, then| it has |
|000051d0| 74 65 20 62 65 20 64 6f | 75 62 6c 65 64 2c 20 65 |te be do|ubled, e|
|000051e0| 2e 67 2e 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |.g... | |
|000051f0| 20 20 20 20 20 7b 5c 74 | 74 20 22 48 65 20 73 61 | {\t|t "He sa|
|00005200| 69 64 20 22 22 44 6f 6e | 27 74 21 22 22 22 7d 0d |id ""Don|'t!"""}.|
|00005210| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00005220| 20 54 68 65 20 65 6d 70 | 74 79 20 74 65 78 74 20 | The emp|ty text |
|00005230| 63 6f 6e 73 69 73 74 69 | 6e 67 20 6f 66 20 6e 6f |consisti|ng of no|
|00005240| 20 63 68 61 72 61 63 74 | 65 72 73 20 69 73 20 64 | charact|ers is d|
|00005250| 65 6e 6f 74 65 64 20 62 | 79 0d 0a 20 20 20 20 20 |enoted b|y.. |
|00005260| 20 20 20 20 20 20 20 20 | 20 20 20 7b 5c 74 74 20 | | {\tt |
|00005270| 22 22 7d 2e 0d 0a 5c 65 | 6e 64 7b 69 74 65 6d 69 |""}...\e|nd{itemi|
|00005280| 7a 65 7d 0d 0a 0d 0a 5c | 73 75 62 73 65 63 74 69 |ze}....\|subsecti|
|00005290| 6f 6e 7b 45 78 70 72 65 | 73 73 69 6f 6e 73 7d 0d |on{Expre|ssions}.|
|000052a0| 0a 0d 0a 41 6e 20 65 78 | 70 72 65 73 73 69 6f 6e |...An ex|pression|
|000052b0| 20 69 6e 20 45 6c 61 6e | 20 69 73 20 63 6f 6d 70 | in Elan| is comp|
|000052c0| 6f 73 65 64 20 69 6e 20 | 74 68 65 20 63 6f 6e 76 |osed in |the conv|
|000052d0| 65 6e 74 69 6f 6e 61 6c | 20 66 61 73 68 69 6f 6e |entional| fashion|
|000052e0| 0d 0a 6f 75 74 20 6f 66 | 20 6f 70 65 72 61 6e 64 |..out of| operand|
|000052f0| 73 2c 20 6d 6f 6e 61 64 | 69 63 20 6f 70 65 72 61 |s, monad|ic opera|
|00005300| 74 6f 72 73 20 61 6e 64 | 20 64 79 61 64 69 63 20 |tors and| dyadic |
|00005310| 6f 70 65 72 61 74 6f 72 | 73 20 77 69 74 68 0d 0a |operator|s with..|
|00005320| 62 72 61 63 6b 65 74 73 | 20 74 6f 20 69 6e 64 69 |brackets| to indi|
|00005330| 63 61 74 65 20 67 72 6f | 75 70 69 6e 67 2e 0d 0a |cate gro|uping...|
|00005340| 41 6e 20 6f 70 65 72 61 | 6e 64 20 6d 61 79 20 69 |An opera|nd may i|
|00005350| 6e 20 45 6c 61 6e 2d 30 | 20 62 65 20 74 68 65 20 |n Elan-0| be the |
|00005360| 6e 61 6d 65 20 6f 66 20 | 61 6e 20 6f 62 6a 65 63 |name of |an objec|
|00005370| 74 2c 20 61 20 64 65 6e | 6f 74 61 74 69 6f 6e 2c |t, a den|otation,|
|00005380| 0d 0a 61 20 73 75 62 73 | 63 72 69 70 74 69 6f 6e |..a subs|cription|
|00005390| 2c 20 61 6e 20 69 6e 76 | 6f 63 61 74 69 6f 6e 20 |, an inv|ocation |
|000053a0| 6f 66 20 61 20 72 65 66 | 69 6e 65 6d 65 6e 74 20 |of a ref|inement |
|000053b0| 6f 72 20 74 68 65 20 63 | 61 6c 6c 20 6f 66 0d 0a |or the c|all of..|
|000053c0| 61 20 73 74 61 6e 64 61 | 72 64 20 70 72 6f 63 65 |a standa|rd proce|
|000053d0| 64 75 72 65 2e 20 54 68 | 65 20 70 72 69 6f 72 69 |dure. Th|e priori|
|000053e0| 74 79 20 6f 66 20 6f 70 | 65 72 61 74 6f 72 73 2c |ty of op|erators,|
|000053f0| 20 66 72 6f 6d 20 68 69 | 67 68 20 74 6f 0d 0a 6c | from hi|gh to..l|
|00005400| 6f 77 2c 20 69 73 20 61 | 73 20 66 6f 6c 6c 6f 77 |ow, is a|s follow|
|00005410| 73 3a 0d 0a 0d 0a 5c 62 | 65 67 69 6e 7b 69 74 65 |s:....\b|egin{ite|
|00005420| 6d 69 7a 65 7d 0d 0a 5c | 69 74 65 6d 20 74 68 65 |mize}..\|item the|
|00005430| 20 6d 6f 6e 61 64 69 63 | 20 6f 70 65 72 61 74 6f | monadic| operato|
|00005440| 72 73 20 7b 5c 74 74 20 | 2b 7d 2c 20 7b 5c 74 74 |rs {\tt |+}, {\tt|
|00005450| 20 2d 7d 2c 20 7b 5c 74 | 74 20 4e 4f 54 7d 2c 20 | -}, {\t|t NOT}, |
|00005460| 7b 5c 74 74 20 48 45 41 | 44 7d 2c 20 7b 5c 74 74 |{\tt HEA|D}, {\tt|
|00005470| 20 54 41 49 4c 7d 2c 20 | 7b 5c 74 74 20 4c 45 4e | TAIL}, |{\tt LEN|
|00005480| 47 54 48 7d 0d 0a 5c 69 | 74 65 6d 20 7b 5c 74 74 |GTH}..\i|tem {\tt|
|00005490| 20 2a 7d 2c 20 7b 5c 74 | 74 20 44 49 56 7d 2c 20 | *}, {\t|t DIV}, |
|000054a0| 7b 5c 74 74 20 4d 4f 44 | 7d 0d 0a 5c 69 74 65 6d |{\tt MOD|}..\item|
|000054b0| 20 64 79 61 64 69 63 20 | 7b 5c 74 74 20 2b 7d 2c | dyadic |{\tt +},|
|000054c0| 20 7b 5c 74 74 20 2d 7d | 0d 0a 5c 69 74 65 6d 20 | {\tt -}|..\item |
|000054d0| 7b 5c 74 74 20 3d 7d 2c | 20 7b 5c 74 74 20 3c 3e |{\tt =},| {\tt <>|
|000054e0| 7d 2c 20 7b 5c 74 74 20 | 3e 7d 2c 20 7b 5c 74 74 |}, {\tt |>}, {\tt|
|000054f0| 20 3e 3d 7d 2c 20 7b 5c | 74 74 20 3c 7d 2c 20 7b | >=}, {\|tt <}, {|
|00005500| 5c 74 74 20 3c 3d 7d 0d | 0a 5c 69 74 65 6d 20 7b |\tt <=}.|.\item {|
|00005510| 5c 74 74 20 41 4e 44 7d | 0d 0a 5c 69 74 65 6d 20 |\tt AND}|..\item |
|00005520| 7b 5c 74 74 20 4f 52 7d | 0d 0a 5c 69 74 65 6d 20 |{\tt OR}|..\item |
|00005530| 7b 5c 74 74 20 53 55 42 | 7d 0d 0a 5c 69 74 65 6d |{\tt SUB|}..\item|
|00005540| 20 7b 5c 74 74 20 49 4e | 43 52 7d 2c 20 7b 5c 74 | {\tt IN|CR}, {\t|
|00005550| 74 20 44 45 43 52 7d 2c | 20 7b 5c 74 74 20 43 41 |t DECR},| {\tt CA|
|00005560| 54 7d 0d 0a 5c 69 74 65 | 6d 20 74 68 65 20 61 73 |T}..\ite|m the as|
|00005570| 73 69 67 6e 6d 65 6e 74 | 20 6f 70 65 72 61 74 6f |signment| operato|
|00005580| 72 20 7b 5c 74 74 20 3a | 3d 7d 0d 0a 5c 65 6e 64 |r {\tt :|=}..\end|
|00005590| 7b 69 74 65 6d 69 7a 65 | 7d 0d 0a 0d 0a 5c 73 75 |{itemize|}....\su|
|000055a0| 62 73 65 63 74 69 6f 6e | 7b 41 73 73 69 67 6e 6d |bsection|{Assignm|
|000055b0| 65 6e 74 73 7d 0d 0a 0d | 0a 54 68 65 20 61 73 73 |ents}...|.The ass|
|000055c0| 69 67 6e 6d 65 6e 74 20 | 69 73 20 61 20 75 6e 69 |ignment |is a uni|
|000055d0| 74 20 6f 66 20 74 68 65 | 20 66 6f 72 6d 0d 0a 0d |t of the| form...|
|000055e0| 0a 5c 62 65 67 69 6e 7b | 65 6c 61 6e 7d 0d 0a 20 |.\begin{|elan}.. |
|000055f0| 20 20 20 20 20 20 20 76 | 61 72 20 3a 3d 20 65 78 | v|ar := ex|
|00005600| 70 72 0d 0a 5c 65 6e 64 | 7b 65 6c 61 6e 7d 0d 0a |pr..\end|{elan}..|
|00005610| 0d 0a 5c 6e 6f 69 6e 64 | 65 6e 74 0d 0a 77 68 65 |..\noind|ent..whe|
|00005620| 72 65 20 7b 5c 74 74 20 | 76 61 72 7d 20 69 73 20 |re {\tt |var} is |
|00005630| 61 20 76 61 72 69 61 62 | 6c 65 20 6f 66 20 73 6f |a variab|le of so|
|00005640| 6d 65 20 74 79 70 65 20 | 61 6e 64 20 7b 5c 74 74 |me type |and {\tt|
|00005650| 20 65 78 70 72 7d 20 61 | 6e 0d 0a 65 78 70 72 65 | expr} a|n..expre|
|00005660| 73 73 69 6f 6e 20 6f 66 | 20 74 68 65 20 73 61 6d |ssion of| the sam|
|00005670| 65 20 74 79 70 65 2e 0d | 0a 0d 0a 54 68 65 20 61 |e type..|...The a|
|00005680| 73 73 69 67 6e 6d 65 6e | 74 20 73 65 72 76 65 73 |ssignmen|t serves|
|00005690| 20 74 6f 20 63 68 61 6e | 67 65 20 74 68 65 20 76 | to chan|ge the v|
|000056a0| 61 6c 75 65 20 6f 66 20 | 74 68 65 20 76 61 72 69 |alue of |the vari|
|000056b0| 61 62 6c 65 2e 20 49 74 | 0d 0a 69 73 20 65 78 65 |able. It|..is exe|
|000056c0| 63 75 74 65 64 20 62 79 | 20 66 69 72 73 74 20 65 |cuted by| first e|
|000056d0| 78 65 63 75 74 69 6e 67 | 20 74 68 65 20 65 78 70 |xecuting| the exp|
|000056e0| 72 65 73 73 69 6f 6e 20 | 61 6e 64 20 74 68 65 6e |ression |and then|
|000056f0| 20 6d 61 6b 69 6e 67 0d | 0a 69 74 73 20 76 61 6c | making.|.its val|
|00005700| 75 65 20 74 68 65 20 6e | 65 77 20 76 61 6c 75 65 |ue the n|ew value|
|00005710| 20 6f 66 20 74 68 65 20 | 76 61 72 69 61 62 6c 65 | of the |variable|
|00005720| 2e 20 54 68 65 20 76 61 | 6c 75 65 20 6f 66 20 61 |. The va|lue of a|
|00005730| 6c 6c 20 6f 74 68 65 72 | 0d 0a 76 61 72 69 61 62 |ll other|..variab|
|00005740| 6c 65 73 20 72 65 6d 61 | 69 6e 73 20 75 6e 63 68 |les rema|ins unch|
|00005750| 61 6e 67 65 64 2e 0d 0a | 54 68 75 73 20 74 68 65 |anged...|Thus the|
|00005760| 20 61 73 73 69 67 6e 6d | 65 6e 74 0d 0a 0d 0a 5c | assignm|ent....\|
|00005770| 62 65 67 69 6e 7b 65 6c | 61 6e 7d 0d 0a 20 20 20 |begin{el|an}.. |
|00005780| 20 20 20 20 20 78 20 3a | 3d 20 78 20 2b 20 31 0d | x :|= x + 1.|
|00005790| 0a 5c 65 6e 64 7b 65 6c | 61 6e 7d 0d 0a 0d 0a 5c |.\end{el|an}....\|
|000057a0| 6e 6f 69 6e 64 65 6e 74 | 0d 0a 77 68 69 63 68 20 |noindent|..which |
|000057b0| 63 61 6e 20 62 65 20 72 | 65 61 64 20 61 73 20 60 |can be r|ead as `|
|000057c0| 60 78 20 62 65 63 6f 6d | 65 73 20 78 20 70 6c 75 |`x becom|es x plu|
|000057d0| 73 20 6f 6e 65 27 27 20 | 64 6f 65 73 20 6e 6f 74 |s one'' |does not|
|000057e0| 20 6d 65 61 6e 20 74 68 | 61 74 0d 0a 69 6e 20 73 | mean th|at..in s|
|000057f0| 6f 6d 65 20 63 75 72 69 | 6f 75 73 20 77 61 79 20 |ome curi|ous way |
|00005800| 7b 5c 74 74 20 78 7d 20 | 62 65 63 6f 6d 65 73 20 |{\tt x} |becomes |
|00005810| 65 71 75 61 6c 20 74 6f | 20 69 74 73 65 6c 66 20 |equal to| itself |
|00005820| 70 6c 75 73 20 6f 6e 65 | 2c 0d 0a 62 75 74 20 72 |plus one|,..but r|
|00005830| 61 74 68 65 72 20 74 68 | 61 74 20 66 69 72 73 74 |ather th|at first|
|00005840| 20 74 68 65 20 73 75 6d | 20 6f 66 20 74 68 65 20 | the sum| of the |
|00005850| 70 72 65 73 65 6e 74 20 | 76 61 6c 75 65 20 6f 66 |present |value of|
|00005860| 20 7b 5c 74 74 20 78 7d | 0d 0a 61 6e 64 20 6f 6e | {\tt x}|..and on|
|00005870| 65 20 69 73 20 63 6f 6d | 70 75 74 65 64 20 61 6e |e is com|puted an|
|00005880| 64 20 74 68 65 6e 20 74 | 68 61 74 20 76 61 6c 75 |d then t|hat valu|
|00005890| 65 20 69 73 20 6d 61 64 | 65 20 74 6f 20 62 65 20 |e is mad|e to be |
|000058a0| 74 68 65 20 6e 65 77 0d | 0a 76 61 6c 75 65 20 6f |the new.|.value o|
|000058b0| 66 20 7b 5c 74 74 20 78 | 7d 2e 0d 0a 0d 0a 5c 73 |f {\tt x|}.....\s|
|000058c0| 75 62 73 65 63 74 69 6f | 6e 7b 43 6f 6d 70 6f 73 |ubsectio|n{Compos|
|000058d0| 65 64 20 6f 62 6a 65 63 | 74 73 3a 20 72 6f 77 73 |ed objec|ts: rows|
|000058e0| 7d 0d 0a 0d 0a 49 6e 20 | 45 6c 61 6e 2d 30 20 74 |}....In |Elan-0 t|
|000058f0| 68 65 20 6f 6e 6c 79 20 | 63 6f 6d 70 6f 73 65 64 |he only |composed|
|00005900| 20 6f 62 6a 65 63 74 73 | 20 61 72 65 20 28 6f 6e | objects| are (on|
|00005910| 65 2d 64 69 6d 65 6e 73 | 69 6f 6e 61 6c 29 20 72 |e-dimens|ional) r|
|00005920| 6f 77 2d 76 61 72 69 61 | 62 6c 65 73 0d 0a 61 6e |ow-varia|bles..an|
|00005930| 64 20 72 6f 77 2d 63 6f | 6e 73 74 61 6e 74 73 2e |d row-co|nstants.|
|00005940| 20 41 20 64 65 63 6c 61 | 72 61 74 69 6f 6e 20 66 | A decla|ration f|
|00005950| 6f 72 20 61 20 72 6f 77 | 2d 76 61 72 69 61 62 6c |or a row|-variabl|
|00005960| 65 20 6c 6f 6f 6b 73 20 | 6c 69 6b 65 0d 0a 0d 0a |e looks |like....|
|00005970| 5c 62 65 67 69 6e 7b 6c | 69 74 65 72 61 6c 7d 0d |\begin{l|iteral}.|
|00005980| 0a 20 20 20 20 20 20 20 | 20 7b 5c 74 74 20 52 4f |. | {\tt RO|
|00005990| 57 20 35 20 49 4e 54 20 | 56 41 52 20 77 65 69 67 |W 5 INT |VAR weig|
|000059a0| 68 74 7d 0d 0a 20 20 20 | 20 20 20 20 20 7b 5c 74 |ht}.. | {\t|
|000059b0| 74 20 20 20 20 20 7c 20 | 20 7c 20 20 20 7c 20 20 |t | | | | |
|000059c0| 20 20 7c 5c 5f 5c 5f 5c | 5f 5c 5f 5c 5f 5c 5f 7d | |\_\_\|_\_\_\_}|
|000059d0| 6e 61 6d 65 20 6f 66 20 | 74 68 65 20 76 61 72 69 |name of |the vari|
|000059e0| 61 62 6c 65 0d 0a 20 20 | 20 20 20 20 20 20 7b 5c |able.. | {\|
|000059f0| 74 74 20 20 20 20 20 7c | 20 20 7c 20 20 20 7c 5c |tt || | |\|
|00005a00| 5f 5c 5f 5c 5f 5c 5f 5c | 5f 5c 5f 7d 61 63 63 65 |_\_\_\_\|_\_}acce|
|00005a10| 73 73 20 61 74 74 72 69 | 62 75 74 65 0d 0a 20 20 |ss attri|bute.. |
|00005a20| 20 20 20 20 20 20 7b 5c | 74 74 20 20 20 20 20 7c | {\|tt ||
|00005a30| 20 20 7c 5c 5f 5c 5f 5c | 5f 5c 5f 5c 5f 5c 5f 7d | |\_\_\|_\_\_\_}|
|00005a40| 74 79 70 65 20 6f 66 20 | 65 61 63 68 20 65 6c 65 |type of |each ele|
|00005a50| 6d 65 6e 74 0d 0a 20 20 | 20 20 20 20 20 20 7b 5c |ment.. | {\|
|00005a60| 74 74 20 20 20 20 20 7c | 5c 5f 5c 5f 5c 5f 5c 5f |tt ||\_\_\_\_|
|00005a70| 5c 5f 5c 5f 7d 6e 75 6d | 62 65 72 20 6f 66 20 65 |\_\_}num|ber of e|
|00005a80| 6c 65 6d 65 6e 74 73 0d | 0a 5c 65 6e 64 7b 6c 69 |lements.|.\end{li|
|00005a90| 74 65 72 61 6c 7d 0d 0a | 0d 0a 5c 6e 6f 69 6e 64 |teral}..|..\noind|
|00005aa0| 65 6e 74 0d 0a 41 66 74 | 65 72 20 74 68 69 73 20 |ent..Aft|er this |
|00005ab0| 64 65 63 6c 61 72 61 74 | 69 6f 6e 2c 20 74 68 65 |declarat|ion, the|
|00005ac0| 20 72 6f 77 2d 76 61 72 | 69 61 62 6c 65 20 7b 5c | row-var|iable {\|
|00005ad0| 74 74 20 77 65 69 67 68 | 74 7d 20 68 61 73 20 35 |tt weigh|t} has 5|
|00005ae0| 20 65 6c 65 6d 65 6e 74 | 73 2c 0d 0a 6e 75 6d 62 | element|s,..numb|
|00005af0| 65 72 65 64 20 66 72 6f | 6d 20 31 20 74 6f 20 35 |ered fro|m 1 to 5|
|00005b00| 2e 20 45 61 63 68 20 65 | 6c 65 6d 65 6e 74 20 68 |. Each e|lement h|
|00005b10| 61 73 20 61 6e 20 28 61 | 73 20 79 65 74 20 75 6e |as an (a|s yet un|
|00005b20| 64 65 66 69 6e 65 64 29 | 0d 0a 76 61 6c 75 65 20 |defined)|..value |
|00005b30| 6f 66 20 74 68 65 20 74 | 79 70 65 20 7b 5c 74 74 |of the t|ype {\tt|
|00005b40| 20 49 4e 54 7d 2e 0d 0a | 0d 0a 54 68 65 20 73 75 | INT}...|..The su|
|00005b50| 62 73 63 72 69 70 74 69 | 6f 6e 0d 0a 0d 0a 5c 62 |bscripti|on....\b|
|00005b60| 65 67 69 6e 7b 65 6c 61 | 6e 7d 0d 0a 20 20 20 20 |egin{ela|n}.. |
|00005b70| 20 20 20 20 72 6f 77 20 | 5b 20 69 20 5d 0d 0a 5c | row |[ i ]..\|
|00005b80| 65 6e 64 7b 65 6c 61 6e | 7d 0d 0a 0d 0a 5c 6e 6f |end{elan|}....\no|
|00005b90| 69 6e 64 65 6e 74 0d 0a | 64 65 6e 6f 74 65 73 20 |indent..|denotes |
|00005ba0| 69 74 73 20 7b 5c 74 74 | 20 69 7d 2d 74 68 20 65 |its {\tt| i}-th e|
|00005bb0| 6c 65 6d 65 6e 74 20 70 | 72 6f 76 69 64 65 64 20 |lement p|rovided |
|00005bc0| 74 68 65 20 76 61 6c 75 | 65 20 6f 66 20 74 68 65 |the valu|e of the|
|00005bd0| 20 65 78 70 72 65 73 73 | 69 6f 6e 0d 0a 7b 5c 74 | express|ion..{\t|
|00005be0| 74 20 69 7d 20 28 74 68 | 65 20 7b 5c 65 6d 20 69 |t i} (th|e {\em i|
|00005bf0| 6e 64 65 78 7d 29 20 69 | 73 20 62 65 74 77 65 65 |ndex}) i|s betwee|
|00005c00| 6e 20 6f 6e 65 20 61 6e | 64 20 74 68 65 20 6e 75 |n one an|d the nu|
|00005c10| 6d 62 65 72 20 6f 66 20 | 65 6c 65 6d 65 6e 74 73 |mber of |elements|
|00005c20| 2e 0d 0a 41 20 73 75 62 | 73 63 72 69 70 74 69 6f |...A sub|scriptio|
|00005c30| 6e 20 6f 66 20 61 20 72 | 6f 77 2d 76 61 72 69 61 |n of a r|ow-varia|
|00005c40| 62 6c 65 20 68 61 73 20 | 74 68 65 20 61 63 63 65 |ble has |the acce|
|00005c50| 73 73 20 61 74 74 72 69 | 62 75 74 65 20 7b 5c 74 |ss attri|bute {\t|
|00005c60| 74 20 56 41 52 7d 2c 0d | 0a 73 6f 20 69 74 20 63 |t VAR},.|.so it c|
|00005c70| 61 6e 20 62 65 20 61 73 | 73 69 67 6e 65 64 20 74 |an be as|signed t|
|00005c80| 6f 2c 20 65 2e 67 2e 0d | 0a 0d 0a 5c 62 65 67 69 |o, e.g..|...\begi|
|00005c90| 6e 7b 65 6c 61 6e 7d 0d | 0a 20 20 20 20 20 20 20 |n{elan}.|. |
|00005ca0| 20 77 65 69 67 68 74 20 | 5b 20 69 20 5d 20 3a 3d | weight |[ i ] :=|
|00005cb0| 20 31 34 34 0d 0a 5c 65 | 6e 64 7b 65 6c 61 6e 7d | 144..\e|nd{elan}|
|00005cc0| 0d 0a 0d 0a 5c 6e 6f 69 | 6e 64 65 6e 74 0d 0a 41 |....\noi|ndent..A|
|00005cd0| 66 74 65 72 20 74 68 69 | 73 20 61 73 73 69 67 6e |fter thi|s assign|
|00005ce0| 6d 65 6e 74 2c 20 74 68 | 65 20 65 6c 65 6d 65 6e |ment, th|e elemen|
|00005cf0| 74 20 77 68 6f 73 65 20 | 69 6e 64 65 78 20 69 73 |t whose |index is|
|00005d00| 20 65 71 75 61 6c 20 74 | 6f 20 74 68 65 0d 0a 76 | equal t|o the..v|
|00005d10| 61 6c 75 65 20 6f 66 20 | 7b 5c 74 74 20 69 7d 2c |alue of |{\tt i},|
|00005d20| 20 77 68 69 63 68 20 6d | 75 73 74 20 62 65 20 69 | which m|ust be i|
|00005d30| 6e 20 74 68 65 20 72 61 | 6e 67 65 20 7b 5c 74 74 |n the ra|nge {\tt|
|00005d40| 20 31 7d 20 74 6f 20 7b | 5c 74 74 20 35 7d 2c 0d | 1} to {|\tt 5},.|
|00005d50| 0a 69 73 20 65 71 75 61 | 6c 20 74 6f 20 7b 5c 74 |.is equa|l to {\t|
|00005d60| 74 20 31 34 34 7d 2e 20 | 53 69 6d 69 6c 61 72 6c |t 144}. |Similarl|
|00005d70| 79 2c 20 61 20 72 6f 77 | 2d 63 6f 6e 73 74 61 6e |y, a row|-constan|
|00005d80| 74 20 63 61 6e 20 62 65 | 20 64 65 63 6c 61 72 65 |t can be| declare|
|00005d90| 64 20 6c 69 6b 65 0d 0a | 0d 0a 5c 62 65 67 69 6e |d like..|..\begin|
|00005da0| 7b 65 6c 61 6e 7d 0d 0a | 20 20 20 20 20 20 20 20 |{elan}..| |
|00005db0| 52 4f 57 20 35 20 49 4e | 54 20 43 4f 4e 53 54 20 |ROW 5 IN|T CONST |
|00005dc0| 66 69 72 73 74 20 35 20 | 70 72 69 6d 65 73 20 3a |first 5 |primes :|
|00005dd0| 3a 5b 20 32 2c 20 33 2c | 20 35 2c 20 37 2c 20 31 |:[ 2, 3,| 5, 7, 1|
|00005de0| 31 20 5d 0d 0a 5c 65 6e | 64 7b 65 6c 61 6e 7d 0d |1 ]..\en|d{elan}.|
|00005df0| 0a 0d 0a 5c 6e 6f 69 6e | 64 65 6e 74 0d 0a 54 68 |...\noin|dent..Th|
|00005e00| 65 20 63 6f 6e 73 74 72 | 75 63 74 20 77 69 74 68 |e constr|uct with|
|00005e10| 20 74 68 65 20 73 71 75 | 61 72 65 20 62 72 61 63 | the squ|are brac|
|00005e20| 6b 65 74 73 20 69 6e 20 | 74 68 69 73 20 65 78 61 |kets in |this exa|
|00005e30| 6d 70 6c 65 20 69 73 20 | 61 20 7b 5c 65 6d 20 72 |mple is |a {\em r|
|00005e40| 6f 77 2d 64 69 73 70 6c | 61 79 7d 2c 0d 0a 77 68 |ow-displ|ay},..wh|
|00005e50| 69 63 68 20 61 63 74 73 | 20 61 73 20 61 20 64 65 |ich acts| as a de|
|00005e60| 6e 6f 74 61 74 69 6f 6e | 20 66 6f 72 20 61 20 72 |notation| for a r|
|00005e70| 6f 77 2e 20 41 73 20 77 | 69 74 68 20 6f 74 68 65 |ow. As w|ith othe|
|00005e80| 72 20 63 6f 6e 73 74 61 | 6e 74 0d 0a 64 65 63 6c |r consta|nt..decl|
|00005e90| 61 72 61 74 69 6f 6e 73 | 2c 20 74 68 65 20 69 6e |arations|, the in|
|00005ea0| 69 74 69 61 6c 69 7a 61 | 74 69 6f 6e 20 28 77 69 |itializa|tion (wi|
|00005eb0| 74 68 20 61 20 72 6f 77 | 2d 64 69 73 70 6c 61 79 |th a row|-display|
|00005ec0| 20 6f 72 20 61 6e 6f 74 | 68 65 72 0d 0a 72 6f 77 | or anot|her..row|
|00005ed0| 29 20 69 6e 20 61 20 72 | 6f 77 2d 63 6f 6e 73 74 |) in a r|ow-const|
|00005ee0| 61 6e 74 20 64 65 63 6c | 61 72 61 74 69 6f 6e 20 |ant decl|aration |
|00005ef0| 69 73 20 6f 62 6c 69 67 | 61 74 6f 72 79 2e 20 41 |is oblig|atory. A|
|00005f00| 20 73 75 62 73 63 72 69 | 70 74 69 6f 6e 0d 0a 66 | subscri|ption..f|
|00005f10| 72 6f 6d 20 61 20 72 6f | 77 2d 63 6f 6e 73 74 61 |rom a ro|w-consta|
|00005f20| 6e 74 20 68 61 73 20 74 | 68 65 20 61 63 63 65 73 |nt has t|he acces|
|00005f30| 73 20 61 74 74 72 69 62 | 75 74 65 20 7b 5c 74 74 |s attrib|ute {\tt|
|00005f40| 20 43 4f 4e 53 54 7d 2c | 20 73 6f 0d 0a 69 74 20 | CONST},| so..it |
|00005f50| 63 61 6e 20 6e 6f 74 20 | 62 65 20 61 73 73 69 67 |can not |be assig|
|00005f60| 6e 65 64 20 74 6f 2e 0d | 0a 0d 0a 41 70 61 72 74 |ned to..|...Apart|
|00005f70| 20 66 72 6f 6d 20 74 68 | 65 20 70 6f 73 73 69 62 | from th|e possib|
|00005f80| 69 6c 69 74 79 20 6f 66 | 20 6d 61 6e 69 70 75 6c |ility of| manipul|
|00005f90| 61 74 69 6e 67 20 69 6e | 64 69 76 69 64 75 61 6c |ating in|dividual|
|00005fa0| 20 65 6c 65 6d 65 6e 74 | 73 0d 0a 6f 66 20 61 20 | element|s..of a |
|00005fb0| 72 6f 77 2c 20 69 74 20 | 69 73 20 61 6c 73 6f 20 |row, it |is also |
|00005fc0| 70 6f 73 73 69 62 6c 65 | 20 74 6f 20 64 65 61 6c |possible| to deal|
|00005fd0| 20 77 69 74 68 20 74 68 | 65 20 72 6f 77 20 61 73 | with th|e row as|
|00005fe0| 20 61 20 77 68 6f 6c 65 | 2c 0d 0a 65 2e 67 2e 20 | a whole|,..e.g. |
|00005ff0| 69 6e 20 74 68 65 20 61 | 73 73 69 67 6e 6d 65 6e |in the a|ssignmen|
|00006000| 74 0d 0a 0d 0a 5c 62 65 | 67 69 6e 7b 65 6c 61 6e |t....\be|gin{elan|
|00006010| 7d 0d 0a 20 20 20 20 20 | 20 20 20 77 65 69 67 68 |}.. | weigh|
|00006020| 74 20 3a 3d 20 66 69 72 | 73 74 20 35 20 70 72 69 |t := fir|st 5 pri|
|00006030| 6d 65 73 0d 0a 5c 65 6e | 64 7b 65 6c 61 6e 7d 0d |mes..\en|d{elan}.|
|00006040| 0a 0d 0a 5c 6e 6f 69 6e | 64 65 6e 74 0d 0a 49 6e |...\noin|dent..In|
|00006050| 20 61 73 73 69 67 6e 6d | 65 6e 74 73 20 61 6e 64 | assignm|ents and|
|00006060| 20 69 6e 69 74 69 61 6c | 69 7a 61 74 69 6f 6e 73 | initial|izations|
|00006070| 2c 20 74 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |, the nu|mber of |
|00006080| 65 6c 65 6d 65 6e 74 73 | 20 69 6e 0d 0a 74 68 65 |elements| in..the|
|00006090| 20 6c 65 66 74 20 61 6e | 64 20 72 69 67 68 74 20 | left an|d right |
|000060a0| 68 61 6e 64 20 73 69 64 | 65 20 6d 75 73 74 20 6d |hand sid|e must m|
|000060b0| 61 74 63 68 2e 20 54 68 | 65 20 65 6c 65 6d 65 6e |atch. Th|e elemen|
|000060c0| 74 73 20 6f 66 20 61 20 | 72 6f 77 0d 0a 63 61 6e |ts of a |row..can|
|000060d0| 20 69 6e 20 74 68 65 69 | 72 20 74 75 72 6e 20 62 | in thei|r turn b|
|000060e0| 65 20 72 6f 77 73 20 61 | 67 61 69 6e 2c 20 77 69 |e rows a|gain, wi|
|000060f0| 74 68 20 61 20 64 65 63 | 6c 61 72 61 74 69 6f 6e |th a dec|laration|
|00006100| 20 6c 69 6b 65 0d 0a 0d | 0a 5c 62 65 67 69 6e 7b | like...|.\begin{|
|00006110| 65 6c 61 6e 7d 0d 0a 20 | 20 20 20 20 20 20 20 52 |elan}.. | R|
|00006120| 4f 57 20 31 30 20 52 4f | 57 20 32 30 20 49 4e 54 |OW 10 RO|W 20 INT|
|00006130| 20 74 61 62 6c 65 0d 0a | 5c 65 6e 64 7b 65 6c 61 | table..|\end{ela|
|00006140| 6e 7d 0d 0a 0d 0a 5c 6e | 6f 69 6e 64 65 6e 74 0d |n}....\n|oindent.|
|00006150| 0a 61 6e 64 20 61 20 73 | 75 62 73 63 72 69 70 74 |.and a s|ubscript|
|00006160| 69 6f 6e 20 6c 69 6b 65 | 0d 0a 0d 0a 5c 62 65 67 |ion like|....\beg|
|00006170| 69 6e 7b 65 6c 61 6e 7d | 0d 0a 20 20 20 20 20 20 |in{elan}|.. |
|00006180| 20 20 74 61 62 6c 65 20 | 5b 20 69 20 5d 5b 20 6a | table |[ i ][ j|
|00006190| 20 2b 20 31 20 5d 0d 0a | 5c 65 6e 64 7b 65 6c 61 | + 1 ]..|\end{ela|
|000061a0| 6e 7d 0d 0a 0d 0a 5c 6e | 6f 69 6e 64 65 6e 74 0d |n}....\n|oindent.|
|000061b0| 0a 70 72 6f 76 69 64 65 | 64 2c 20 6f 66 20 63 6f |.provide|d, of co|
|000061c0| 75 72 73 65 2c 20 74 68 | 61 74 20 7b 5c 74 74 20 |urse, th|at {\tt |
|000061d0| 31 20 3c 3d 20 69 20 3c | 3d 20 31 30 7d 20 61 6e |1 <= i <|= 10} an|
|000061e0| 64 20 7b 5c 74 74 20 31 | 20 3c 3d 20 6a 20 2b 20 |d {\tt 1| <= j + |
|000061f0| 31 20 3c 3d 20 32 30 7d | 2e 0d 0a 0d 0a 5c 73 75 |1 <= 20}|.....\su|
|00006200| 62 73 65 63 74 69 6f 6e | 7b 53 79 6e 6f 6e 79 6d |bsection|{Synonym|
|00006210| 20 64 65 63 6c 61 72 61 | 74 69 6f 6e 73 7d 0d 0a | declara|tions}..|
|00006220| 0d 0a 49 6e 20 45 6c 61 | 6e 20 74 68 65 20 6e 75 |..In Ela|n the nu|
|00006230| 6d 62 65 72 20 6f 66 20 | 65 6c 65 6d 65 6e 74 73 |mber of |elements|
|00006240| 20 28 60 60 75 70 70 65 | 72 2d 62 6f 75 6e 64 27 | (``uppe|r-bound'|
|00006250| 27 2c 20 60 60 63 61 72 | 64 69 6e 61 6c 69 74 79 |', ``car|dinality|
|00006260| 27 27 29 0d 0a 69 6e 20 | 61 20 72 6f 77 20 64 65 |'')..in |a row de|
|00006270| 63 6c 61 72 61 74 69 6f | 6e 20 6d 75 73 74 20 62 |claratio|n must b|
|00006280| 65 20 67 69 76 65 6e 20 | 62 79 20 61 20 64 65 6e |e given |by a den|
|00006290| 6f 74 61 74 69 6f 6e 2c | 20 74 68 61 74 20 69 73 |otation,| that is|
|000062a0| 2c 0d 0a 69 74 20 63 61 | 6e 20 6e 6f 74 20 62 65 |,..it ca|n not be|
|000062b0| 20 64 65 70 65 6e 64 65 | 6e 74 20 6f 6e 20 74 68 | depende|nt on th|
|000062c0| 65 20 65 78 65 63 75 74 | 69 6f 6e 20 6f 66 20 74 |e execut|ion of t|
|000062d0| 68 65 20 70 72 6f 67 72 | 61 6d 2e 20 41 20 72 6f |he progr|am. A ro|
|000062e0| 77 0d 0a 74 68 65 72 65 | 66 6f 72 65 20 68 61 73 |w..there|fore has|
|000062f0| 20 61 20 73 74 61 74 69 | 63 61 6c 6c 79 20 66 69 | a stati|cally fi|
|00006300| 78 65 64 20 6e 75 6d 62 | 65 72 20 6f 66 20 65 6c |xed numb|er of el|
|00006310| 65 6d 65 6e 74 73 2e 20 | 28 54 68 69 73 20 69 73 |ements. |(This is|
|00006320| 0d 0a 73 6f 6d 65 74 68 | 69 6e 67 20 6f 66 20 61 |..someth|ing of a|
|00006330| 20 6e 75 69 73 61 6e 63 | 65 20 62 75 74 20 72 65 | nuisanc|e but re|
|00006340| 66 6c 65 63 74 73 20 74 | 68 65 20 66 61 63 74 20 |flects t|he fact |
|00006350| 74 68 61 74 20 72 6f 77 | 73 20 69 6e 20 45 6c 61 |that row|s in Ela|
|00006360| 6e 0d 0a 64 6f 20 6e 6f | 74 20 73 65 72 76 65 20 |n..do no|t serve |
|00006370| 6c 69 6b 65 20 61 72 72 | 61 79 73 20 69 6e 20 6f |like arr|ays in o|
|00006380| 74 68 65 72 20 6c 61 6e | 67 75 61 67 65 73 2e 20 |ther lan|guages. |
|00006390| 54 68 65 79 20 61 72 65 | 20 69 6e 74 65 6e 64 65 |They are| intende|
|000063a0| 64 0d 0a 74 6f 20 62 65 | 20 73 6f 6d 65 77 68 61 |d..to be| somewha|
|000063b0| 74 20 69 6e 66 6c 65 78 | 69 62 6c 65 20 61 6e 64 |t inflex|ible and|
|000063c0| 20 70 72 69 6d 69 74 69 | 76 65 2c 20 61 6e 64 20 | primiti|ve, and |
|000063d0| 6d 6f 72 65 20 63 6f 6e | 76 65 6e 69 65 6e 74 0d |more con|venient.|
|000063e0| 0a 64 61 74 61 20 74 79 | 70 65 73 20 73 68 6f 75 |.data ty|pes shou|
|000063f0| 6c 64 20 62 65 20 62 75 | 69 6c 74 20 75 70 6f 6e |ld be bu|ilt upon|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.