home *** CD-ROM | disk | FTP | other *** search
/ Solo Programadores 22 / SOLO_22.iso / docs / faq / prog / part1 < prev    next >
Mailbox/MIME Entity  |  1996-04-24  |  32.1 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ISO-8859 text default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: Plain text[LF] default
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 73 65 | 6e 61 74 6f 72 2d 62 65 |Path: se|nator-be|
|00000010| 64 66 65 6c 6c 6f 77 2e | 6d 69 74 2e 65 64 75 21 |dfellow.|mit.edu!|
|00000020| 62 6c 6f 6f 6d 2d 62 65 | 61 63 6f 6e 2e 6d 69 74 |bloom-be|acon.mit|
|00000030| 2e 65 64 75 21 6e 65 77 | 73 2e 6b 65 69 2e 63 6f |.edu!new|s.kei.co|
|00000040| 6d 21 6e 6e 74 70 2e 63 | 6f 61 73 74 2e 6e 65 74 |m!nntp.c|oast.net|
|00000050| 21 73 77 69 64 69 72 2e | 73 77 69 74 63 68 2e 63 |!swidir.|switch.c|
|00000060| 68 21 65 70 66 6c 6e 65 | 77 73 21 64 69 6e 65 77 |h!epflne|ws!dinew|
|00000070| 73 2e 65 70 66 6c 2e 63 | 68 21 4d 61 67 6e 75 73 |s.epfl.c|h!Magnus|
|00000080| 2e 4b 65 6d 70 65 0a 46 | 72 6f 6d 3a 20 4d 61 67 |.Kempe.F|rom: Mag|
|00000090| 6e 75 73 2e 4b 65 6d 70 | 65 40 64 69 2e 65 70 66 |nus.Kemp|e@di.epf|
|000000a0| 6c 2e 63 68 20 28 4d 61 | 67 6e 75 73 20 4b 65 6d |l.ch (Ma|gnus Kem|
|000000b0| 70 65 29 0a 4e 65 77 73 | 67 72 6f 75 70 73 3a 20 |pe).News|groups: |
|000000c0| 63 6f 6d 70 2e 6c 61 6e | 67 2e 61 64 61 2c 63 6f |comp.lan|g.ada,co|
|000000d0| 6d 70 2e 61 6e 73 77 65 | 72 73 2c 6e 65 77 73 2e |mp.answe|rs,news.|
|000000e0| 61 6e 73 77 65 72 73 0a | 53 75 62 6a 65 63 74 3a |answers.|Subject:|
|000000f0| 20 41 64 61 20 46 41 51 | 3a 20 50 72 6f 67 72 61 | Ada FAQ|: Progra|
|00000100| 6d 6d 69 6e 67 20 77 69 | 74 68 20 41 64 61 20 28 |mming wi|th Ada (|
|00000110| 70 61 72 74 20 31 20 6f | 66 20 34 29 0a 46 6f 6c |part 1 o|f 4).Fol|
|00000120| 6c 6f 77 75 70 2d 54 6f | 3a 20 70 6f 73 74 65 72 |lowup-To|: poster|
|00000130| 0a 44 61 74 65 3a 20 31 | 37 20 4d 61 72 20 31 39 |.Date: 1|7 Mar 19|
|00000140| 39 36 20 31 34 3a 32 31 | 3a 35 38 20 47 4d 54 0a |96 14:21|:58 GMT.|
|00000150| 4f 72 67 61 6e 69 7a 61 | 74 69 6f 6e 3a 20 4e 6f |Organiza|tion: No|
|00000160| 6e 65 0a 4c 69 6e 65 73 | 3a 20 38 31 31 0a 53 65 |ne.Lines|: 811.Se|
|00000170| 6e 64 65 72 3a 20 6d 61 | 67 6e 75 73 40 6c 67 6c |nder: ma|gnus@lgl|
|00000180| 73 75 6e 34 2e 65 70 66 | 6c 2e 63 68 20 28 4d 61 |sun4.epf|l.ch (Ma|
|00000190| 67 6e 75 73 20 4b 65 6d | 70 65 29 0a 41 70 70 72 |gnus Kem|pe).Appr|
|000001a0| 6f 76 65 64 3a 20 6e 65 | 77 73 2d 61 6e 73 77 65 |oved: ne|ws-answe|
|000001b0| 72 73 2d 72 65 71 75 65 | 73 74 40 4d 49 54 2e 45 |rs-reque|st@MIT.E|
|000001c0| 44 55 0a 44 69 73 74 72 | 69 62 75 74 69 6f 6e 3a |DU.Distr|ibution:|
|000001d0| 20 77 6f 72 6c 64 0a 4d | 65 73 73 61 67 65 2d 49 | world.M|essage-I|
|000001e0| 44 3a 20 3c 34 69 68 37 | 36 36 24 66 71 32 40 64 |D: <4ih7|66$fq2@d|
|000001f0| 69 73 75 6e 6d 73 2e 65 | 70 66 6c 2e 63 68 3e 0a |isunms.e|pfl.ch>.|
|00000200| 52 65 70 6c 79 2d 54 6f | 3a 20 4d 61 67 6e 75 73 |Reply-To|: Magnus|
|00000210| 2e 4b 65 6d 70 65 40 64 | 69 2e 65 70 66 6c 2e 63 |.Kempe@d|i.epfl.c|
|00000220| 68 20 28 4d 61 67 6e 75 | 73 20 4b 65 6d 70 65 29 |h (Magnu|s Kempe)|
|00000230| 0a 4e 4e 54 50 2d 50 6f | 73 74 69 6e 67 2d 48 6f |.NNTP-Po|sting-Ho|
|00000240| 73 74 3a 20 6c 67 6c 73 | 75 6e 34 2e 65 70 66 6c |st: lgls|un4.epfl|
|00000250| 2e 63 68 0a 4d 69 6d 65 | 2d 56 65 72 73 69 6f 6e |.ch.Mime|-Version|
|00000260| 3a 20 31 2e 30 0a 43 6f | 6e 74 65 6e 74 2d 54 79 |: 1.0.Co|ntent-Ty|
|00000270| 70 65 3a 20 74 65 78 74 | 2f 70 6c 61 69 6e 3b 20 |pe: text|/plain; |
|00000280| 63 68 61 72 73 65 74 3d | 69 73 6f 2d 38 38 35 39 |charset=|iso-8859|
|00000290| 2d 31 0a 43 6f 6e 74 65 | 6e 74 2d 54 72 61 6e 73 |-1.Conte|nt-Trans|
|000002a0| 66 65 72 2d 45 6e 63 6f | 64 69 6e 67 3a 20 38 62 |fer-Enco|ding: 8b|
|000002b0| 69 74 0a 53 75 6d 6d 61 | 72 79 3a 20 41 64 61 20 |it.Summa|ry: Ada |
|000002c0| 50 72 6f 67 72 61 6d 6d | 65 72 27 73 20 46 72 65 |Programm|er's Fre|
|000002d0| 71 75 65 6e 74 6c 79 20 | 41 73 6b 65 64 20 51 75 |quently |Asked Qu|
|000002e0| 65 73 74 69 6f 6e 73 20 | 28 61 6e 64 20 61 6e 73 |estions |(and ans|
|000002f0| 77 65 72 73 29 2c 0a 20 | 20 20 20 20 20 20 20 20 |wers),. | |
|00000300| 20 20 70 61 72 74 20 31 | 20 6f 66 20 34 2e 0a 20 | part 1| of 4.. |
|00000310| 20 20 20 20 20 20 20 20 | 50 6c 65 61 73 65 20 72 | |Please r|
|00000320| 65 61 64 20 62 65 66 6f | 72 65 20 70 6f 73 74 69 |ead befo|re posti|
|00000330| 6e 67 2e 0a 4b 65 79 77 | 6f 72 64 73 3a 20 61 64 |ng..Keyw|ords: ad|
|00000340| 76 61 6e 63 65 64 20 6c | 61 6e 67 75 61 67 65 2c |vanced l|anguage,|
|00000350| 20 61 72 74 69 66 69 63 | 69 61 6c 20 6c 61 6e 67 | artific|ial lang|
|00000360| 75 61 67 65 73 2c 20 63 | 6f 6d 70 75 74 65 72 20 |uages, c|omputer |
|00000370| 73 6f 66 74 77 61 72 65 | 2c 0a 20 20 20 20 20 20 |software|,. |
|00000380| 20 20 20 20 64 61 74 61 | 20 70 72 6f 63 65 73 73 | data| process|
|00000390| 69 6e 67 2c 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 |ing, pro|gramming|
|000003a0| 20 6c 61 6e 67 75 61 67 | 65 73 2c 20 41 64 61 0a | languag|es, Ada.|
|000003b0| 58 72 65 66 3a 20 73 65 | 6e 61 74 6f 72 2d 62 65 |Xref: se|nator-be|
|000003c0| 64 66 65 6c 6c 6f 77 2e | 6d 69 74 2e 65 64 75 20 |dfellow.|mit.edu |
|000003d0| 63 6f 6d 70 2e 6c 61 6e | 67 2e 61 64 61 3a 34 32 |comp.lan|g.ada:42|
|000003e0| 34 37 35 20 63 6f 6d 70 | 2e 61 6e 73 77 65 72 73 |475 comp|.answers|
|000003f0| 3a 31 37 36 31 32 20 6e | 65 77 73 2e 61 6e 73 77 |:17612 n|ews.answ|
|00000400| 65 72 73 3a 36 37 31 37 | 36 0a 0a 41 72 63 68 69 |ers:6717|6..Archi|
|00000410| 76 65 2d 6e 61 6d 65 3a | 20 63 6f 6d 70 75 74 65 |ve-name:| compute|
|00000420| 72 2d 6c 61 6e 67 2f 41 | 64 61 2f 70 72 6f 67 72 |r-lang/A|da/progr|
|00000430| 61 6d 6d 69 6e 67 2f 70 | 61 72 74 31 0a 43 6f 6d |amming/p|art1.Com|
|00000440| 70 2d 6c 61 6e 67 2d 61 | 64 61 2d 61 72 63 68 69 |p-lang-a|da-archi|
|00000450| 76 65 2d 6e 61 6d 65 3a | 20 70 72 6f 67 72 61 6d |ve-name:| program|
|00000460| 6d 69 6e 67 2f 70 61 72 | 74 31 0a 50 6f 73 74 69 |ming/par|t1.Posti|
|00000470| 6e 67 2d 46 72 65 71 75 | 65 6e 63 79 3a 20 6d 6f |ng-Frequ|ency: mo|
|00000480| 6e 74 68 6c 79 0a 4c 61 | 73 74 2d 6d 6f 64 69 66 |nthly.La|st-modif|
|00000490| 69 65 64 3a 20 32 38 20 | 46 65 62 72 75 61 72 79 |ied: 28 |February|
|000004a0| 20 31 39 39 36 0a 4c 61 | 73 74 2d 70 6f 73 74 65 | 1996.La|st-poste|
|000004b0| 64 3a 20 32 36 20 4a 61 | 6e 75 61 72 79 20 31 39 |d: 26 Ja|nuary 19|
|000004c0| 39 36 0a 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |96.. | |
|000004d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000004e0| 20 20 20 41 64 61 20 50 | 72 6f 67 72 61 6d 6d 65 | Ada P|rogramme|
|000004f0| 72 27 73 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |r's. | |
|00000500| 20 20 20 20 20 20 20 20 | 20 20 20 46 72 65 71 75 | | Frequ|
|00000510| 65 6e 74 6c 79 20 41 73 | 6b 65 64 20 51 75 65 73 |ently As|ked Ques|
|00000520| 74 69 6f 6e 73 20 28 46 | 41 51 29 0a 0a 20 20 20 |tions (F|AQ).. |
|00000530| 49 4d 50 4f 52 54 41 4e | 54 20 4e 4f 54 45 3a 20 |IMPORTAN|T NOTE: |
|00000540| 4e 6f 20 46 41 51 20 63 | 61 6e 20 73 75 62 73 74 |No FAQ c|an subst|
|00000550| 69 74 75 74 65 20 66 6f | 72 20 72 65 61 6c 20 74 |itute fo|r real t|
|00000560| 65 61 63 68 69 6e 67 20 | 61 6e 64 0a 20 20 20 64 |eaching |and. d|
|00000570| 6f 63 75 6d 65 6e 74 61 | 74 69 6f 6e 2e 20 54 68 |ocumenta|tion. Th|
|00000580| 65 72 65 20 69 73 20 61 | 6e 20 61 6e 6e 6f 74 61 |ere is a|n annota|
|00000590| 74 65 64 20 6c 69 73 74 | 20 6f 66 20 41 64 61 20 |ted list| of Ada |
|000005a0| 62 6f 6f 6b 73 20 69 6e | 20 74 68 65 0a 20 20 20 |books in| the. |
|000005b0| 63 6f 6d 70 61 6e 69 6f | 6e 20 63 6f 6d 70 2e 6c |companio|n comp.l|
|000005c0| 61 6e 67 2e 61 64 61 20 | 46 41 51 2e 0a 0a 54 68 |ang.ada |FAQ...Th|
|000005d0| 69 73 20 69 73 20 70 61 | 72 74 20 31 20 6f 66 20 |is is pa|rt 1 of |
|000005e0| 61 20 34 2d 70 61 72 74 | 20 70 6f 73 74 69 6e 67 |a 4-part| posting|
|000005f0| 2e 0a 50 61 72 74 20 32 | 20 62 65 67 69 6e 73 20 |..Part 2| begins |
|00000600| 77 69 74 68 20 71 75 65 | 73 74 69 6f 6e 20 35 2e |with que|stion 5.|
|00000610| 0a 50 61 72 74 20 33 20 | 62 65 67 69 6e 73 20 77 |.Part 3 |begins w|
|00000620| 69 74 68 20 71 75 65 73 | 74 69 6f 6e 20 36 2e 0a |ith ques|tion 6..|
|00000630| 50 61 72 74 20 34 20 62 | 65 67 69 6e 73 20 77 69 |Part 4 b|egins wi|
|00000640| 74 68 20 71 75 65 73 74 | 69 6f 6e 20 39 2e 0a 54 |th quest|ion 9..T|
|00000650| 68 65 79 20 73 68 6f 75 | 6c 64 20 62 65 20 74 68 |hey shou|ld be th|
|00000660| 65 20 6e 65 78 74 20 70 | 6f 73 74 69 6e 67 73 20 |e next p|ostings |
|00000670| 69 6e 20 74 68 69 73 20 | 74 68 72 65 61 64 2e 0a |in this |thread..|
|00000680| 0a 20 20 20 20 52 65 63 | 65 6e 74 20 63 68 61 6e |. Rec|ent chan|
|00000690| 67 65 73 20 74 6f 20 74 | 68 69 73 20 46 41 51 20 |ges to t|his FAQ |
|000006a0| 61 72 65 20 6c 69 73 74 | 65 64 20 69 6e 20 74 68 |are list|ed in th|
|000006b0| 65 20 66 69 72 73 74 20 | 73 65 63 74 69 6f 6e 20 |e first |section |
|000006c0| 61 66 74 65 72 20 74 68 | 65 20 74 61 62 6c 65 0a |after th|e table.|
|000006d0| 20 20 20 20 6f 66 20 63 | 6f 6e 74 65 6e 74 73 20 | of c|ontents |
|000006e0| 28 69 6e 20 70 61 72 74 | 20 31 29 2e 20 54 68 69 |(in part| 1). Thi|
|000006f0| 73 20 64 6f 63 75 6d 65 | 6e 74 20 69 73 20 75 6e |s docume|nt is un|
|00000700| 64 65 72 20 65 78 70 6c | 69 63 69 74 20 63 6f 70 |der expl|icit cop|
|00000710| 79 72 69 67 68 74 2e 0a | 0a 0a 49 6e 74 72 6f 64 |yright..|..Introd|
|00000720| 75 63 74 69 6f 6e 0a 0a | 20 20 20 41 64 61 20 69 |uction..| Ada i|
|00000730| 73 20 61 6e 20 61 64 76 | 61 6e 63 65 64 2c 20 6d |s an adv|anced, m|
|00000740| 6f 64 65 72 6e 20 70 72 | 6f 67 72 61 6d 6d 69 6e |odern pr|ogrammin|
|00000750| 67 20 6c 61 6e 67 75 61 | 67 65 2c 20 64 65 73 69 |g langua|ge, desi|
|00000760| 67 6e 65 64 20 61 6e 64 | 0a 20 20 20 73 74 61 6e |gned and|. stan|
|00000770| 64 61 72 64 69 7a 65 64 | 20 74 6f 20 73 75 70 70 |dardized| to supp|
|00000780| 6f 72 74 20 61 6e 64 20 | 73 74 72 6f 6e 67 6c 79 |ort and |strongly|
|00000790| 20 65 6e 63 6f 75 72 61 | 67 65 20 77 69 64 65 6c | encoura|ge widel|
|000007a0| 79 20 72 65 63 6f 67 6e | 69 7a 65 64 0a 20 20 20 |y recogn|ized. |
|000007b0| 73 6f 66 74 77 61 72 65 | 20 65 6e 67 69 6e 65 65 |software| enginee|
|000007c0| 72 69 6e 67 20 70 72 69 | 6e 63 69 70 6c 65 73 3a |ring pri|nciples:|
|000007d0| 20 72 65 6c 69 61 62 69 | 6c 69 74 79 2c 20 70 6f | reliabi|lity, po|
|000007e0| 72 74 61 62 69 6c 69 74 | 79 2c 20 6d 6f 64 75 6c |rtabilit|y, modul|
|000007f0| 61 72 69 74 79 2c 0a 20 | 20 20 72 65 75 73 61 62 |arity,. | reusab|
|00000800| 69 6c 69 74 79 2c 20 70 | 72 6f 67 72 61 6d 6d 69 |ility, p|rogrammi|
|00000810| 6e 67 20 61 73 20 61 20 | 68 75 6d 61 6e 20 61 63 |ng as a |human ac|
|00000820| 74 69 76 69 74 79 2c 20 | 65 66 66 69 63 69 65 6e |tivity, |efficien|
|00000830| 63 79 2c 0a 20 20 20 6d | 61 69 6e 74 61 69 6e 61 |cy,. m|aintaina|
|00000840| 62 69 6c 69 74 79 2c 20 | 69 6e 66 6f 72 6d 61 74 |bility, |informat|
|00000850| 69 6f 6e 20 68 69 64 69 | 6e 67 2c 20 61 62 73 74 |ion hidi|ng, abst|
|00000860| 72 61 63 74 20 64 61 74 | 61 20 74 79 70 65 73 2c |ract dat|a types,|
|00000870| 20 67 65 6e 65 72 69 63 | 69 74 79 2c 0a 20 20 20 | generic|ity,. |
|00000880| 63 6f 6e 63 75 72 72 65 | 6e 74 20 70 72 6f 67 72 |concurre|nt progr|
|00000890| 61 6d 6d 69 6e 67 2c 20 | 6f 62 6a 65 63 74 2d 6f |amming, |object-o|
|000008a0| 72 69 65 6e 74 65 64 20 | 70 72 6f 67 72 61 6d 6d |riented |programm|
|000008b0| 69 6e 67 2c 20 65 74 63 | 2e 0a 0a 20 20 20 41 6c |ing, etc|... Al|
|000008c0| 6c 20 76 61 6c 69 64 61 | 74 65 64 20 41 64 61 20 |l valida|ted Ada |
|000008d0| 63 6f 6d 70 69 6c 65 72 | 73 20 28 69 2e 65 2e 20 |compiler|s (i.e. |
|000008e0| 61 20 68 75 67 65 20 6d | 61 6a 6f 72 69 74 79 20 |a huge m|ajority |
|000008f0| 6f 66 20 74 68 65 20 63 | 6f 6d 6d 65 72 63 69 61 |of the c|ommercia|
|00000900| 6c 0a 20 20 20 41 64 61 | 20 63 6f 6d 70 69 6c 65 |l. Ada| compile|
|00000910| 72 73 29 20 68 61 76 65 | 20 70 61 73 73 65 64 20 |rs) have| passed |
|00000920| 61 20 63 6f 6e 74 72 6f | 6c 6c 65 64 20 76 61 6c |a contro|lled val|
|00000930| 69 64 61 74 69 6f 6e 20 | 70 72 6f 63 65 73 73 20 |idation |process |
|00000940| 75 73 69 6e 67 20 61 6e | 0a 20 20 20 65 78 74 65 |using an|. exte|
|00000950| 6e 73 69 76 65 20 76 61 | 6c 69 64 61 74 69 6f 6e |nsive va|lidation|
|00000960| 20 73 75 69 74 65 2e 20 | 41 64 61 20 69 73 20 6e | suite. |Ada is n|
|00000970| 6f 74 20 61 20 73 75 70 | 65 72 73 65 74 20 6f 72 |ot a sup|erset or|
|00000980| 20 65 78 74 65 6e 73 69 | 6f 6e 20 6f 66 20 61 6e | extensi|on of an|
|00000990| 79 0a 20 20 20 6f 74 68 | 65 72 20 6c 61 6e 67 75 |y. oth|er langu|
|000009a0| 61 67 65 2e 20 41 64 61 | 20 64 6f 65 73 20 6e 6f |age. Ada| does no|
|000009b0| 74 20 61 6c 6c 6f 77 20 | 74 68 65 20 64 61 6e 67 |t allow |the dang|
|000009c0| 65 72 6f 75 73 20 70 72 | 61 63 74 69 63 65 73 20 |erous pr|actices |
|000009d0| 6f 72 20 65 66 66 65 63 | 74 73 0a 20 20 20 6f 66 |or effec|ts. of|
|000009e0| 20 6f 6c 64 20 6c 61 6e | 67 75 61 67 65 73 2c 20 | old lan|guages, |
|000009f0| 61 6c 74 68 6f 75 67 68 | 20 69 74 20 64 6f 65 73 |although| it does|
|00000a00| 20 70 72 6f 76 69 64 65 | 20 73 74 61 6e 64 61 72 | provide| standar|
|00000a10| 64 69 7a 65 64 20 6d 65 | 63 68 61 6e 69 73 6d 73 |dized me|chanisms|
|00000a20| 20 74 6f 0a 20 20 20 69 | 6e 74 65 72 66 61 63 65 | to. i|nterface|
|00000a30| 20 77 69 74 68 20 6f 74 | 68 65 72 20 6c 61 6e 67 | with ot|her lang|
|00000a40| 75 61 67 65 73 20 73 75 | 63 68 20 61 73 20 46 6f |uages su|ch as Fo|
|00000a50| 72 74 72 61 6e 2c 20 43 | 6f 62 6f 6c 2c 20 61 6e |rtran, C|obol, an|
|00000a60| 64 20 43 2e 0a 0a 20 20 | 20 41 64 61 20 69 73 20 |d C... | Ada is |
|00000a70| 72 65 63 6f 67 6e 69 7a | 65 64 20 61 73 20 61 6e |recogniz|ed as an|
|00000a80| 20 65 78 63 65 6c 6c 65 | 6e 74 20 76 65 68 69 63 | excelle|nt vehic|
|00000a90| 6c 65 20 66 6f 72 20 65 | 64 75 63 61 74 69 6f 6e |le for e|ducation|
|00000aa0| 20 69 6e 20 70 72 6f 67 | 72 61 6d 6d 69 6e 67 0a | in prog|ramming.|
|00000ab0| 20 20 20 61 6e 64 20 73 | 6f 66 74 77 61 72 65 20 | and s|oftware |
|00000ac0| 65 6e 67 69 6e 65 65 72 | 69 6e 67 2c 20 69 6e 63 |engineer|ing, inc|
|00000ad0| 6c 75 64 69 6e 67 20 66 | 6f 72 20 61 20 66 69 72 |luding f|or a fir|
|00000ae0| 73 74 20 70 72 6f 67 72 | 61 6d 6d 69 6e 67 20 63 |st progr|amming c|
|00000af0| 6f 75 72 73 65 2e 0a 0a | 20 20 20 41 64 61 20 69 |ourse...| Ada i|
|00000b00| 73 20 64 65 66 69 6e 65 | 64 20 62 79 20 61 6e 20 |s define|d by an |
|00000b10| 69 6e 74 65 72 6e 61 74 | 69 6f 6e 61 6c 20 73 74 |internat|ional st|
|00000b20| 61 6e 64 61 72 64 20 28 | 74 68 65 20 6c 61 6e 67 |andard (|the lang|
|00000b30| 75 61 67 65 20 72 65 66 | 65 72 65 6e 63 65 0a 20 |uage ref|erence. |
|00000b40| 20 20 6d 61 6e 75 61 6c | 2c 20 6f 72 20 4c 52 4d | manual|, or LRM|
|00000b50| 29 2c 20 77 68 69 63 68 | 20 68 61 73 20 62 65 65 |), which| has bee|
|00000b60| 6e 20 72 65 76 69 73 65 | 64 20 69 6e 20 31 39 39 |n revise|d in 199|
|00000b70| 35 2e 20 41 64 61 20 69 | 73 20 74 61 75 67 68 74 |5. Ada i|s taught|
|00000b80| 20 61 6e 64 0a 20 20 20 | 75 73 65 64 20 61 6c 6c | and. |used all|
|00000b90| 20 61 72 6f 75 6e 64 20 | 74 68 65 20 77 6f 72 6c | around |the worl|
|00000ba0| 64 20 28 6e 6f 74 20 6a | 75 73 74 20 69 6e 20 74 |d (not j|ust in t|
|00000bb0| 68 65 20 55 53 41 29 2e | 20 41 64 61 20 69 73 20 |he USA).| Ada is |
|00000bc0| 75 73 65 64 20 69 6e 20 | 61 20 76 65 72 79 0a 20 |used in |a very. |
|00000bd0| 20 20 77 69 64 65 20 72 | 61 6e 67 65 20 6f 66 20 | wide r|ange of |
|00000be0| 61 70 70 6c 69 63 61 74 | 69 6f 6e 73 3a 20 62 61 |applicat|ions: ba|
|00000bf0| 6e 6b 69 6e 67 2c 20 6d | 65 64 69 63 61 6c 20 64 |nking, m|edical d|
|00000c00| 65 76 69 63 65 73 2c 0a | 20 20 20 74 65 6c 65 63 |evices,.| telec|
|00000c10| 6f 6d 6d 75 6e 69 63 61 | 74 69 6f 6e 73 2c 20 61 |ommunica|tions, a|
|00000c20| 69 72 20 74 72 61 66 66 | 69 63 20 63 6f 6e 74 72 |ir traff|ic contr|
|00000c30| 6f 6c 2c 20 61 69 72 70 | 6c 61 6e 65 73 2c 20 72 |ol, airp|lanes, r|
|00000c40| 61 69 6c 72 6f 61 64 0a | 20 20 20 73 69 67 6e 61 |ailroad.| signa|
|00000c50| 6c 6c 69 6e 67 2c 20 73 | 61 74 65 6c 6c 69 74 65 |lling, s|atellite|
|00000c60| 73 2c 20 72 6f 63 6b 65 | 74 73 2c 20 65 74 63 2e |s, rocke|ts, etc.|
|00000c70| 0a 0a 20 20 20 54 68 65 | 20 6c 61 74 65 73 74 20 |.. The| latest |
|00000c80| 76 65 72 73 69 6f 6e 20 | 6f 66 20 74 68 69 73 20 |version |of this |
|00000c90| 46 41 51 20 69 73 20 61 | 6c 77 61 79 73 20 61 63 |FAQ is a|lways ac|
|00000ca0| 63 65 73 73 69 62 6c 65 | 20 74 68 72 6f 75 67 68 |cessible| through|
|00000cb0| 20 57 57 57 20 61 73 0a | 20 20 20 68 74 74 70 3a | WWW as.| http:|
|00000cc0| 2f 2f 6c 67 6c 77 77 77 | 2e 65 70 66 6c 2e 63 68 |//lglwww|.epfl.ch|
|00000cd0| 2f 41 64 61 2f 46 41 51 | 2f 70 72 6f 67 72 61 6d |/Ada/FAQ|/program|
|00000ce0| 6d 69 6e 67 2e 68 74 6d | 6c 23 74 69 74 6c 65 0a |ming.htm|l#title.|
|00000cf0| 0a 4d 61 69 6e 74 65 6e | 61 6e 63 65 0a 0a 20 20 |.Mainten|ance.. |
|00000d00| 20 54 68 69 73 20 46 41 | 51 20 69 73 20 6d 61 69 | This FA|Q is mai|
|00000d10| 6e 74 61 69 6e 65 64 20 | 6f 6e 20 61 6e 20 69 6e |ntained |on an in|
|00000d20| 64 69 76 69 64 75 61 6c | 20 76 6f 6c 75 6e 74 65 |dividual| volunte|
|00000d30| 65 72 20 62 61 73 69 73 | 2c 20 62 79 20 4d 61 67 |er basis|, by Mag|
|00000d40| 6e 75 73 0a 20 20 20 4b | 65 6d 70 65 20 28 4d 61 |nus. K|empe (Ma|
|00000d50| 67 6e 75 73 2e 4b 65 6d | 70 65 40 64 69 2e 65 70 |gnus.Kem|pe@di.ep|
|00000d60| 66 6c 2e 63 68 29 2e 20 | 5b 4e 6f 74 65 3a 20 54 |fl.ch). |[Note: T|
|00000d70| 68 69 73 20 69 73 20 64 | 6f 6e 65 20 61 73 20 61 |his is d|one as a|
|00000d80| 20 68 6f 62 62 79 2c 20 | 6e 6f 74 0a 20 20 20 69 | hobby, |not. i|
|00000d90| 6e 20 6d 79 20 63 61 70 | 61 63 69 74 79 20 61 73 |n my cap|acity as|
|00000da0| 20 61 6e 20 65 6d 70 6c | 6f 79 65 65 20 61 74 20 | an empl|oyee at |
|00000db0| 74 68 65 20 53 77 69 73 | 73 20 46 65 64 65 72 61 |the Swis|s Federa|
|00000dc0| 6c 20 49 6e 73 74 69 74 | 75 74 65 20 6f 66 0a 20 |l Instit|ute of. |
|00000dd0| 20 20 54 65 63 68 6e 6f | 6c 6f 67 79 2e 20 2d 2d | Techno|logy. --|
|00000de0| 4d 4b 5d 0a 0a 20 20 20 | 54 68 65 20 63 6f 64 69 |MK].. |The codi|
|00000df0| 6e 67 20 73 74 79 6c 65 | 20 75 73 65 64 20 69 6e |ng style| used in|
|00000e00| 20 6d 6f 73 74 20 6f 66 | 20 74 68 65 20 65 78 61 | most of| the exa|
|00000e10| 6d 70 6c 65 20 41 64 61 | 20 63 6f 64 65 20 69 73 |mple Ada| code is|
|00000e20| 20 6d 79 20 6f 77 6e 2c | 20 61 6e 64 0a 20 20 20 | my own,| and. |
|00000e30| 79 6f 75 27 6c 6c 20 68 | 61 76 65 20 74 6f 20 6c |you'll h|ave to l|
|00000e40| 69 76 65 20 77 69 74 68 | 20 69 74 20 28 79 6f 75 |ive with| it (you|
|00000e50| 20 6d 61 79 20 77 61 6e | 74 20 74 6f 20 61 64 6f | may wan|t to ado|
|00000e60| 70 74 20 69 74 20 3a 2d | 29 2e 0a 0a 0a 20 20 20 |pt it :-|).... |
|00000e70| 20 20 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f | ______|________|
|00000e80| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000e90| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000ea0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000eb0| 5f 5f 5f 0a 0a 20 20 20 | 4f 70 69 6e 69 6f 6e 73 |___.. |Opinions|
|00000ec0| 20 28 69 66 20 61 6e 79 | 29 20 65 78 70 72 65 73 | (if any|) expres|
|00000ed0| 73 65 64 20 61 72 65 20 | 74 68 6f 73 65 20 6f 66 |sed are |those of|
|00000ee0| 20 74 68 65 20 73 75 62 | 6d 69 74 74 65 72 73 20 | the sub|mitters |
|00000ef0| 61 6e 64 2f 6f 72 0a 20 | 20 20 6d 61 69 6e 74 61 |and/or. | mainta|
|00000f00| 69 6e 65 72 2e 0a 20 20 | 20 20 20 5f 5f 5f 5f 5f |iner.. | _____|
|00000f10| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000f20| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000f30| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000f40| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 0a 0a 54 61 |________|____..Ta|
|00000f50| 62 6c 65 20 6f 66 20 43 | 6f 6e 74 65 6e 74 73 3a |ble of C|ontents:|
|00000f60| 0a 0a 20 20 20 20 20 2a | 20 31 3a 20 52 65 63 65 |.. *| 1: Rece|
|00000f70| 6e 74 20 63 68 61 6e 67 | 65 73 20 74 6f 20 74 68 |nt chang|es to th|
|00000f80| 69 73 20 46 41 51 0a 0a | 20 20 20 20 20 2a 20 32 |is FAQ..| * 2|
|00000f90| 3a 20 49 6e 66 6f 72 6d | 61 74 69 6f 6e 20 61 62 |: Inform|ation ab|
|00000fa0| 6f 75 74 20 74 68 69 73 | 20 64 6f 63 75 6d 65 6e |out this| documen|
|00000fb0| 74 0a 0a 20 20 20 20 20 | 2a 20 33 3a 20 45 6c 65 |t.. |* 3: Ele|
|00000fc0| 6d 65 6e 74 61 72 79 20 | 51 75 65 73 74 69 6f 6e |mentary |Question|
|00000fd0| 73 0a 20 20 20 20 20 20 | 20 20 20 20 2b 20 33 2e |s. | + 3.|
|00000fe0| 31 3a 20 48 6f 77 20 64 | 6f 20 49 20 6d 61 6b 65 |1: How d|o I make|
|00000ff0| 20 6f 70 65 72 61 74 69 | 6f 6e 73 20 64 69 72 65 | operati|ons dire|
|00001000| 63 74 6c 79 20 76 69 73 | 69 62 6c 65 20 77 69 74 |ctly vis|ible wit|
|00001010| 68 6f 75 74 0a 20 20 20 | 20 20 20 20 20 20 20 20 |hout. | |
|00001020| 20 22 75 73 65 22 69 6e | 67 20 61 20 70 61 63 6b | "use"in|g a pack|
|00001030| 61 67 65 3f 0a 20 20 20 | 20 20 20 20 20 20 20 2b |age?. | +|
|00001040| 20 33 2e 32 3a 20 48 6f | 77 20 64 6f 20 49 20 61 | 3.2: Ho|w do I a|
|00001050| 73 73 69 67 6e 20 74 6f | 20 61 6e 20 61 72 72 61 |ssign to| an arra|
|00001060| 79 20 6f 66 20 6c 65 6e | 67 74 68 20 31 3f 0a 20 |y of len|gth 1?. |
|00001070| 20 20 20 20 20 20 20 20 | 20 2b 20 33 2e 33 3a 20 | | + 3.3: |
|00001080| 48 6f 77 20 64 6f 20 49 | 20 63 72 65 61 74 65 20 |How do I| create |
|00001090| 61 20 43 2d 73 74 79 6c | 65 20 6e 75 6c 2d 74 65 |a C-styl|e nul-te|
|000010a0| 72 6d 69 6e 61 74 65 64 | 20 73 74 72 69 6e 67 3f |rminated| string?|
|000010b0| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 33 2e 34 |. | + 3.4|
|000010c0| 3a 20 48 6f 77 20 63 61 | 6e 20 49 20 63 72 65 61 |: How ca|n I crea|
|000010d0| 74 65 20 61 6e 20 61 72 | 72 61 79 20 6f 66 20 73 |te an ar|ray of s|
|000010e0| 74 72 69 6e 67 73 20 6f | 66 20 76 61 72 69 6f 75 |trings o|f variou|
|000010f0| 73 20 6c 65 6e 67 74 68 | 3f 0a 20 20 20 20 20 20 |s length|?. |
|00001100| 20 20 20 20 2b 20 33 2e | 35 3a 20 49 20 6b 6e 6f | + 3.|5: I kno|
|00001110| 77 20 61 6e 20 65 78 63 | 65 70 74 69 6f 6e 20 69 |w an exc|eption i|
|00001120| 73 20 72 61 69 73 65 64 | 2c 20 62 75 74 20 6d 79 |s raised|, but my|
|00001130| 20 70 72 6f 67 72 61 6d | 20 71 75 69 74 73 20 77 | program| quits w|
|00001140| 69 74 68 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |ith. | |
|00001150| 6e 6f 20 77 61 72 6e 69 | 6e 67 2e 20 57 68 79 3f |no warni|ng. Why?|
|00001160| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 33 2e 36 |. | + 3.6|
|00001170| 3a 20 49 20 68 61 76 65 | 20 6f 6e 6c 79 20 6f 6e |: I have| only on|
|00001180| 65 20 74 61 73 6b 20 69 | 6e 20 6d 79 20 70 72 6f |e task i|n my pro|
|00001190| 67 72 61 6d 2c 20 62 75 | 74 20 69 74 20 64 6f 65 |gram, bu|t it doe|
|000011a0| 73 6e 27 74 20 73 65 65 | 6d 0a 20 20 20 20 20 20 |sn't see|m. |
|000011b0| 20 20 20 20 20 20 74 6f | 20 72 75 6e 2e 20 57 68 | to| run. Wh|
|000011c0| 79 3f 0a 20 20 20 20 20 | 20 20 20 20 20 2b 20 33 |y?. | + 3|
|000011d0| 2e 37 3a 20 48 6f 77 20 | 64 6f 20 49 20 69 6e 63 |.7: How |do I inc|
|000011e0| 72 65 61 73 65 20 74 68 | 65 20 73 74 61 63 6b 20 |rease th|e stack |
|000011f0| 73 69 7a 65 20 66 6f 72 | 20 61 20 74 61 73 6b 3f |size for| a task?|
|00001200| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 33 2e 38 |. | + 3.8|
|00001210| 3a 20 57 68 61 74 27 73 | 20 74 68 65 20 64 69 66 |: What's| the dif|
|00001220| 66 65 72 65 6e 63 65 20 | 62 65 74 77 65 65 6e 20 |ference |between |
|00001230| 61 20 74 79 70 65 20 63 | 6f 6e 76 65 72 73 69 6f |a type c|onversio|
|00001240| 6e 20 61 6e 64 20 61 0a | 20 20 20 20 20 20 20 20 |n and a.| |
|00001250| 20 20 20 20 71 75 61 6c | 69 66 69 65 72 3f 0a 20 | qual|ifier?. |
|00001260| 20 20 20 20 20 20 20 20 | 20 2b 20 33 2e 39 3a 20 | | + 3.9: |
|00001270| 48 6f 77 20 64 6f 20 49 | 20 61 76 6f 69 64 20 74 |How do I| avoid t|
|00001280| 68 65 20 70 6f 74 65 6e | 74 69 61 6c 20 73 70 61 |he poten|tial spa|
|00001290| 63 65 20 69 6e 20 66 72 | 6f 6e 74 20 6f 66 0a 20 |ce in fr|ont of. |
|000012a0| 20 20 20 20 20 20 20 20 | 20 20 20 49 6e 74 65 67 | | Integ|
|000012b0| 65 72 27 49 6d 61 67 65 | 3f 0a 20 20 20 20 20 20 |er'Image|?. |
|000012c0| 20 20 20 20 2b 20 33 2e | 31 30 3a 20 57 68 79 20 | + 3.|10: Why |
|000012d0| 69 73 20 61 6e 20 65 78 | 63 65 70 74 69 6f 6e 20 |is an ex|ception |
|000012e0| 72 61 69 73 65 64 20 77 | 68 65 6e 20 67 69 76 69 |raised w|hen givi|
|000012f0| 6e 67 20 61 20 64 65 66 | 61 75 6c 74 0a 20 20 20 |ng a def|ault. |
|00001300| 20 20 20 20 20 20 20 20 | 20 64 69 73 63 72 69 6d | | discrim|
|00001310| 69 6e 61 6e 74 3f 0a 20 | 20 20 20 20 20 20 20 20 |inant?. | |
|00001320| 20 2b 20 33 2e 31 31 3a | 20 57 68 65 6e 20 49 20 | + 3.11:| When I |
|00001330| 77 61 6e 74 20 61 6e 20 | 49 6e 74 65 67 65 72 20 |want an |Integer |
|00001340| 74 79 70 65 2c 20 77 68 | 61 74 27 73 20 77 72 6f |type, wh|at's wro|
|00001350| 6e 67 20 77 69 74 68 20 | 6a 75 73 74 0a 20 20 20 |ng with |just. |
|00001360| 20 20 20 20 20 20 20 20 | 20 75 73 69 6e 67 20 74 | | using t|
|00001370| 68 65 20 70 72 65 64 65 | 66 69 6e 65 64 20 74 79 |he prede|fined ty|
|00001380| 70 65 20 49 6e 74 65 67 | 65 72 20 6f 72 20 4c 6f |pe Integ|er or Lo|
|00001390| 6e 67 5f 49 6e 74 65 67 | 65 72 3f 20 57 68 79 20 |ng_Integ|er? Why |
|000013a0| 77 6f 75 6c 64 0a 20 20 | 20 20 20 20 20 20 20 20 |would. | |
|000013b0| 20 20 49 20 65 76 65 72 | 20 77 61 6e 74 20 74 6f | I ever| want to|
|000013c0| 20 64 65 63 6c 61 72 65 | 20 6e 65 77 20 49 6e 74 | declare| new Int|
|000013d0| 65 67 65 72 20 74 79 70 | 65 73 3f 0a 20 20 20 20 |eger typ|es?. |
|000013e0| 20 20 20 20 20 20 2b 20 | 33 2e 31 32 3a 20 53 69 | + |3.12: Si|
|000013f0| 6e 63 65 20 49 20 63 61 | 6e 20 61 6c 77 61 79 73 |nce I ca|n always|
|00001400| 20 64 65 63 6c 61 72 65 | 20 6d 79 20 6f 77 6e 20 | declare| my own |
|00001410| 70 6f 72 74 61 62 6c 65 | 20 69 6e 74 65 67 65 72 |portable| integer|
|00001420| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 74 79 70 |. | typ|
|00001430| 65 73 2c 20 77 68 79 20 | 77 6f 75 6c 64 20 49 20 |es, why |would I |
|00001440| 65 76 65 72 20 77 61 6e | 74 20 74 6f 20 75 73 65 |ever wan|t to use|
|00001450| 20 74 68 65 20 70 72 65 | 64 65 66 69 6e 65 64 20 | the pre|defined |
|00001460| 74 79 70 65 0a 20 20 20 | 20 20 20 20 20 20 20 20 |type. | |
|00001470| 20 49 6e 74 65 67 65 72 | 3f 0a 20 20 20 20 20 20 | Integer|?. |
|00001480| 20 20 20 20 2b 20 33 2e | 31 33 3a 20 49 20 61 6d | + 3.|13: I am|
|00001490| 20 6c 65 61 72 6e 69 6e | 67 20 41 64 61 2e 20 43 | learnin|g Ada. C|
|000014a0| 61 6e 20 49 20 65 78 70 | 65 72 69 6d 65 6e 74 20 |an I exp|eriment |
|000014b0| 77 69 74 68 20 61 20 67 | 61 6d 65 0a 20 20 20 20 |with a g|ame. |
|000014c0| 20 20 20 20 20 20 20 20 | 70 72 6f 67 72 61 6d 3f | |program?|
|000014d0| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 33 2e 31 |. | + 3.1|
|000014e0| 34 3a 20 48 6f 77 20 63 | 61 6e 20 49 20 64 6f 20 |4: How c|an I do |
|000014f0| 61 20 6e 6f 6e 2d 62 6c | 6f 63 6b 69 6e 67 2c 20 |a non-bl|ocking, |
|00001500| 6b 65 79 73 74 72 6f 6b | 65 2d 61 74 2d 61 2d 74 |keystrok|e-at-a-t|
|00001510| 69 6d 65 20 72 65 61 64 | 0a 20 20 20 20 20 20 20 |ime read|. |
|00001520| 20 20 20 20 20 66 72 6f | 6d 20 74 68 65 20 74 65 | fro|m the te|
|00001530| 72 6d 69 6e 61 6c 3f 0a | 0a 0a 20 20 20 20 20 2a |rminal?.|.. *|
|00001540| 20 34 3a 20 41 64 76 61 | 6e 74 61 67 65 73 20 6f | 4: Adva|ntages o|
|00001550| 66 20 41 64 61 0a 20 20 | 20 20 20 20 20 20 20 20 |f Ada. | |
|00001560| 2b 20 34 2e 31 3a 20 57 | 68 79 20 75 73 65 20 41 |+ 4.1: W|hy use A|
|00001570| 64 61 3f 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |da?. | + |
|00001580| 34 2e 32 3a 20 41 64 61 | 20 73 65 65 6d 73 20 6c |4.2: Ada| seems l|
|00001590| 61 72 67 65 20 61 6e 64 | 20 63 6f 6d 70 6c 65 78 |arge and| complex|
|000015a0| 2c 20 77 68 79 20 69 73 | 20 69 74 20 74 68 69 73 |, why is| it this|
|000015b0| 20 77 61 79 3f 0a 20 20 | 20 20 20 20 20 20 20 20 | way?. | |
|000015c0| 2b 20 34 2e 33 3a 20 49 | 73 20 74 68 65 72 65 20 |+ 4.3: I|s there |
|000015d0| 61 20 63 6f 6e 74 65 73 | 74 20 77 69 74 68 20 66 |a contes|t with f|
|000015e0| 61 6d 65 20 61 6e 64 20 | 6d 6f 6e 65 79 20 66 6f |ame and |money fo|
|000015f0| 72 20 67 6f 6f 64 20 41 | 64 61 0a 20 20 20 20 20 |r good A|da. |
|00001600| 20 20 20 20 20 20 20 70 | 72 6f 67 72 61 6d 6d 65 | p|rogramme|
|00001610| 72 73 3f 0a 0a 0a 20 20 | 20 20 20 2a 20 35 3a 20 |rs?... | * 5: |
|00001620| 4f 62 6a 65 63 74 2d 4f | 72 69 65 6e 74 65 64 20 |Object-O|riented |
|00001630| 50 72 6f 67 72 61 6d 6d | 69 6e 67 20 77 69 74 68 |Programm|ing with|
|00001640| 20 41 64 61 0a 20 20 20 | 20 20 20 20 20 20 20 2b | Ada. | +|
|00001650| 20 35 2e 31 3a 20 57 68 | 79 20 64 6f 65 73 20 41 | 5.1: Wh|y does A|
|00001660| 64 61 20 68 61 76 65 20 | 22 74 61 67 67 65 64 20 |da have |"tagged |
|00001670| 74 79 70 65 73 22 20 69 | 6e 73 74 65 61 64 20 6f |types" i|nstead o|
|00001680| 66 20 63 6c 61 73 73 65 | 73 3f 0a 20 20 20 20 20 |f classe|s?. |
|00001690| 20 20 20 20 20 2b 20 35 | 2e 32 3a 20 56 61 72 69 | + 5|.2: Vari|
|000016a0| 61 6e 74 20 72 65 63 6f | 72 64 73 20 73 65 65 6d |ant reco|rds seem|
|000016b0| 20 6c 69 6b 65 20 61 20 | 64 65 61 64 20 66 65 61 | like a |dead fea|
|000016c0| 74 75 72 65 20 6e 6f 77 | 2e 20 57 68 65 6e 0a 20 |ture now|. When. |
|000016d0| 20 20 20 20 20 20 20 20 | 20 20 20 73 68 6f 75 6c | | shoul|
|000016e0| 64 20 49 20 75 73 65 20 | 74 68 65 6d 20 69 6e 73 |d I use |them ins|
|000016f0| 74 65 61 64 20 6f 66 20 | 74 61 67 67 65 64 20 74 |tead of |tagged t|
|00001700| 79 70 65 73 3f 0a 20 20 | 20 20 20 20 20 20 20 20 |ypes?. | |
|00001710| 2b 20 35 2e 33 3a 20 57 | 68 61 74 20 69 73 20 6d |+ 5.3: W|hat is m|
|00001720| 65 61 6e 74 20 62 79 20 | 22 69 6e 74 65 72 66 61 |eant by |"interfa|
|00001730| 63 65 20 69 6e 68 65 72 | 69 74 61 6e 63 65 22 20 |ce inher|itance" |
|00001740| 61 6e 64 20 68 6f 77 20 | 64 6f 65 73 0a 20 20 20 |and how |does. |
|00001750| 20 20 20 20 20 20 20 20 | 20 41 64 61 20 73 75 70 | | Ada sup|
|00001760| 70 6f 72 74 20 69 74 3f | 0a 20 20 20 20 20 20 20 |port it?|. |
|00001770| 20 20 20 2b 20 35 2e 34 | 3a 20 48 6f 77 20 64 6f | + 5.4|: How do|
|00001780| 20 79 6f 75 20 64 6f 20 | 6d 75 6c 74 69 70 6c 65 | you do |multiple|
|00001790| 20 69 6e 68 65 72 69 74 | 61 6e 63 65 20 69 6e 20 | inherit|ance in |
|000017a0| 41 64 61 20 39 58 3f 0a | 20 20 20 20 20 20 20 20 |Ada 9X?.| |
|000017b0| 20 20 2b 20 35 2e 35 3a | 20 57 68 79 20 61 72 65 | + 5.5:| Why are|
|000017c0| 20 43 6f 6e 74 72 6f 6c | 6c 65 64 20 74 79 70 65 | Control|led type|
|000017d0| 73 20 73 6f 2c 20 77 65 | 6c 6c 2c 20 73 74 72 61 |s so, we|ll, stra|
|000017e0| 6e 67 65 3f 0a 20 20 20 | 20 20 20 20 20 20 20 2b |nge?. | +|
|000017f0| 20 35 2e 36 3a 20 57 68 | 61 74 20 64 6f 20 22 63 | 5.6: Wh|at do "c|
|00001800| 6f 76 61 72 69 61 6e 63 | 65 22 20 61 6e 64 20 22 |ovarianc|e" and "|
|00001810| 63 6f 6e 74 72 61 76 61 | 72 69 61 6e 63 65 22 20 |contrava|riance" |
|00001820| 6d 65 61 6e 2c 20 61 6e | 64 20 64 6f 65 73 0a 20 |mean, an|d does. |
|00001830| 20 20 20 20 20 20 20 20 | 20 20 20 41 64 61 20 73 | | Ada s|
|00001840| 75 70 70 6f 72 74 20 65 | 69 74 68 65 72 20 6f 72 |upport e|ither or|
|00001850| 20 62 6f 74 68 3f 0a 20 | 20 20 20 20 20 20 20 20 | both?. | |
|00001860| 20 2b 20 35 2e 37 3a 20 | 57 68 61 74 20 69 73 20 | + 5.7: |What is |
|00001870| 6d 65 61 6e 74 20 62 79 | 20 75 70 63 61 73 74 69 |meant by| upcasti|
|00001880| 6e 67 2f 65 78 70 61 6e | 64 69 6e 67 20 61 6e 64 |ng/expan|ding and|
|00001890| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 64 6f 77 |. | dow|
|000018a0| 6e 63 61 73 74 69 6e 67 | 2f 6e 61 72 72 6f 77 69 |ncasting|/narrowi|
|000018b0| 6e 67 3f 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |ng?. | + |
|000018c0| 35 2e 38 3a 20 48 6f 77 | 20 64 6f 65 73 20 41 64 |5.8: How| does Ad|
|000018d0| 61 20 64 6f 20 22 6e 61 | 72 72 6f 77 69 6e 67 22 |a do "na|rrowing"|
|000018e0| 3f 0a 20 20 20 20 20 20 | 20 20 20 20 2b 20 35 2e |?. | + 5.|
|000018f0| 39 3a 20 57 68 61 74 20 | 69 73 20 74 68 65 20 64 |9: What |is the d|
|00001900| 69 66 66 65 72 65 6e 63 | 65 20 62 65 74 77 65 65 |ifferenc|e betwee|
|00001910| 6e 20 61 20 63 6c 61 73 | 73 2d 77 69 64 65 20 61 |n a clas|s-wide a|
|00001920| 63 63 65 73 73 20 74 79 | 70 65 0a 20 20 20 20 20 |ccess ty|pe. |
|00001930| 20 20 20 20 20 20 20 61 | 6e 64 20 61 20 22 67 65 | a|nd a "ge|
|00001940| 6e 65 72 61 6c 22 20 63 | 6c 61 73 73 2d 77 69 64 |neral" c|lass-wid|
|00001950| 65 20 61 63 63 65 73 73 | 20 74 79 70 65 3f 0a 0a |e access| type?..|
|00001960| 0a 20 20 20 20 20 2a 20 | 36 3a 20 41 64 61 20 4e |. * |6: Ada N|
|00001970| 75 6d 65 72 69 63 73 0a | 20 20 20 20 20 20 20 20 |umerics.| |
|00001980| 20 20 2b 20 36 2e 31 3a | 20 57 68 65 72 65 20 63 | + 6.1:| Where c|
|00001990| 61 6e 20 49 20 66 69 6e | 64 20 61 6e 6f 6e 79 6d |an I fin|d anonym|
|000019a0| 6f 75 73 20 66 74 70 20 | 73 69 74 65 73 20 66 6f |ous ftp |sites fo|
|000019b0| 72 20 41 64 61 20 6d 61 | 74 68 0a 20 20 20 20 20 |r Ada ma|th. |
|000019c0| 20 20 20 20 20 20 20 70 | 61 63 6b 61 67 65 73 3f | p|ackages?|
|000019d0| 20 49 6e 20 70 61 72 74 | 69 63 75 6c 61 72 20 77 | In part|icular w|
|000019e0| 68 65 72 65 20 61 72 65 | 20 74 68 65 20 72 61 6e |here are| the ran|
|000019f0| 64 6f 6d 20 6e 75 6d 62 | 65 72 0a 20 20 20 20 20 |dom numb|er. |
|00001a00| 20 20 20 20 20 20 20 67 | 65 6e 65 72 61 74 6f 72 | g|enerator|
|00001a10| 73 3f 0a 20 20 20 20 20 | 20 20 20 20 20 2b 20 36 |s?. | + 6|
|00001a20| 2e 32 3a 20 48 6f 77 20 | 63 61 6e 20 49 20 77 72 |.2: How |can I wr|
|00001a30| 69 74 65 20 70 6f 72 74 | 61 62 6c 65 20 63 6f 64 |ite port|able cod|
|00001a40| 65 20 69 6e 20 41 64 61 | 20 38 33 20 75 73 69 6e |e in Ada| 83 usin|
|00001a50| 67 20 70 72 65 64 65 66 | 69 6e 65 64 0a 20 20 20 |g predef|ined. |
|00001a60| 20 20 20 20 20 20 20 20 | 20 74 79 70 65 73 20 6c | | types l|
|00001a70| 69 6b 65 20 46 6c 6f 61 | 74 20 61 6e 64 20 4c 6f |ike Floa|t and Lo|
|00001a80| 6e 67 5f 46 6c 6f 61 74 | 3f 20 4c 69 6b 65 77 69 |ng_Float|? Likewi|
|00001a90| 73 65 2c 20 68 6f 77 20 | 63 61 6e 20 49 20 77 72 |se, how |can I wr|
|00001aa0| 69 74 65 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |ite. | |
|00001ab0| 70 6f 72 74 61 62 6c 65 | 20 63 6f 64 65 20 74 68 |portable| code th|
|00001ac0| 61 74 20 75 73 65 73 20 | 4d 61 74 68 20 66 75 6e |at uses |Math fun|
|00001ad0| 63 74 69 6f 6e 73 20 6c | 69 6b 65 20 53 69 6e 20 |ctions l|ike Sin |
|00001ae0| 61 6e 64 20 4c 6f 67 20 | 74 68 61 74 0a 20 20 20 |and Log |that. |
|00001af0| 20 20 20 20 20 20 20 20 | 20 61 72 65 20 64 65 66 | | are def|
|00001b00| 69 6e 65 64 20 66 6f 72 | 20 46 6c 6f 61 74 20 61 |ined for| Float a|
|00001b10| 6e 64 20 4c 6f 6e 67 5f | 46 6c 6f 61 74 3f 0a 20 |nd Long_|Float?. |
|00001b20| 20 20 20 20 20 20 20 20 | 20 2b 20 36 2e 33 3a 20 | | + 6.3: |
|00001b30| 49 73 20 41 64 61 20 61 | 6e 79 20 67 6f 6f 64 20 |Is Ada a|ny good |
|00001b40| 61 74 20 6e 75 6d 65 72 | 69 63 73 2c 20 61 6e 64 |at numer|ics, and|
|00001b50| 20 77 68 65 72 65 20 63 | 61 6e 20 49 20 6c 65 61 | where c|an I lea|
|00001b60| 72 6e 20 6d 6f 72 65 0a | 20 20 20 20 20 20 20 20 |rn more.| |
|00001b70| 20 20 20 20 61 62 6f 75 | 74 20 69 74 3f 0a 20 20 | abou|t it?. |
|00001b80| 20 20 20 20 20 20 20 20 | 2b 20 36 2e 34 3a 20 48 | |+ 6.4: H|
|00001b90| 6f 77 20 64 6f 20 49 20 | 67 65 74 20 52 65 61 6c |ow do I |get Real|
|00001ba0| 20 76 61 6c 75 65 64 20 | 61 6e 64 20 43 6f 6d 70 | valued |and Comp|
|00001bb0| 6c 65 78 20 76 61 6c 75 | 65 64 20 6d 61 74 68 0a |lex valu|ed math.|
|00001bc0| 20 20 20 20 20 20 20 20 | 20 20 20 20 66 75 6e 63 | | func|
|00001bd0| 74 69 6f 6e 73 20 69 6e | 20 41 64 61 20 39 35 3f |tions in| Ada 95?|
|00001be0| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 36 2e 35 |. | + 6.5|
|00001bf0| 3a 20 57 68 61 74 20 6c | 69 62 72 61 72 69 65 73 |: What l|ibraries|
|00001c00| 20 6f 72 20 70 75 62 6c | 69 63 20 61 6c 67 6f 72 | or publ|ic algor|
|00001c10| 69 74 68 6d 73 20 65 78 | 69 73 74 20 66 6f 72 20 |ithms ex|ist for |
|00001c20| 41 64 61 3f 0a 0a 0a 20 | 20 20 20 20 2a 20 37 3a |Ada?... | * 7:|
|00001c30| 20 45 66 66 69 63 69 65 | 6e 63 79 20 6f 66 20 41 | Efficie|ncy of A|
|00001c40| 64 61 20 43 6f 6e 73 74 | 72 75 63 74 73 0a 20 20 |da Const|ructs. |
|00001c50| 20 20 20 20 20 20 20 20 | 2b 20 37 2e 31 3a 20 48 | |+ 7.1: H|
|00001c60| 6f 77 20 6d 75 63 68 20 | 65 78 74 72 61 20 6f 76 |ow much |extra ov|
|00001c70| 65 72 68 65 61 64 20 64 | 6f 20 67 65 6e 65 72 69 |erhead d|o generi|
|00001c80| 63 73 20 68 61 76 65 3f | 0a 0a 0a 20 20 20 20 20 |cs have?|... |
|00001c90| 2a 20 38 3a 20 41 64 76 | 61 6e 63 65 64 20 50 72 |* 8: Adv|anced Pr|
|00001ca0| 6f 67 72 61 6d 6d 69 6e | 67 20 54 65 63 68 6e 69 |ogrammin|g Techni|
|00001cb0| 71 75 65 73 20 77 69 74 | 68 20 41 64 61 0a 20 20 |ques wit|h Ada. |
|00001cc0| 20 20 20 20 20 20 20 20 | 2b 20 38 2e 31 3a 20 48 | |+ 8.1: H|
|00001cd0| 6f 77 20 63 61 6e 20 49 | 20 72 65 64 65 66 69 6e |ow can I| redefin|
|00001ce0| 65 20 74 68 65 20 61 73 | 73 69 67 6e 6d 65 6e 74 |e the as|signment|
|00001cf0| 20 6f 70 65 72 61 74 69 | 6f 6e 3f 0a 20 20 20 20 | operati|on?. |
|00001d00| 20 20 20 20 20 20 2b 20 | 38 2e 32 3a 20 44 6f 65 | + |8.2: Doe|
|00001d10| 73 20 41 64 61 20 68 61 | 76 65 20 61 75 74 6f 6d |s Ada ha|ve autom|
|00001d20| 61 74 69 63 20 63 6f 6e | 73 74 72 75 63 74 6f 72 |atic con|structor|
|00001d30| 73 20 61 6e 64 20 64 65 | 73 74 72 75 63 74 6f 72 |s and de|structor|
|00001d40| 73 3f 0a 20 20 20 20 20 | 20 20 20 20 20 2b 20 38 |s?. | + 8|
|00001d50| 2e 33 3a 20 53 68 6f 75 | 6c 64 20 49 20 73 74 69 |.3: Shou|ld I sti|
|00001d60| 63 6b 20 74 6f 20 61 20 | 6f 6e 65 20 70 61 63 6b |ck to a |one pack|
|00001d70| 61 67 65 2c 20 6f 6e 65 | 20 74 79 70 65 20 61 70 |age, one| type ap|
|00001d80| 70 72 6f 61 63 68 20 77 | 68 69 6c 65 0a 20 20 20 |proach w|hile. |
|00001d90| 20 20 20 20 20 20 20 20 | 20 77 72 69 74 69 6e 67 | | writing|
|00001da0| 20 41 64 61 20 73 6f 66 | 74 77 61 72 65 3f 0a 20 | Ada sof|tware?. |
|00001db0| 20 20 20 20 20 20 20 20 | 20 2b 20 38 2e 34 3a 20 | | + 8.4: |
|00001dc0| 57 68 61 74 20 69 73 20 | 74 68 65 20 22 42 65 61 |What is |the "Bea|
|00001dd0| 75 6a 6f 6c 61 69 73 20 | 45 66 66 65 63 74 22 3f |ujolais |Effect"?|
|00001de0| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 38 2e 35 |. | + 8.5|
|00001df0| 3a 20 57 68 61 74 20 61 | 62 6f 75 74 20 74 68 65 |: What a|bout the|
|00001e00| 20 22 52 69 70 70 6c 65 | 20 45 66 66 65 63 74 22 | "Ripple| Effect"|
|00001e10| 3f 0a 20 20 20 20 20 20 | 20 20 20 20 2b 20 38 2e |?. | + 8.|
|00001e20| 36 3a 20 48 6f 77 20 74 | 6f 20 77 72 69 74 65 20 |6: How t|o write |
|00001e30| 61 6e 20 41 64 61 20 70 | 72 6f 67 72 61 6d 20 74 |an Ada p|rogram t|
|00001e40| 6f 20 63 6f 6d 70 75 74 | 65 20 77 68 65 6e 20 6f |o comput|e when o|
|00001e50| 6e 65 20 68 61 73 20 68 | 61 64 0a 20 20 20 20 20 |ne has h|ad. |
|00001e60| 20 20 20 20 20 20 20 74 | 6f 6f 20 6d 75 63 68 20 | t|oo much |
|00001e70| 61 6c 63 6f 68 6f 6c 20 | 74 6f 20 6c 65 67 61 6c |alcohol |to legal|
|00001e80| 6c 79 20 64 72 69 76 65 | 3f 0a 20 20 20 20 20 20 |ly drive|?. |
|00001e90| 20 20 20 20 2b 20 38 2e | 37 3a 20 44 6f 65 73 20 | + 8.|7: Does |
|00001ea0| 41 64 61 20 68 61 76 65 | 20 6d 61 63 72 6f 73 3f |Ada have| macros?|
|00001eb0| 0a 0a 0a 20 20 20 20 20 | 2a 20 39 3a 20 41 64 61 |... |* 9: Ada|
|00001ec0| 20 61 6e 64 20 4f 74 68 | 65 72 20 50 72 6f 67 72 | and Oth|er Progr|
|00001ed0| 61 6d 6d 69 6e 67 20 4c | 61 6e 67 75 61 67 65 73 |amming L|anguages|
|00001ee0| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 39 2e 31 |. | + 9.1|
|00001ef0| 3a 20 57 68 65 72 65 20 | 63 61 6e 20 49 20 66 69 |: Where |can I fi|
|00001f00| 6e 64 20 70 72 6f 67 72 | 61 6d 73 20 74 68 61 74 |nd progr|ams that|
|00001f10| 20 77 69 6c 6c 20 74 72 | 61 6e 73 6c 61 74 65 20 | will tr|anslate |
|00001f20| 66 72 6f 6d 20 5b 73 6f | 6d 65 0a 20 20 20 20 20 |from [so|me. |
|00001f30| 20 20 20 20 20 20 20 6c | 61 6e 67 75 61 67 65 5d | l|anguage]|
|00001f40| 20 74 6f 20 41 64 61 3f | 0a 20 20 20 20 20 20 20 | to Ada?|. |
|00001f50| 20 20 20 2b 20 39 2e 32 | 3a 20 48 6f 77 20 63 61 | + 9.2|: How ca|
|00001f60| 6e 20 49 20 63 6f 6e 76 | 65 72 74 20 41 64 61 20 |n I conv|ert Ada |
|00001f70| 38 33 20 73 6f 75 72 63 | 65 73 20 74 6f 20 41 64 |83 sourc|es to Ad|
|00001f80| 61 20 39 58 3f 0a 20 20 | 20 20 20 20 20 20 20 20 |a 9X?. | |
|00001f90| 2b 20 39 2e 33 3a 20 49 | 20 68 65 61 72 20 74 68 |+ 9.3: I| hear th|
|00001fa0| 61 74 20 41 64 61 20 69 | 73 20 73 6c 6f 77 65 72 |at Ada i|s slower|
|00001fb0| 20 74 68 61 6e 20 46 6f | 72 74 72 61 6e 20 6f 72 | than Fo|rtran or|
|00001fc0| 20 43 2c 20 69 73 20 74 | 68 61 74 0a 20 20 20 20 | C, is t|hat. |
|00001fd0| 20 20 20 20 20 20 20 20 | 74 72 75 65 3f 0a 20 20 | |true?. |
|00001fe0| 20 20 20 20 20 20 20 20 | 2b 20 39 2e 34 3a 20 49 | |+ 9.4: I|
|00001ff0| 73 6e 27 74 20 41 64 61 | 20 6c 65 73 73 20 22 65 |sn't Ada| less "e|
|00002000| 6c 65 67 61 6e 74 22 20 | 74 68 61 6e 20 45 69 66 |legant" |than Eif|
|00002010| 66 65 6c 3f 0a 20 20 20 | 20 20 20 20 20 20 20 2b |fel?. | +|
|00002020| 20 39 2e 35 3a 20 41 72 | 65 20 74 68 65 72 65 20 | 9.5: Ar|e there |
|00002030| 61 6e 79 20 70 61 70 65 | 72 73 20 64 65 74 61 69 |any pape|rs detai|
|00002040| 6c 69 6e 67 20 74 68 65 | 20 64 69 66 66 65 72 65 |ling the| differe|
|00002050| 6e 63 65 73 20 62 65 74 | 77 65 65 6e 0a 20 20 20 |nces bet|ween. |
|00002060| 20 20 20 20 20 20 20 20 | 20 41 64 61 20 61 6e 64 | | Ada and|
|00002070| 20 43 2b 2b 3f 0a 20 20 | 20 20 20 20 20 20 20 20 | C++?. | |
|00002080| 2b 20 39 2e 36 3a 20 49 | 20 6b 65 65 70 20 68 65 |+ 9.6: I| keep he|
|00002090| 61 72 69 6e 67 20 74 68 | 61 74 20 41 64 61 20 69 |aring th|at Ada i|
|000020a0| 73 20 61 20 22 73 74 72 | 6f 6e 67 6c 79 20 74 79 |s a "str|ongly ty|
|000020b0| 70 65 64 20 6c 61 6e 67 | 75 61 67 65 22 2c 0a 20 |ped lang|uage",. |
|000020c0| 20 20 20 20 20 20 20 20 | 20 20 20 62 75 74 20 69 | | but i|
|000020d0| 74 20 73 65 65 6d 73 20 | 64 69 66 66 65 72 65 6e |t seems |differen|
|000020e0| 74 20 66 72 6f 6d 20 77 | 68 61 74 27 73 20 6d 65 |t from w|hat's me|
|000020f0| 61 6e 74 20 69 6e 20 43 | 2b 2b 2e 20 41 72 65 20 |ant in C|++. Are |
|00002100| 74 68 65 79 0a 20 20 20 | 20 20 20 20 20 20 20 20 |they. | |
|00002110| 20 64 69 66 66 65 72 65 | 6e 74 3f 0a 20 20 20 20 | differe|nt?. |
|00002120| 20 20 20 20 20 20 2b 20 | 39 2e 37 3a 20 49 27 6d | + |9.7: I'm|
|00002130| 20 74 6f 6c 64 20 41 64 | 61 20 64 6f 65 73 20 61 | told Ad|a does a|
|00002140| 6c 6c 20 73 6f 72 74 73 | 20 6f 66 20 73 74 61 74 |ll sorts| of stat|
|00002150| 69 63 20 74 79 70 65 20 | 63 68 65 63 6b 69 6e 67 |ic type |checking|
|00002160| 2c 20 62 75 74 0a 20 20 | 20 20 20 20 20 20 20 20 |, but. | |
|00002170| 20 20 63 61 6e 27 74 20 | 79 6f 75 20 67 65 74 20 | can't |you get |
|00002180| 74 68 65 20 73 61 6d 65 | 20 65 66 66 65 63 74 20 |the same| effect |
|00002190| 75 73 69 6e 67 20 61 20 | 74 6f 6f 6c 20 6c 69 6b |using a |tool lik|
|000021a0| 65 20 22 6c 69 6e 74 22 | 20 77 69 74 68 0a 20 20 |e "lint"| with. |
|000021b0| 20 20 20 20 20 20 20 20 | 20 20 43 3f 0a 20 20 20 | | C?. |
|000021c0| 20 20 20 20 20 20 20 2b | 20 39 2e 38 3a 20 44 6f | +| 9.8: Do|
|000021d0| 65 73 20 41 64 61 20 68 | 61 76 65 20 73 6f 6d 65 |es Ada h|ave some|
|000021e0| 74 68 69 6e 67 20 6c 69 | 6b 65 20 74 68 65 20 53 |thing li|ke the S|
|000021f0| 74 61 6e 64 61 72 64 20 | 54 65 6d 70 6c 61 74 65 |tandard |Template|
|00002200| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 4c 69 62 |. | Lib|
|00002210| 72 61 72 79 20 28 53 54 | 4c 29 20 69 6e 20 43 2b |rary (ST|L) in C+|
|00002220| 2b 2c 20 6f 72 20 6c 69 | 6b 65 20 74 68 65 20 63 |+, or li|ke the c|
|00002230| 6f 6d 70 6f 6e 65 6e 74 | 73 20 6f 6e 65 20 66 69 |omponent|s one fi|
|00002240| 6e 64 73 20 69 6e 0a 20 | 20 20 20 20 20 20 20 20 |nds in. | |
|00002250| 20 20 20 53 6d 61 6c 6c | 74 61 6c 6b 20 65 6e 76 | Small|talk env|
|00002260| 69 72 6f 6e 6d 65 6e 74 | 73 3f 0a 20 20 20 20 20 |ironment|s?. |
|00002270| 20 20 20 20 20 2b 20 39 | 2e 39 3a 20 57 68 65 72 | + 9|.9: Wher|
|00002280| 65 20 63 61 6e 20 49 20 | 66 69 6e 64 20 74 68 65 |e can I |find the|
|00002290| 20 65 71 75 69 76 61 6c | 65 6e 74 20 6f 66 20 22 | equival|ent of "|
|000022a0| 70 72 69 6e 74 66 22 20 | 69 6e 20 41 64 61 3f 0a |printf" |in Ada?.|
|000022b0| 0a 0a 20 20 20 20 20 2a | 20 31 30 3a 20 49 6e 74 |.. *| 10: Int|
|000022c0| 65 72 66 61 63 69 6e 67 | 20 77 69 74 68 20 41 64 |erfacing| with Ad|
|000022d0| 61 0a 20 20 20 20 20 20 | 20 20 20 20 2b 20 31 30 |a. | + 10|
|000022e0| 2e 31 3a 20 49 20 61 6d | 20 77 72 69 74 69 6e 67 |.1: I am| writing|
|000022f0| 20 73 6f 66 74 77 61 72 | 65 20 74 68 61 74 20 75 | softwar|e that u|
|00002300| 73 65 64 20 74 68 65 20 | 44 69 73 74 72 69 62 75 |sed the |Distribu|
|00002310| 74 65 64 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |ted. | |
|00002320| 49 6e 74 65 72 61 63 74 | 69 76 65 20 53 69 6d 75 |Interact|ive Simu|
|00002330| 6c 61 74 69 6f 6e 20 28 | 44 49 53 29 20 69 6e 74 |lation (|DIS) int|
|00002340| 65 72 66 61 63 65 2c 20 | 64 6f 65 73 20 61 6e 20 |erface, |does an |
|00002350| 69 6e 74 65 72 66 61 63 | 65 0a 20 20 20 20 20 20 |interfac|e. |
|00002360| 20 20 20 20 20 20 65 78 | 69 73 74 20 69 6e 20 41 | ex|ist in A|
|00002370| 64 61 3f 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |da?. | + |
|00002380| 31 30 2e 32 3a 20 49 73 | 20 74 68 65 72 65 20 61 |10.2: Is| there a|
|00002390| 6e 79 20 73 75 70 70 6f | 72 74 20 66 6f 72 20 43 |ny suppo|rt for C|
|000023a0| 6f 6d 6d 6f 6e 20 4f 62 | 6a 65 63 74 20 52 65 71 |ommon Ob|ject Req|
|000023b0| 75 65 73 74 20 42 72 6f | 6b 65 72 0a 20 20 20 20 |uest Bro|ker. |
|000023c0| 20 20 20 20 20 20 20 20 | 41 72 63 68 69 74 65 63 | |Architec|
|000023d0| 74 75 72 65 20 28 43 4f | 52 42 41 29 20 66 6f 72 |ture (CO|RBA) for|
|000023e0| 20 41 64 61 20 39 58 3f | 0a 0a 0a 20 20 20 20 20 | Ada 9X?|... |
|000023f0| 2a 20 31 31 3a 20 46 69 | 6e 64 69 6e 67 20 41 64 |* 11: Fi|nding Ad|
|00002400| 64 69 74 69 6f 6e 61 6c | 20 49 6e 66 6f 72 6d 61 |ditional| Informa|
|00002410| 74 69 6f 6e 0a 20 20 20 | 20 20 20 20 20 20 20 2b |tion. | +|
|00002420| 20 31 31 2e 31 3a 20 57 | 68 65 72 65 20 63 61 6e | 11.1: W|here can|
|00002430| 20 49 20 66 69 6e 64 20 | 41 64 61 20 62 6f 6f 6b | I find |Ada book|
|00002440| 73 3f 0a 20 20 20 20 20 | 20 20 20 20 20 2b 20 31 |s?. | + 1|
|00002450| 31 2e 32 3a 20 41 72 65 | 20 74 68 65 72 65 20 6f |1.2: Are| there o|
|00002460| 74 68 65 72 20 41 64 61 | 2d 72 65 6c 61 74 65 64 |ther Ada|-related|
|00002470| 20 46 41 51 73 3f 0a 20 | 20 20 20 20 20 20 20 20 | FAQs?. | |
|00002480| 20 2b 20 31 31 2e 33 3a | 20 57 68 61 74 20 69 73 | + 11.3:| What is|
|00002490| 20 74 68 65 20 22 48 42 | 41 50 20 57 57 57 20 53 | the "HB|AP WWW S|
|000024a0| 65 72 76 65 72 22 3f 0a | 0a 0a 20 20 20 20 20 2a |erver"?.|.. *|
|000024b0| 20 31 32 3a 20 50 72 65 | 74 74 79 2d 70 72 69 6e | 12: Pre|tty-prin|
|000024c0| 74 69 6e 67 20 61 6e 64 | 20 4d 65 61 73 75 72 69 |ting and| Measuri|
|000024d0| 6e 67 20 41 64 61 20 53 | 6f 75 72 63 65 20 43 6f |ng Ada S|ource Co|
|000024e0| 64 65 0a 20 20 20 20 20 | 20 20 20 20 20 2b 20 31 |de. | + 1|
|000024f0| 32 2e 31 3a 20 49 73 20 | 74 68 65 72 65 20 73 6f |2.1: Is |there so|
|00002500| 66 74 77 61 72 65 20 74 | 68 61 74 20 67 65 6e 65 |ftware t|hat gene|
|00002510| 72 61 74 65 73 20 61 20 | 70 72 65 74 74 79 20 50 |rates a |pretty P|
|00002520| 6f 73 74 53 63 72 69 70 | 74 0a 20 20 20 20 20 20 |ostScrip|t. |
|00002530| 20 20 20 20 20 20 66 69 | 6c 65 20 66 72 6f 6d 20 | fi|le from |
|00002540| 41 64 61 20 73 6f 75 72 | 63 65 20 63 6f 64 65 3f |Ada sour|ce code?|
|00002550| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 31 32 2e |. | + 12.|
|00002560| 32 3a 20 49 20 75 73 65 | 20 76 67 72 69 6e 64 20 |2: I use| vgrind |
|00002570| 74 6f 20 64 6f 20 22 70 | 72 65 74 74 79 20 70 72 |to do "p|retty pr|
|00002580| 69 6e 74 69 6e 67 22 20 | 6f 66 20 6d 79 20 73 6f |inting" |of my so|
|00002590| 75 72 63 65 2e 20 49 73 | 0a 20 20 20 20 20 20 20 |urce. Is|. |
|000025a0| 20 20 20 20 20 74 68 65 | 72 65 20 61 20 76 67 72 | the|re a vgr|
|000025b0| 69 6e 64 20 64 65 66 69 | 6e 69 74 69 6f 6e 20 66 |ind defi|nition f|
|000025c0| 6f 72 20 41 64 61 3f 0a | 20 20 20 20 20 20 20 20 |or Ada?.| |
|000025d0| 20 20 2b 20 31 32 2e 33 | 3a 20 48 6f 77 20 61 62 | + 12.3|: How ab|
|000025e0| 6f 75 74 20 61 20 73 6f | 75 72 63 65 20 63 6f 64 |out a so|urce cod|
|000025f0| 65 20 72 65 66 6f 72 6d | 61 74 74 65 72 3f 0a 20 |e reform|atter?. |
|00002600| 20 20 20 20 20 20 20 20 | 20 2b 20 31 32 2e 34 3a | | + 12.4:|
|00002610| 20 48 6f 77 20 63 61 6e | 20 49 20 63 6f 75 6e 74 | How can| I count|
|00002620| 20 73 6f 75 72 63 65 20 | 6c 69 6e 65 73 20 6f 66 | source |lines of|
|00002630| 20 63 6f 64 65 20 28 53 | 4c 4f 43 29 3f 0a 20 20 | code (S|LOC)?. |
|00002640| 20 20 20 20 20 20 20 20 | 2b 20 31 32 2e 35 3a 20 | |+ 12.5: |
|00002650| 43 61 6e 20 49 20 6d 65 | 61 73 75 72 65 20 6f 74 |Can I me|asure ot|
|00002660| 68 65 72 20 74 68 69 6e | 67 73 3f 0a 0a 0a 20 20 |her thin|gs?... |
|00002670| 20 20 20 2a 20 31 33 3a | 20 43 72 65 64 69 74 73 | * 13:| Credits|
|00002680| 0a 0a 20 20 20 20 20 2a | 20 31 34 3a 20 43 6f 70 |.. *| 14: Cop|
|00002690| 79 69 6e 67 20 74 68 69 | 73 20 46 41 51 0a 0a 0a |ying thi|s FAQ...|
|000026a0| 20 20 20 20 20 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f | ___|________|
|000026b0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000026c0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000026d0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000026e0| 5f 5f 5f 5f 5f 5f 0a 0a | 31 3a 20 52 65 63 65 6e |______..|1: Recen|
|000026f0| 74 20 63 68 61 6e 67 65 | 73 20 74 6f 20 74 68 69 |t change|s to thi|
|00002700| 73 20 46 41 51 0a 0a 20 | 20 20 20 20 2a 20 39 36 |s FAQ.. | * 96|
|00002710| 30 32 32 38 3a 20 72 65 | 66 65 72 65 6e 63 65 73 |0228: re|ferences|
|00002720| 20 66 6f 72 20 72 65 64 | 65 66 69 6e 69 6e 67 20 | for red|efining |
|00002730| 74 68 65 20 61 73 73 69 | 67 6e 6d 65 6e 74 20 6f |the assi|gnment o|
|00002740| 70 65 72 61 74 69 6f 6e | 20 28 38 2e 31 29 0a 20 |peration| (8.1). |
|00002750| 20 20 20 20 20 20 28 73 | 77 69 74 63 68 65 64 20 | (s|witched |
|00002760| 71 75 65 73 74 69 6f 6e | 73 20 38 2e 31 20 61 6e |question|s 8.1 an|
|00002770| 64 20 38 2e 32 29 2e 0a | 20 20 20 20 20 2a 20 39 |d 8.2)..| * 9|
|00002780| 36 30 31 33 30 3a 20 61 | 6e 6f 74 68 65 72 20 67 |60130: a|nother g|
|00002790| 61 6d 65 20 77 72 69 74 | 74 65 6e 20 69 6e 20 41 |ame writ|ten in A|
|000027a0| 64 61 20 28 33 2e 31 33 | 29 2e 0a 20 20 20 20 20 |da (3.13|).. |
|000027b0| 2a 20 39 36 30 31 32 33 | 3a 20 41 52 41 20 63 6f |* 960123|: ARA co|
|000027c0| 6e 74 65 73 74 20 66 6f | 72 20 67 6f 6f 64 20 41 |ntest fo|r good A|
|000027d0| 64 61 20 28 34 2e 33 29 | 2e 0a 20 20 20 20 20 2a |da (4.3)|.. *|
|000027e0| 20 39 35 30 39 32 35 3a | 20 72 65 6d 6f 76 65 64 | 950925:| removed|
|000027f0| 20 61 20 63 6f 75 70 6c | 65 20 6f 66 20 6e 6f 6e | a coupl|e of non|
|00002800| 2d 70 72 6f 67 72 61 6d | 6d 69 6e 67 20 71 75 65 |-program|ming que|
|00002810| 73 74 69 6f 6e 73 2e 0a | 20 20 20 20 20 2a 20 39 |stions..| * 9|
|00002820| 35 30 38 32 38 3a 20 74 | 68 65 20 63 68 61 6e 67 |50828: t|he chang|
|00002830| 65 20 6c 6f 67 73 20 6e | 6f 77 20 69 6e 64 69 63 |e logs n|ow indic|
|00002840| 61 74 65 20 74 68 65 20 | 73 65 63 74 69 6f 6e 2f |ate the |section/|
|00002850| 71 75 65 73 74 69 6f 6e | 20 6e 75 6d 62 65 72 2e |question| number.|
|00002860| 0a 20 20 20 20 20 2a 20 | 39 35 30 38 31 39 3a 20 |. * |950819: |
|00002870| 6e 6f 6e 2d 62 6c 6f 63 | 6b 69 6e 67 2c 20 6b 65 |non-bloc|king, ke|
|00002880| 79 73 74 72 6f 6b 65 2d | 61 74 2d 61 2d 74 69 6d |ystroke-|at-a-tim|
|00002890| 65 20 72 65 61 64 69 6e | 67 20 28 33 2e 31 34 29 |e readin|g (3.14)|
|000028a0| 2e 0a 20 20 20 20 20 2a | 20 39 35 30 38 31 39 3a |.. *| 950819:|
|000028b0| 20 73 6f 6d 65 20 55 52 | 4c 20 75 70 64 61 74 65 | some UR|L update|
|000028c0| 73 3a 20 41 64 61 49 43 | 20 66 69 6c 65 73 20 6b |s: AdaIC| files k|
|000028d0| 65 65 70 20 6d 6f 76 69 | 6e 67 20 61 72 6f 75 6e |eep movi|ng aroun|
|000028e0| 64 2e 0a 20 20 20 20 20 | 2a 20 39 35 30 36 33 30 |d.. |* 950630|
|000028f0| 3a 20 63 6f 72 72 65 63 | 74 65 64 20 61 6e 73 77 |: correc|ted answ|
|00002900| 65 72 73 20 6f 6e 20 74 | 61 73 6b 20 73 77 69 74 |ers on t|ask swit|
|00002910| 63 68 69 6e 67 20 28 33 | 2e 36 29 20 61 6e 64 20 |ching (3|.6) and |
|00002920| 63 6f 6e 76 65 72 73 69 | 6f 6e 0a 20 20 20 20 20 |conversi|on. |
|00002930| 20 20 76 73 2e 20 71 75 | 61 6c 69 66 69 65 72 20 | vs. qu|alifier |
|00002940| 28 33 2e 38 29 2e 0a 20 | 20 20 20 20 2a 20 39 35 |(3.8).. | * 95|
|00002950| 30 35 31 37 3a 20 22 67 | 65 6e 65 72 61 6c 22 20 |0517: "g|eneral" |
|00002960| 63 6c 61 73 73 2d 77 69 | 64 65 20 61 63 63 65 73 |class-wi|de acces|
|00002970| 73 20 74 79 70 65 20 28 | 35 2e 39 29 2e 0a 20 20 |s type (|5.9).. |
|00002980| 20 20 20 2a 20 39 35 30 | 34 31 33 3a 20 76 61 72 | * 950|413: var|
|00002990| 69 61 6e 74 20 72 65 63 | 6f 72 64 73 20 76 73 2e |iant rec|ords vs.|
|000029a0| 20 74 61 67 67 65 64 20 | 74 79 70 65 73 20 28 35 | tagged |types (5|
|000029b0| 2e 32 29 2c 20 73 75 62 | 6d 69 74 74 65 64 20 62 |.2), sub|mitted b|
|000029c0| 79 0a 20 20 20 20 20 20 | 20 4b 2e a0 53 68 69 6c |y. | K..Shil|
|000029d0| 6c 69 6e 67 74 6f 6e 2e | 0a 20 20 20 20 20 2a 20 |lington.|. * |
|000029e0| 39 35 30 34 30 36 3a 20 | 77 68 79 20 41 64 61 20 |950406: |why Ada |
|000029f0| 64 6f 65 73 20 6e 6f 74 | 20 61 6e 64 20 73 68 6f |does not| and sho|
|00002a00| 75 6c 64 20 6e 6f 74 20 | 68 61 76 65 20 6d 61 63 |uld not |have mac|
|00002a10| 72 6f 73 20 28 38 2e 37 | 29 2e 0a 20 20 20 20 20 |ros (8.7|).. |
|00002a20| 2a 20 39 35 30 33 32 30 | 3a 20 6d 6f 72 65 20 6f |* 950320|: more o|
|00002a30| 6e 20 44 49 53 20 28 31 | 30 2e 31 29 2e 0a 20 20 |n DIS (1|0.1).. |
|00002a40| 20 20 20 2a 20 39 35 30 | 33 31 35 3a 20 41 64 61 | * 950|315: Ada|
|00002a50| 20 69 73 20 67 6f 6f 64 | 20 61 74 20 6e 75 6d 65 | is good| at nume|
|00002a60| 72 69 63 73 20 28 36 2e | 33 29 2c 20 62 79 20 4a |rics (6.|3), by J|
|00002a70| 2e a0 50 61 72 6b 65 72 | 2e 0a 20 20 20 20 20 2a |..Parker|.. *|
|00002a80| 20 39 35 30 33 30 39 3a | 20 64 72 69 6e 6b 69 6e | 950309:| drinkin|
|00002a90| 67 20 61 6e 64 20 64 72 | 69 76 69 6e 67 20 65 78 |g and dr|iving ex|
|00002aa0| 61 6d 70 6c 65 20 28 38 | 2e 36 29 2e 0a 20 20 20 |ample (8|.6).. |
|00002ab0| 20 20 2a 20 39 35 30 33 | 30 36 3a 20 61 64 64 65 | * 9503|06: adde|
|00002ac0| 64 20 63 6f 75 6e 74 69 | 6e 67 20 53 4c 4f 43 20 |d counti|ng SLOC |
|00002ad0| 28 31 32 2e 34 29 20 61 | 6e 64 20 6d 65 61 73 75 |(12.4) a|nd measu|
|00002ae0| 72 69 6e 67 20 28 31 32 | 2e 35 29 2e 0a 20 20 20 |ring (12|.5).. |
|00002af0| 20 20 2a 20 39 35 30 32 | 32 32 3a 20 66 69 78 65 | * 9502|22: fixe|
|00002b00| 64 20 73 6f 6d 65 20 74 | 79 70 6f 73 2e 0a 20 20 |d some t|ypos.. |
|00002b10| 20 20 20 2a 20 39 35 30 | 32 30 37 3a 20 72 65 76 | * 950|207: rev|
|00002b20| 69 73 65 64 20 69 6e 74 | 72 6f 64 75 63 74 69 6f |ised int|roductio|
|00002b30| 6e 2e 0a 20 20 20 20 20 | 2a 20 39 35 30 32 30 32 |n.. |* 950202|
|00002b40| 3a 20 75 70 64 61 74 65 | 64 20 64 69 73 63 75 73 |: update|d discus|
|00002b50| 73 69 6f 6e 20 6f 66 20 | 43 2b 2b 20 53 54 4c 20 |sion of |C++ STL |
|00002b60| 61 6e 64 20 53 6d 61 6c | 6c 74 61 6c 6b 20 6c 69 |and Smal|ltalk li|
|00002b70| 62 72 61 72 79 20 28 39 | 2e 38 29 2e 0a 20 20 20 |brary (9|.8).. |
|00002b80| 20 20 2a 20 39 35 30 31 | 32 36 3a 20 61 64 76 61 | * 9501|26: adva|
|00002b90| 6e 74 61 67 65 73 20 6f | 66 20 63 6f 64 65 20 73 |ntages o|f code s|
|00002ba0| 68 61 72 69 6e 67 20 66 | 6f 72 20 67 65 6e 65 72 |haring f|or gener|
|00002bb0| 69 63 73 20 28 37 2e 31 | 29 3b 20 50 61 73 63 61 |ics (7.1|); Pasca|
|00002bc0| 6c 20 74 6f 0a 20 20 20 | 20 20 20 20 41 64 61 20 |l to. | Ada |
|00002bd0| 74 6f 6f 6c 20 28 39 2e | 31 29 2e 0a 20 20 20 20 |tool (9.|1).. |
|00002be0| 20 2a 20 39 35 30 31 32 | 35 3a 20 77 68 79 20 64 | * 95012|5: why d|
|00002bf0| 65 66 69 6e 65 20 6e 65 | 77 20 69 6e 74 65 67 65 |efine ne|w intege|
|00002c00| 72 20 74 79 70 65 73 20 | 28 33 2e 31 31 29 2c 20 |r types |(3.11), |
|00002c10| 61 6e 64 20 77 68 79 20 | 75 73 65 20 74 68 65 0a |and why |use the.|
|00002c20| 20 20 20 20 20 20 20 70 | 72 65 64 65 66 69 6e 65 | p|redefine|
|00002c30| 64 20 49 6e 74 65 67 65 | 72 20 74 79 70 65 20 28 |d Intege|r type (|
|00002c40| 33 2e 31 32 29 2c 20 73 | 75 62 6d 69 74 74 65 64 |3.12), s|ubmitted|
|00002c50| 20 62 79 20 4a 2e a0 50 | 61 72 6b 65 72 2e 0a 20 | by J..P|arker.. |
|00002c60| 20 20 20 20 2a 20 39 35 | 30 31 32 34 3a 20 61 70 | * 95|0124: ap|
|00002c70| 70 72 6f 76 65 64 20 66 | 6f 72 20 70 6f 73 74 69 |proved f|or posti|
|00002c80| 6e 67 20 69 6e 20 2a 2e | 61 6e 73 77 65 72 73 2e |ng in *.|answers.|
|00002c90| 0a 20 20 20 20 20 2a 20 | 39 35 30 31 31 36 3a 20 |. * |950116: |
|00002ca0| 63 6f 6e 76 65 72 74 69 | 6e 67 20 41 64 61 20 38 |converti|ng Ada 8|
|00002cb0| 33 20 63 6f 64 65 20 74 | 6f 20 41 64 61 20 39 58 |3 code t|o Ada 9X|
|00002cc0| 20 28 39 2e 32 29 2e 0a | 20 20 20 20 20 2a 20 39 | (9.2)..| * 9|
|00002cd0| 35 30 31 30 36 3a 20 6c | 65 6e 67 74 68 79 20 63 |50106: l|engthy c|
|00002ce0| 6f 64 65 20 73 65 63 74 | 69 6f 6e 73 20 65 78 74 |ode sect|ions ext|
|00002cf0| 72 61 63 74 65 64 20 61 | 6e 64 20 70 75 74 20 6f |racted a|nd put o|
|00002d00| 6e 20 46 54 50 20 73 65 | 72 76 65 72 2e 0a 20 20 |n FTP se|rver.. |
|00002d10| 20 20 20 2a 20 39 35 30 | 31 30 35 3a 20 70 72 69 | * 950|105: pri|
|00002d20| 6e 74 66 20 73 6f 6c 75 | 74 69 6f 6e 20 28 39 2e |ntf solu|tion (9.|
|00002d30| 39 29 3b 20 75 70 64 61 | 74 65 20 6f 6e 20 65 78 |9); upda|te on ex|
|00002d40| 63 65 70 74 69 6f 6e 20 | 74 72 61 63 65 73 20 61 |ception |traces a|
|00002d50| 6e 64 0a 20 20 20 20 20 | 20 20 76 67 72 69 6e 64 |nd. | vgrind|
|00002d60| 2e 0a 20 20 20 20 20 2a | 20 39 35 30 31 30 34 3a |.. *| 950104:|
|00002d70| 20 6c 69 6e 6b 73 20 66 | 72 6f 6d 20 54 4f 43 20 | links f|rom TOC |
|00002d80| 74 6f 20 61 6c 6c 20 71 | 75 65 73 74 69 6f 6e 73 |to all q|uestions|
|00002d90| 2e 0a 0a 0a 20 20 20 57 | 68 61 74 27 73 20 69 6d |.... W|hat's im|
|00002da0| 70 6f 72 74 61 6e 74 20 | 61 6e 64 20 6d 69 73 73 |portant |and miss|
|00002db0| 69 6e 67 3a 0a 20 20 20 | 20 20 2a 20 65 76 65 72 |ing:. | * ever|
|00002dc0| 79 74 68 69 6e 67 2c 20 | 6c 69 66 65 2c 20 61 6e |ything, |life, an|
|00002dd0| 64 20 34 32 0a 0a 0a 20 | 20 20 20 20 5f 5f 5f 5f |d 42... | ____|
|00002de0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002df0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002e00| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002e10| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 0a 0a 0a |________|_____...|
|00002e20| 32 3a 20 49 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 61 |2: Infor|mation a|
|00002e30| 62 6f 75 74 20 74 68 69 | 73 20 64 6f 63 75 6d 65 |bout thi|s docume|
|00002e40| 6e 74 0a 0a 20 20 20 54 | 68 69 73 20 66 69 6c 65 |nt.. T|his file|
|00002e50| 20 69 73 20 70 6f 73 74 | 65 64 20 6d 6f 6e 74 68 | is post|ed month|
|00002e60| 6c 79 20 74 6f 20 63 6f | 6d 70 2e 6c 61 6e 67 2e |ly to co|mp.lang.|
|00002e70| 61 64 61 2c 20 63 6f 6d | 70 2e 61 6e 73 77 65 72 |ada, com|p.answer|
|00002e80| 73 2c 20 61 6e 64 0a 20 | 20 20 6e 65 77 73 2e 61 |s, and. | news.a|
|00002e90| 6e 73 77 65 72 73 2e 0a | 0a 20 20 20 54 68 69 73 |nswers..|. This|
|00002ea0| 20 64 6f 63 75 6d 65 6e | 74 20 68 61 73 20 61 20 | documen|t has a |
|00002eb0| 68 6f 6d 65 20 6f 6e 20 | 74 68 65 20 48 6f 6d 65 |home on |the Home|
|00002ec0| 20 6f 66 20 74 68 65 20 | 42 72 61 76 65 20 41 64 | of the |Brave Ad|
|00002ed0| 61 20 50 72 6f 67 72 61 | 6d 6d 65 72 73 0a 20 20 |a Progra|mmers. |
|00002ee0| 20 28 48 42 41 50 29 20 | 57 57 57 20 53 65 72 76 | (HBAP) |WWW Serv|
|00002ef0| 65 72 2c 20 69 6e 20 68 | 79 70 65 72 74 65 78 74 |er, in h|ypertext|
|00002f00| 20 66 6f 72 6d 61 74 2c | 20 55 52 4c 0a 20 20 20 | format,| URL. |
|00002f10| 68 74 74 70 3a 2f 2f 6c | 67 6c 77 77 77 2e 65 70 |http://l|glwww.ep|
|00002f20| 66 6c 2e 63 68 2f 41 64 | 61 2f 46 41 51 2f 70 72 |fl.ch/Ad|a/FAQ/pr|
|00002f30| 6f 67 72 61 6d 6d 69 6e | 67 2e 68 74 6d 6c 0a 0a |ogrammin|g.html..|
|00002f40| 20 20 20 49 74 20 69 73 | 20 61 76 61 69 6c 61 62 | It is| availab|
|00002f50| 6c 65 20 2d 2d 61 73 20 | 70 6f 73 74 65 64 20 69 |le --as |posted i|
|00002f60| 6e 20 2a 2e 61 6e 73 77 | 65 72 73 2d 2d 20 6f 6e |n *.answ|ers-- on|
|00002f70| 20 72 74 66 6d 2e 6d 69 | 74 2e 65 64 75 2c 20 77 | rtfm.mi|t.edu, w|
|00002f80| 68 69 63 68 0a 20 20 20 | 61 72 63 68 69 76 65 73 |hich. |archives|
|00002f90| 20 61 6c 6c 20 46 41 51 | 20 66 69 6c 65 73 20 70 | all FAQ| files p|
|00002fa0| 6f 73 74 65 64 20 74 6f | 20 2a 2e 61 6e 73 77 65 |osted to| *.answe|
|00002fb0| 72 73 3b 20 73 65 65 0a | 20 20 20 66 74 70 3a 2f |rs; see.| ftp:/|
|00002fc0| 2f 72 74 66 6d 2e 6d 69 | 74 2e 65 64 75 2f 70 75 |/rtfm.mi|t.edu/pu|
|00002fd0| 62 2f 75 73 65 6e 65 74 | 2d 62 79 2d 67 72 6f 75 |b/usenet|-by-grou|
|00002fe0| 70 2f 6e 65 77 73 2e 61 | 6e 73 77 65 72 73 2f 63 |p/news.a|nswers/c|
|00002ff0| 6f 6d 70 75 74 65 72 2d | 6c 61 6e 67 2f 41 64 61 |omputer-|lang/Ada|
|00003000| 0a 0a 20 20 20 54 68 65 | 20 74 65 78 74 2d 6f 6e |.. The| text-on|
|00003010| 6c 79 20 76 65 72 73 69 | 6f 6e 20 69 73 20 61 6c |ly versi|on is al|
|00003020| 73 6f 20 61 76 61 69 6c | 61 62 6c 65 20 69 6e 20 |so avail|able in |
|00003030| 64 69 72 65 63 74 6f 72 | 79 0a 20 20 20 66 74 70 |director|y. ftp|
|00003040| 3a 2f 2f 6c 67 6c 66 74 | 70 2e 65 70 66 6c 2e 63 |://lglft|p.epfl.c|
|00003050| 68 2f 70 75 62 2f 41 64 | 61 2f 46 41 51 0a 0a 20 |h/pub/Ad|a/FAQ.. |
|00003060| 20 20 4d 61 67 6e 75 73 | 20 4b 65 6d 70 65 20 6d | Magnus| Kempe m|
|00003070| 61 69 6e 74 61 69 6e 73 | 20 74 68 69 73 20 64 6f |aintains| this do|
|00003080| 63 75 6d 65 6e 74 3b 20 | 69 74 27 73 20 61 20 68 |cument; |it's a h|
|00003090| 6f 62 62 79 2c 20 6e 6f | 74 20 61 20 6a 6f 62 2e |obby, no|t a job.|
|000030a0| 0a 20 20 20 46 65 65 64 | 62 61 63 6b 20 28 63 6f |. Feed|back (co|
|000030b0| 72 72 65 63 74 69 6f 6e | 73 2c 20 73 75 67 67 65 |rrection|s, sugge|
|000030c0| 73 74 69 6f 6e 73 2c 20 | 69 64 65 61 73 29 20 61 |stions, |ideas) a|
|000030d0| 62 6f 75 74 20 69 74 20 | 69 73 20 74 6f 20 62 65 |bout it |is to be|
|000030e0| 20 73 65 6e 74 20 76 69 | 61 0a 20 20 20 65 2d 6d | sent vi|a. e-m|
|000030f0| 61 69 6c 20 74 6f 20 4d | 61 67 6e 75 73 2e 4b 65 |ail to M|agnus.Ke|
|00003100| 6d 70 65 40 64 69 2e 65 | 70 66 6c 2e 63 68 0a 20 |mpe@di.e|pfl.ch. |
|00003110| 20 20 54 68 61 6e 6b 73 | 2e 0a 0a 20 20 20 49 6e | Thanks|... In|
|00003120| 20 61 6c 6c 20 63 61 73 | 65 73 2c 20 74 68 65 20 | all cas|es, the |
|00003130| 6d 6f 73 74 20 75 70 2d | 74 6f 2d 64 61 74 65 20 |most up-|to-date |
|00003140| 76 65 72 73 69 6f 6e 20 | 6f 66 20 74 68 65 20 46 |version |of the F|
|00003150| 41 51 20 69 73 20 74 68 | 65 20 76 65 72 73 69 6f |AQ is th|e versio|
|00003160| 6e 0a 20 20 20 6d 61 69 | 6e 74 61 69 6e 65 64 20 |n. mai|ntained |
|00003170| 6f 6e 20 74 68 65 20 48 | 42 41 50 20 57 57 57 20 |on the H|BAP WWW |
|00003180| 53 65 72 76 65 72 2e 20 | 50 6c 65 61 73 65 20 65 |Server. |Please e|
|00003190| 78 63 75 73 65 20 61 6e | 79 20 66 6f 72 6d 61 74 |xcuse an|y format|
|000031a0| 74 69 6e 67 0a 20 20 20 | 69 6e 63 6f 6e 73 69 73 |ting. |inconsis|
|000031b0| 74 65 6e 63 69 65 73 20 | 69 6e 20 74 68 65 20 70 |tencies |in the p|
|000031c0| 6f 73 74 65 64 20 76 65 | 72 73 69 6f 6e 20 6f 66 |osted ve|rsion of|
|000031d0| 20 74 68 69 73 20 64 6f | 63 75 6d 65 6e 74 2c 20 | this do|cument, |
|000031e0| 61 73 20 69 74 20 69 73 | 0a 20 20 20 61 75 74 6f |as it is|. auto|
|000031f0| 6d 61 74 69 63 61 6c 6c | 79 20 67 65 6e 65 72 61 |maticall|y genera|
|00003200| 74 65 64 20 66 72 6f 6d | 20 74 68 65 20 6f 6e 2d |ted from| the on-|
|00003210| 6c 69 6e 65 20 76 65 72 | 73 69 6f 6e 2e 0a 0a 20 |line ver|sion... |
|00003220| 20 20 20 20 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f | ____|________|
|00003230| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003240| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003250| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003260| 5f 5f 5f 5f 5f 0a 0a 0a | 33 3a 20 45 6c 65 6d 65 |_____...|3: Eleme|
|00003270| 6e 74 61 72 79 20 51 75 | 65 73 74 69 6f 6e 73 0a |ntary Qu|estions.|
|00003280| 0a 0a 33 2e 31 3a 20 48 | 6f 77 20 64 6f 20 49 20 |..3.1: H|ow do I |
|00003290| 6d 61 6b 65 20 6f 70 65 | 72 61 74 69 6f 6e 73 20 |make ope|rations |
|000032a0| 64 69 72 65 63 74 6c 79 | 20 76 69 73 69 62 6c 65 |directly| visible|
|000032b0| 20 77 69 74 68 6f 75 74 | 20 22 75 73 65 22 69 6e | without| "use"in|
|000032c0| 67 20 74 68 65 20 70 61 | 63 6b 61 67 65 3f 0a 0a |g the pa|ckage?..|
|000032d0| 20 20 20 49 6e 20 41 64 | 61 20 38 33 2c 20 79 6f | In Ad|a 83, yo|
|000032e0| 75 20 63 61 6e 20 72 65 | 6e 61 6d 65 20 74 68 65 |u can re|name the|
|000032f0| 20 6f 70 65 72 61 74 69 | 6f 6e 73 20 69 6e 20 79 | operati|ons in y|
|00003300| 6f 75 72 20 73 63 6f 70 | 65 2e 0a 0a 20 20 20 20 |our scop|e... |
|00003310| 20 2d 2d 20 53 61 79 20 | 79 6f 75 20 68 61 76 65 | -- Say |you have|
|00003320| 20 61 6e 20 69 6e 74 65 | 67 65 72 20 74 79 70 65 | an inte|ger type|
|00003330| 20 63 61 6c 6c 65 64 20 | 49 6e 74 20 69 6e 20 70 | called |Int in p|
|00003340| 61 63 6b 61 67 65 20 54 | 79 70 65 73 0a 20 20 20 |ackage T|ypes. |
|00003350| 20 20 66 75 6e 63 74 69 | 6f 6e 20 22 3c 22 20 28 | functi|on "<" (|
|00003360| 4c 65 66 74 2c 20 52 69 | 67 68 74 20 3a 20 54 79 |Left, Ri|ght : Ty|
|00003370| 70 65 73 2e 49 6e 74 29 | 0a 20 20 20 20 20 20 20 |pes.Int)|. |
|00003380| 72 65 74 75 72 6e 20 42 | 6f 6f 6c 65 61 6e 0a 20 |return B|oolean. |
|00003390| 20 20 20 20 20 20 72 65 | 6e 61 6d 65 73 20 54 79 | re|names Ty|
|000033a0| 70 65 73 2e 22 3c 22 3b | 0a 20 20 20 20 20 2d 2d |pes."<";|. --|
|000033b0| 20 4d 61 6b 65 20 73 75 | 72 65 20 74 68 65 20 70 | Make su|re the p|
|000033c0| 72 6f 66 69 6c 65 73 20 | 6f 66 20 74 68 65 20 66 |rofiles |of the f|
|000033d0| 69 72 73 74 20 61 6e 64 | 20 6c 61 73 74 20 22 3c |irst and| last "<|
|000033e0| 22 20 6d 61 74 63 68 21 | 0a 0a 0a 20 20 20 46 6f |" match!|... Fo|
|000033f0| 72 20 6f 70 65 72 61 74 | 6f 72 73 2c 20 41 64 61 |r operat|ors, Ada|
|00003400| 20 39 35 20 69 6e 74 72 | 6f 64 75 63 65 73 20 74 | 95 intr|oduces t|
|00003410| 68 65 20 22 75 73 65 20 | 74 79 70 65 22 20 63 6c |he "use |type" cl|
|00003420| 61 75 73 65 3a 0a 0a 20 | 20 20 20 20 75 73 65 20 |ause:.. | use |
|00003430| 74 79 70 65 20 54 79 70 | 65 73 2e 49 6e 74 3b 20 |type Typ|es.Int; |
|00003440| 2d 2d 20 6d 61 6b 65 73 | 20 6f 70 65 72 61 74 6f |-- makes| operato|
|00003450| 72 73 20 64 69 72 65 63 | 74 6c 79 20 76 69 73 69 |rs direc|tly visi|
|00003460| 62 6c 65 0a 0a 0a 33 2e | 32 3a 20 48 6f 77 20 64 |ble...3.|2: How d|
|00003470| 6f 20 49 20 61 73 73 69 | 67 6e 20 74 6f 20 61 6e |o I assi|gn to an|
|00003480| 20 61 72 72 61 79 20 6f | 66 20 6c 65 6e 67 74 68 | array o|f length|
|00003490| 20 31 3f 0a 0a 20 20 20 | 42 65 63 61 75 73 65 20 | 1?.. |Because |
|000034a0| 6f 66 20 61 6d 62 69 67 | 75 69 74 79 20 6f 66 20 |of ambig|uity of |
|000034b0| 70 61 72 65 6e 74 68 65 | 73 65 73 2c 20 6e 61 6d |parenthe|ses, nam|
|000034c0| 65 64 20 6e 6f 74 61 74 | 69 6f 6e 20 6d 75 73 74 |ed notat|ion must|
|000034d0| 20 62 65 20 75 73 65 64 | 20 66 6f 72 0a 20 20 20 | be used| for. |
|000034e0| 6f 6e 65 2d 65 6c 65 6d | 65 6e 74 20 61 67 67 72 |one-elem|ent aggr|
|000034f0| 65 67 61 74 65 73 20 28 | 6f 72 2c 20 75 6e 64 65 |egates (|or, unde|
|00003500| 72 20 61 20 64 69 66 66 | 65 72 65 6e 74 20 61 6e |r a diff|erent an|
|00003510| 67 6c 65 3a 20 61 20 70 | 6f 73 69 74 69 6f 6e 61 |gle: a p|ositiona|
|00003520| 6c 0a 20 20 20 61 67 67 | 72 65 67 61 74 65 20 6d |l. agg|regate m|
|00003530| 75 73 74 20 68 61 76 65 | 20 6d 6f 72 65 20 74 68 |ust have| more th|
|00003540| 61 6e 20 6f 6e 65 20 63 | 6f 6d 70 6f 6e 65 6e 74 |an one c|omponent|
|00003550| 29 2e 0a 0a 20 20 20 53 | 65 65 20 5b 52 4d 39 58 |)... S|ee [RM9X|
|00003560| 20 34 2e 33 2e 33 28 37 | 29 5d 20 61 73 20 77 65 | 4.3.3(7|)] as we|
|00003570| 6c 6c 20 61 73 20 74 68 | 65 20 73 79 6e 74 61 78 |ll as th|e syntax|
|00003580| 20 72 75 6c 65 20 6f 66 | 0a 20 20 20 70 6f 73 69 | rule of|. posi|
|00003590| 74 69 6f 6e 61 6c 5f 61 | 72 72 61 79 5f 61 67 67 |tional_a|rray_agg|
|000035a0| 72 65 67 61 74 65 20 69 | 6e 20 5b 52 4d 39 58 20 |regate i|n [RM9X |
|000035b0| 34 2e 33 2e 33 5d 3b 20 | 68 69 73 74 6f 72 69 61 |4.3.3]; |historia|
|000035c0| 6e 73 20 73 65 65 20 5b | 52 4d 38 33 0a 20 20 20 |ns see [|RM83. |
|000035d0| 34 2e 33 28 34 29 5d 2e | 0a 0a 20 20 20 20 20 64 |4.3(4)].|.. d|
|000035e0| 65 63 6c 61 72 65 0a 20 | 20 20 20 20 20 20 41 72 |eclare. | Ar|
|000035f0| 72 61 79 5f 6f 66 5f 4f | 6e 65 20 3a 20 61 72 72 |ray_of_O|ne : arr|
|00003600| 61 79 20 28 31 2e 2e 31 | 29 20 6f 66 20 46 6c 6f |ay (1..1|) of Flo|
|00003610| 61 74 3b 0a 20 20 20 20 | 20 62 65 67 69 6e 0a 20 |at;. | begin. |
|00003620| 20 20 20 20 20 20 2d 2d | 20 41 72 72 61 79 5f 6f | --| Array_o|
|00003630| 66 5f 4f 6e 65 20 3a 3d | 20 28 31 30 2e 30 29 3b |f_One :=| (10.0);|
|00003640| 20 20 20 2d 2d 20 57 6f | 6e 27 74 20 77 6f 72 6b | -- Wo|n't work|
|00003650| 2c 20 70 61 72 73 65 64 | 20 61 73 20 61 6e 20 65 |, parsed| as an e|
|00003660| 78 70 72 65 73 73 69 6f | 6e 0a 20 20 20 20 20 20 |xpressio|n. |
|00003670| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003680| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 2d 2d | | --|
|00003690| 20 77 69 74 68 69 6e 20 | 70 61 72 65 6e 74 68 65 | within |parenthe|
|000036a0| 73 65 73 0a 0a 20 20 20 | 20 20 20 20 41 72 72 61 |ses.. | Arra|
|000036b0| 79 5f 6f 66 5f 4f 6e 65 | 20 3a 3d 20 28 31 20 3d |y_of_One| := (1 =|
|000036c0| 3e 20 31 30 2e 30 29 3b | 20 2d 2d 20 4e 6f 20 61 |> 10.0);| -- No a|
|000036d0| 6d 62 69 67 75 69 74 79 | 20 68 65 72 65 0a 20 20 |mbiguity| here. |
|000036e0| 20 20 20 65 6e 64 3b 0a | 0a 0a 20 20 20 59 6f 75 | end;.|.. You|
|000036f0| 20 63 61 6e 27 74 20 77 | 72 69 74 65 20 61 20 6f | can't w|rite a o|
|00003700| 6e 65 2d 65 6c 65 6d 65 | 6e 74 20 70 6f 73 69 74 |ne-eleme|nt posit|
|00003710| 69 6f 6e 61 6c 20 61 67 | 67 72 65 67 61 74 65 20 |ional ag|gregate |
|00003720| 69 6e 20 41 64 61 2e 20 | 4e 6f 72 20 61 0a 20 20 |in Ada. |Nor a. |
|00003730| 20 7a 65 72 6f 2d 65 6c | 65 6d 65 6e 74 20 61 67 | zero-el|ement ag|
|00003740| 67 72 65 67 61 74 65 2e | 20 54 68 65 20 72 65 61 |gregate.| The rea|
|00003750| 73 6f 6e 20 66 6f 72 20 | 74 68 69 73 20 72 65 73 |son for |this res|
|00003760| 74 72 69 63 74 69 6f 6e | 20 69 73 20 74 68 61 74 |triction| is that|
|00003770| 20 69 74 0a 20 20 20 77 | 6f 75 6c 64 20 62 65 20 | it. w|ould be |
|00003780| 64 69 66 66 69 63 75 6c | 74 20 66 6f 72 20 63 6f |difficul|t for co|
|00003790| 6d 70 69 6c 65 72 73 20 | 74 6f 20 64 65 74 65 72 |mpilers |to deter|
|000037a0| 6d 69 6e 65 20 77 68 65 | 74 68 65 72 3a 0a 0a 20 |mine whe|ther:.. |
|000037b0| 20 20 20 20 28 20 65 78 | 70 20 29 0a 0a 20 20 20 | ( ex|p ).. |
|000037c0| 69 73 20 61 20 70 61 72 | 65 6e 74 68 65 73 69 7a |is a par|enthesiz|
|000037d0| 65 64 20 65 78 70 72 65 | 73 73 69 6f 6e 20 6f 66 |ed expre|ssion of|
|000037e0| 20 73 6f 6d 65 20 74 79 | 70 65 2c 20 6f 72 20 61 | some ty|pe, or a|
|000037f0| 6e 20 61 67 67 72 65 67 | 61 74 65 20 6f 66 20 61 |n aggreg|ate of a|
|00003800| 6e 0a 20 20 20 61 72 72 | 61 79 20 74 79 70 65 2e |n. arr|ay type.|
|00003810| 20 49 66 20 41 64 61 20 | 68 61 64 20 75 73 65 64 | If Ada |had used|
|00003820| 20 73 6f 6d 65 20 6f 74 | 68 65 72 20 6e 6f 74 61 | some ot|her nota|
|00003830| 74 69 6f 6e 20 66 6f 72 | 20 61 67 67 72 65 67 61 |tion for| aggrega|
|00003840| 74 65 73 20 28 73 61 79 | 2c 0a 20 20 20 22 5b 2e |tes (say|,. "[.|
|00003850| 2e 2e 5d 22 29 2c 20 74 | 68 65 6e 20 74 68 69 73 |..]"), t|hen this|
|00003860| 20 70 72 6f 62 6c 65 6d | 20 77 6f 75 6c 64 20 6e | problem| would n|
|00003870| 6f 74 20 65 78 69 73 74 | 2e 0a 0a 20 20 20 41 70 |ot exist|... Ap|
|00003880| 70 61 72 65 6e 74 6c 79 | 20 74 68 65 20 6f 72 69 |parently| the ori|
|00003890| 67 69 6e 61 6c 20 72 65 | 71 75 69 72 65 6d 65 6e |ginal re|quiremen|
|000038a0| 74 73 20 66 6f 72 20 41 | 64 61 20 66 6f 72 62 61 |ts for A|da forba|
|000038b0| 64 65 20 75 73 69 6e 67 | 20 63 65 72 74 61 69 6e |de using| certain|
|000038c0| 0a 20 20 20 41 53 43 49 | 49 20 63 68 61 72 61 63 |. ASCI|I charac|
|000038d0| 74 65 72 73 2c 20 6c 69 | 6b 65 20 27 5b 27 20 61 |ters, li|ke '[' a|
|000038e0| 6e 64 20 27 5d 27 2c 20 | 62 65 63 61 75 73 65 20 |nd ']', |because |
|000038f0| 74 68 6f 73 65 20 63 68 | 61 72 61 63 74 65 72 73 |those ch|aracters|
|00003900| 20 77 65 72 65 20 6e 6f | 74 0a 20 20 20 61 76 61 | were no|t. ava|
|00003910| 69 6c 61 62 6c 65 20 6f | 6e 20 61 6c 6c 20 68 61 |ilable o|n all ha|
|00003920| 72 64 77 61 72 65 2e 20 | 41 6c 73 6f 2c 20 63 65 |rdware. |Also, ce|
|00003930| 72 74 61 69 6e 20 63 68 | 61 72 61 63 74 65 72 73 |rtain ch|aracters|
|00003940| 20 61 72 65 20 75 73 65 | 64 20 66 6f 72 0a 20 20 | are use|d for. |
|00003950| 20 64 69 66 66 65 72 65 | 6e 74 20 70 75 72 70 6f | differe|nt purpo|
|00003960| 73 65 73 20 61 6e 64 20 | 67 6c 79 70 68 73 20 69 |ses and |glyphs i|
|00003970| 6e 20 63 6f 75 6e 74 72 | 69 65 73 20 74 68 61 74 |n countr|ies that|
|00003980| 20 6e 65 65 64 20 61 64 | 64 69 74 69 6f 6e 61 6c | need ad|ditional|
|00003990| 0a 20 20 20 6c 65 74 74 | 65 72 73 20 6e 6f 74 20 |. lett|ers not |
|000039a0| 70 72 65 73 65 6e 74 20 | 69 6e 20 41 53 43 49 49 |present |in ASCII|
|000039b0| 2e 0a 0a 0a 33 2e 33 3a | 20 48 6f 77 20 64 6f 20 |....3.3:| How do |
|000039c0| 49 20 63 72 65 61 74 65 | 20 61 20 43 2d 73 74 79 |I create| a C-sty|
|000039d0| 6c 65 20 6e 75 6c 2d 74 | 65 72 6d 69 6e 61 74 65 |le nul-t|erminate|
|000039e0| 64 20 73 74 72 69 6e 67 | 3f 0a 0a 20 20 20 49 6e |d string|?.. In|
|000039f0| 20 61 20 64 65 63 6c 61 | 72 61 74 69 6f 6e 20 62 | a decla|ration b|
|00003a00| 6c 6f 63 6b 2c 20 61 70 | 70 65 6e 64 20 61 6e 20 |lock, ap|pend an |
|00003a10| 41 53 43 49 49 2e 4e 55 | 4c 20 74 6f 20 63 72 65 |ASCII.NU|L to cre|
|00003a20| 61 74 65 20 61 20 63 6f | 6e 73 74 61 6e 74 20 41 |ate a co|nstant A|
|00003a30| 64 61 0a 20 20 20 73 74 | 72 69 6e 67 2e 0a 0a 20 |da. st|ring... |
|00003a40| 20 20 20 20 64 65 63 6c | 61 72 65 0a 20 20 20 20 | decl|are. |
|00003a50| 20 20 20 53 74 72 5f 4e | 75 6c 20 3a 20 63 6f 6e | Str_N|ul : con|
|00003a60| 73 74 61 6e 74 20 53 74 | 72 69 6e 67 20 3a 3d 20 |stant St|ring := |
|00003a70| 53 74 72 20 26 20 41 53 | 43 49 49 2e 4e 55 4c 3b |Str & AS|CII.NUL;|
|00003a80| 0a 20 20 20 20 20 62 65 | 67 69 6e 0a 20 20 20 20 |. be|gin. |
|00003a90| 20 20 20 43 61 6c 6c 5f | 52 65 71 75 69 72 69 6e | Call_|Requirin|
|00003aa0| 67 5f 43 5f 53 74 72 69 | 6e 67 20 28 53 74 72 5f |g_C_Stri|ng (Str_|
|00003ab0| 4e 75 6c 20 28 53 74 72 | 5f 4e 75 6c 27 46 69 72 |Nul (Str|_Nul'Fir|
|00003ac0| 73 74 29 27 41 64 64 72 | 65 73 73 29 3b 0a 20 20 |st)'Addr|ess);. |
|00003ad0| 20 20 20 65 6e 64 3b 0a | 0a 2d 2d 20 6f 72 20 2d | end;.|.-- or -|
|00003ae0| 2d 0a 0a 20 20 20 20 20 | 66 75 6e 63 74 69 6f 6e |-.. |function|
|00003af0| 20 4e 75 6c 5f 54 65 72 | 6d 69 6e 61 74 65 20 28 | Nul_Ter|minate (|
|00003b00| 53 74 72 20 3a 20 53 74 | 72 69 6e 67 29 0a 20 20 |Str : St|ring). |
|00003b10| 20 20 20 20 20 72 65 74 | 75 72 6e 20 53 74 72 69 | ret|urn Stri|
|00003b20| 6e 67 20 69 73 0a 20 20 | 20 20 20 20 20 53 74 72 |ng is. | Str|
|00003b30| 5f 4e 75 6c 20 3a 20 63 | 6f 6e 73 74 61 6e 74 20 |_Nul : c|onstant |
|00003b40| 53 74 72 69 6e 67 20 3a | 3d 20 53 74 72 20 26 20 |String :|= Str & |
|00003b50| 41 53 43 49 49 2e 4e 55 | 4c 3b 0a 20 20 20 20 20 |ASCII.NU|L;. |
|00003b60| 62 65 67 69 6e 0a 20 20 | 20 20 20 20 20 72 65 74 |begin. | ret|
|00003b70| 75 72 6e 20 53 74 72 5f | 4e 75 6c 3b 0a 20 20 20 |urn Str_|Nul;. |
|00003b80| 20 20 65 6e 64 20 4e 75 | 6c 5f 54 65 72 6d 69 6e | end Nu|l_Termin|
|00003b90| 61 74 65 3b 0a 0a 0a 33 | 2e 34 3a 20 48 6f 77 20 |ate;...3|.4: How |
|00003ba0| 63 61 6e 20 49 20 63 72 | 65 61 74 65 20 61 6e 20 |can I cr|eate an |
|00003bb0| 61 72 72 61 79 20 6f 66 | 20 73 74 72 69 6e 67 73 |array of| strings|
|00003bc0| 20 6f 66 20 76 61 72 69 | 6f 75 73 20 6c 65 6e 67 | of vari|ous leng|
|00003bd0| 74 68 3f 0a 0a 20 20 20 | 49 6e 20 41 64 61 20 38 |th?.. |In Ada 8|
|00003be0| 33 2c 20 79 6f 75 20 68 | 61 76 65 20 74 6f 20 75 |3, you h|ave to u|
|00003bf0| 73 65 20 73 74 72 69 6e | 67 20 61 63 63 65 73 73 |se strin|g access|
|00003c00| 20 74 79 70 65 73 20 61 | 6e 64 20 22 6e 65 77 22 | types a|nd "new"|
|00003c10| 20 74 6f 20 67 65 74 0a | 20 20 20 22 72 61 67 67 | to get.| "ragg|
|00003c20| 65 64 22 20 61 72 72 61 | 79 73 3a 0a 0a 20 20 20 |ed" arra|ys:.. |
|00003c30| 20 20 74 79 70 65 20 53 | 74 72 69 6e 67 5f 41 63 | type S|tring_Ac|
|00003c40| 63 65 73 73 20 69 73 0a | 20 20 20 20 20 20 20 61 |cess is.| a|
|00003c50| 63 63 65 73 73 20 53 74 | 72 69 6e 67 3b 0a 0a 20 |ccess St|ring;.. |
|00003c60| 20 20 20 20 53 74 72 69 | 6e 67 73 20 3a 20 63 6f | Stri|ngs : co|
|00003c70| 6e 73 74 61 6e 74 20 61 | 72 72 61 79 20 28 50 6f |nstant a|rray (Po|
|00003c80| 73 69 74 69 76 65 20 72 | 61 6e 67 65 20 31 2e 2e |sitive r|ange 1..|
|00003c90| 33 29 20 6f 66 20 53 74 | 72 69 6e 67 5f 41 63 63 |3) of St|ring_Acc|
|00003ca0| 65 73 73 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |ess. | |
|00003cb0| 20 3a 3d 20 28 20 31 20 | 3d 3e 20 6e 65 77 20 53 | := ( 1 |=> new S|
|00003cc0| 74 72 69 6e 67 27 28 22 | 4f 6e 65 22 29 2c 0a 20 |tring'("|One"),. |
|00003cd0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003ce0| 20 32 20 3d 3e 20 6e 65 | 77 20 53 74 72 69 6e 67 | 2 => ne|w String|
|00003cf0| 27 28 22 54 77 6f 22 29 | 2c 0a 20 20 20 20 20 20 |'("Two")|,. |
|00003d00| 20 20 20 20 20 20 20 20 | 20 20 20 20 33 20 3d 3e | | 3 =>|
|00003d10| 20 6e 65 77 20 53 74 72 | 69 6e 67 27 28 22 54 68 | new Str|ing'("Th|
|00003d20| 72 65 65 22 29 0a 20 20 | 20 20 20 20 20 20 20 20 |ree"). | |
|00003d30| 20 20 20 20 20 20 29 3b | 0a 0a 0a 20 20 20 49 6e | );|... In|
|00003d40| 20 41 64 61 20 39 35 2c | 20 74 68 65 20 70 72 6f | Ada 95,| the pro|
|00003d50| 63 65 73 73 20 69 73 20 | 73 69 6d 70 6c 69 66 69 |cess is |simplifi|
|00003d60| 65 64 20 62 79 20 75 73 | 69 6e 67 20 61 6c 69 61 |ed by us|ing alia|
|00003d70| 73 65 64 20 63 6f 6e 73 | 74 61 6e 74 73 3a 0a 0a |sed cons|tants:..|
|00003d80| 20 20 20 20 20 74 79 70 | 65 20 53 74 72 69 6e 67 | typ|e String|
|00003d90| 5f 41 63 63 65 73 73 20 | 69 73 0a 20 20 20 20 20 |_Access |is. |
|00003da0| 20 20 61 63 63 65 73 73 | 20 63 6f 6e 73 74 61 6e | access| constan|
|00003db0| 74 20 53 74 72 69 6e 67 | 3b 0a 0a 20 20 20 20 20 |t String|;.. |
|00003dc0| 4f 6e 65 20 3a 20 61 6c | 69 61 73 65 64 20 63 6f |One : al|iased co|
|00003dd0| 6e 73 74 61 6e 74 20 53 | 74 72 69 6e 67 20 3a 3d |nstant S|tring :=|
|00003de0| 20 22 4f 6e 65 22 3b 0a | 20 20 20 20 20 54 77 6f | "One";.| Two|
|00003df0| 20 3a 20 61 6c 69 61 73 | 65 64 20 63 6f 6e 73 74 | : alias|ed const|
|00003e00| 61 6e 74 20 53 74 72 69 | 6e 67 20 3a 3d 20 22 54 |ant Stri|ng := "T|
|00003e10| 77 6f 22 3b 0a 20 20 20 | 20 20 54 68 72 65 65 20 |wo";. | Three |
|00003e20| 3a 20 61 6c 69 61 73 65 | 64 20 63 6f 6e 73 74 61 |: aliase|d consta|
|00003e30| 6e 74 20 53 74 72 69 6e | 67 20 3a 3d 20 22 54 68 |nt Strin|g := "Th|
|00003e40| 72 65 65 22 3b 0a 0a 20 | 20 20 20 20 53 74 72 69 |ree";.. | Stri|
|00003e50| 6e 67 73 20 3a 20 63 6f | 6e 73 74 61 6e 74 20 61 |ngs : co|nstant a|
|00003e60| 72 72 61 79 20 28 50 6f | 73 69 74 69 76 65 20 72 |rray (Po|sitive r|
|00003e70| 61 6e 67 65 20 3c 3e 29 | 20 6f 66 20 53 74 72 69 |ange <>)| of Stri|
|00003e80| 6e 67 5f 41 63 63 65 73 | 73 0a 20 20 20 20 20 20 |ng_Acces|s. |
|00003e90| 20 20 20 20 20 20 20 3a | 3d 20 28 20 31 20 3d 3e | :|= ( 1 =>|
|00003ea0| 20 4f 6e 65 27 41 63 63 | 65 73 73 2c 0a 20 20 20 | One'Acc|ess,. |
|00003eb0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 32 | | 2|
|00003ec0| 20 3d 3e 20 54 77 6f 27 | 41 63 63 65 73 73 2c 0a | => Two'|Access,.|
|00003ed0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003ee0| 20 20 33 20 3d 3e 20 54 | 68 72 65 65 27 41 63 63 | 3 => T|hree'Acc|
|00003ef0| 65 73 73 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |ess. | |
|00003f00| 20 20 20 20 29 3b 0a 0a | 0a 33 2e 35 3a 20 49 20 | );..|.3.5: I |
|00003f10| 6b 6e 6f 77 20 61 6e 20 | 65 78 63 65 70 74 69 6f |know an |exceptio|
|00003f20| 6e 20 69 73 20 72 61 69 | 73 65 64 2c 20 62 75 74 |n is rai|sed, but|
|00003f30| 20 6d 79 20 70 72 6f 67 | 72 61 6d 20 71 75 69 74 | my prog|ram quit|
|00003f40| 73 20 77 69 74 68 20 6e | 6f 20 77 61 72 6e 69 6e |s with n|o warnin|
|00003f50| 67 2e 20 57 68 79 3f 0a | 0a 0a 20 20 20 4f 6e 20 |g. Why?.|.. On |
|00003f60| 73 6f 6d 65 20 41 64 61 | 20 63 6f 6d 70 69 6c 65 |some Ada| compile|
|00003f70| 72 73 2c 20 79 6f 75 20 | 68 61 76 65 20 74 6f 20 |rs, you |have to |
|00003f80| 6d 61 6e 75 61 6c 6c 79 | 20 22 77 69 74 68 22 20 |manually| "with" |
|00003f90| 54 65 78 74 5f 49 4f 20 | 62 65 66 6f 72 65 0a 20 |Text_IO |before. |
|00003fa0| 20 20 65 78 63 65 70 74 | 69 6f 6e 20 69 6e 66 6f | except|ion info|
|00003fb0| 72 6d 61 74 69 6f 6e 20 | 69 73 20 64 69 70 6c 61 |rmation |is dipla|
|00003fc0| 79 65 64 20 74 6f 20 74 | 68 65 20 74 65 72 6d 69 |yed to t|he termi|
|00003fd0| 6e 61 6c 2e 0a 0a 20 20 | 20 4f 6e 20 6f 74 68 65 |nal... | On othe|
|00003fe0| 72 20 41 64 61 20 63 6f | 6d 70 69 6c 65 72 73 2c |r Ada co|mpilers,|
|00003ff0| 20 79 6f 75 20 6d 75 73 | 74 20 73 65 74 20 61 6e | you mus|t set an|
|00004000| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 20 76 61 72 | environ|ment var|
|00004010| 69 61 62 6c 65 20 66 6c | 61 67 20 69 6e 0a 20 20 |iable fl|ag in. |
|00004020| 20 6f 72 64 65 72 20 74 | 6f 20 63 61 75 73 65 20 | order t|o cause |
|00004030| 74 68 65 20 65 78 63 65 | 70 74 69 6f 6e 20 69 6e |the exce|ption in|
|00004040| 66 6f 72 6d 61 74 69 6f | 6e 20 74 72 61 63 65 20 |formatio|n trace |
|00004050| 74 6f 20 62 65 20 64 69 | 73 70 6c 61 79 65 64 2e |to be di|splayed.|
|00004060| 0a 0a 0a 33 2e 36 3a 20 | 49 20 68 61 76 65 20 6f |...3.6: |I have o|
|00004070| 6e 6c 79 20 6f 6e 65 20 | 74 61 73 6b 20 69 6e 20 |nly one |task in |
|00004080| 6d 79 20 70 72 6f 67 72 | 61 6d 2c 20 62 75 74 20 |my progr|am, but |
|00004090| 69 74 20 64 6f 65 73 6e | 27 74 20 73 65 65 6d 20 |it doesn|'t seem |
|000040a0| 74 6f 20 72 75 6e 2e 20 | 57 68 79 3f 0a 0a 20 20 |to run. |Why?.. |
|000040b0| 20 49 6e 20 41 64 61 2c | 20 74 68 65 20 6d 61 69 | In Ada,| the mai|
|000040c0| 6e 20 70 72 6f 63 65 64 | 75 72 65 20 69 73 20 61 |n proced|ure is a|
|000040d0| 75 74 6f 6d 61 74 69 63 | 61 6c 6c 79 20 64 65 73 |utomatic|ally des|
|000040e0| 69 67 6e 61 74 65 64 20 | 61 73 20 61 20 74 61 73 |ignated |as a tas|
|000040f0| 6b 2e 20 54 68 69 73 0a | 20 20 20 74 61 73 6b 20 |k. This.| task |
|00004100| 6d 61 79 20 62 65 20 72 | 75 6e 6e 69 6e 67 20 66 |may be r|unning f|
|00004110| 6f 72 65 76 65 72 2c 20 | 74 68 75 73 20 73 74 61 |orever, |thus sta|
|00004120| 72 76 69 6e 67 20 79 6f | 75 72 20 6f 74 68 65 72 |rving yo|ur other|
|00004130| 20 74 61 73 6b 28 73 29 | 2c 20 62 65 63 61 75 73 | task(s)|, becaus|
|00004140| 65 0a 20 20 20 72 6f 75 | 6e 64 2d 72 6f 62 69 6e |e. rou|nd-robin|
|00004150| 20 73 63 68 65 64 75 6c | 69 6e 67 20 28 74 69 6d | schedul|ing (tim|
|00004160| 65 2d 73 6c 69 63 69 6e | 67 29 20 69 73 20 6e 6f |e-slicin|g) is no|
|00004170| 74 20 72 65 71 75 69 72 | 65 64 20 28 70 72 65 2d |t requir|ed (pre-|
|00004180| 65 6d 70 74 69 76 65 0a | 20 20 20 73 63 68 65 64 |emptive.| sched|
|00004190| 75 6c 69 6e 67 20 61 70 | 70 6c 69 65 73 20 74 6f |uling ap|plies to|
|000041a0| 20 74 61 73 6b 73 20 77 | 69 74 68 20 64 69 66 66 | tasks w|ith diff|
|000041b0| 65 72 65 6e 74 20 6c 65 | 76 65 6c 73 20 6f 66 20 |erent le|vels of |
|000041c0| 70 72 69 6f 72 69 74 79 | 29 2e 0a 0a 20 20 20 49 |priority|)... I|
|000041d0| 66 20 74 68 65 20 74 61 | 73 6b 20 69 6e 20 71 75 |f the ta|sk in qu|
|000041e0| 65 73 74 69 6f 6e 20 69 | 73 20 67 65 74 74 69 6e |estion i|s gettin|
|000041f0| 67 20 73 74 61 72 76 65 | 64 2c 20 69 74 27 73 20 |g starve|d, it's |
|00004200| 61 20 70 72 6f 67 72 61 | 6d 6d 65 72 20 70 72 6f |a progra|mmer pro|
|00004210| 62 6c 65 6d 2c 0a 20 20 | 20 6e 6f 74 20 61 6e 20 |blem,. | not an |
|00004220| 41 64 61 20 70 72 6f 62 | 6c 65 6d 2e 20 54 68 65 |Ada prob|lem. The|
|00004230| 20 70 72 6f 67 72 61 6d | 6d 65 72 20 68 61 73 20 | program|mer has |
|00004240| 74 6f 20 75 73 65 20 61 | 6e 20 41 64 61 20 63 6f |to use a|n Ada co|
|00004250| 6d 70 69 6c 65 72 20 74 | 68 61 74 0a 20 20 20 73 |mpiler t|hat. s|
|00004260| 75 70 70 6f 72 74 73 20 | 70 72 61 67 6d 61 20 54 |upports |pragma T|
|00004270| 69 6d 65 5f 53 6c 69 63 | 65 2c 20 6f 72 20 64 6f |ime_Slic|e, or do|
|00004280| 20 74 68 65 20 73 63 68 | 65 64 75 6c 69 6e 67 20 | the sch|eduling |
|00004290| 68 69 6d 73 65 6c 66 20 | 28 62 79 20 63 68 61 6e |himself |(by chan|
|000042a0| 67 69 6e 67 0a 20 20 20 | 74 68 65 20 69 6d 70 6c |ging. |the impl|
|000042b0| 65 6d 65 6e 74 61 74 69 | 6f 6e 20 6f 66 20 68 69 |ementati|on of hi|
|000042c0| 73 20 41 64 61 20 70 72 | 6f 67 72 61 6d 20 74 6f |s Ada pr|ogram to|
|000042d0| 20 65 6e 73 75 72 65 20 | 74 68 61 74 20 6e 6f 20 | ensure |that no |
|000042e0| 74 61 73 6b 20 73 74 61 | 72 76 65 73 0a 20 20 20 |task sta|rves. |
|000042f0| 61 6e 6f 74 68 65 72 29 | 2e 0a 0a 20 20 20 4f 6e |another)|... On|
|00004300| 65 20 73 6f 6c 75 74 69 | 6f 6e 20 69 73 20 74 6f |e soluti|on is to|
|00004310| 20 65 78 70 6c 69 63 69 | 74 6c 79 20 70 75 74 20 | explici|tly put |
|00004320| 74 68 65 20 6d 61 69 6e | 20 74 61 73 6b 20 74 6f |the main| task to|
|00004330| 20 73 6c 65 65 70 20 77 | 69 74 68 69 6e 20 61 20 | sleep w|ithin a |
|00004340| 6c 6f 6f 70 0a 20 20 20 | 63 6f 6e 73 74 72 75 63 |loop. |construc|
|00004350| 74 20 69 6e 20 6f 72 64 | 65 72 20 74 6f 20 61 76 |t in ord|er to av|
|00004360| 6f 69 64 20 73 74 61 72 | 76 61 74 69 6f 6e 20 6f |oid star|vation o|
|00004370| 66 20 74 68 65 20 6f 74 | 68 65 72 20 74 61 73 6b |f the ot|her task|
|00004380| 28 73 29 2c 20 61 73 20 | 69 6e 3a 0a 0a 20 20 20 |(s), as |in:.. |
|00004390| 20 20 70 72 6f 63 65 64 | 75 72 65 20 4d 61 69 6e | proced|ure Main|
|000043a0| 20 69 73 0a 20 20 20 20 | 20 20 20 74 61 73 6b 20 | is. | task |
|000043b0| 54 65 73 74 3b 0a 20 20 | 20 20 20 20 20 74 61 73 |Test;. | tas|
|000043c0| 6b 20 62 6f 64 79 20 54 | 65 73 74 20 69 73 0a 20 |k body T|est is. |
|000043d0| 20 20 20 20 20 20 62 65 | 67 69 6e 0a 20 20 20 20 | be|gin. |
|000043e0| 20 20 20 20 20 6c 6f 6f | 70 0a 20 20 20 20 20 20 | loo|p. |
|000043f0| 20 20 20 20 20 64 65 6c | 61 79 20 31 2e 30 3b 0a | del|ay 1.0;.|
|00004400| 20 20 20 20 20 20 20 20 | 20 20 20 54 65 78 74 5f | | Text_|
|00004410| 49 4f 2e 50 75 74 5f 4c | 69 6e 65 20 28 22 54 65 |IO.Put_L|ine ("Te|
|00004420| 73 74 22 29 3b 0a 20 20 | 20 20 20 20 20 20 20 65 |st");. | e|
|00004430| 6e 64 20 6c 6f 6f 70 3b | 0a 20 20 20 20 20 20 20 |nd loop;|. |
|00004440| 65 6e 64 20 54 65 73 74 | 3b 0a 20 20 20 20 20 62 |end Test|;. b|
|00004450| 65 67 69 6e 0a 20 20 20 | 20 20 20 20 6c 6f 6f 70 |egin. | loop|
|00004460| 0a 20 20 20 20 20 20 20 | 20 20 64 65 6c 61 79 20 |. | delay |
|00004470| 32 30 2e 30 3b 0a 20 20 | 20 20 20 20 20 20 20 54 |20.0;. | T|
|00004480| 65 78 74 5f 49 4f 2e 50 | 75 74 5f 4c 69 6e 65 20 |ext_IO.P|ut_Line |
|00004490| 28 22 53 6c 65 65 70 69 | 6e 67 20 74 68 65 6e 20 |("Sleepi|ng then |
|000044a0| 77 72 69 74 69 6e 67 22 | 29 3b 0a 20 20 20 20 20 |writing"|);. |
|000044b0| 20 20 65 6e 64 20 6c 6f | 6f 70 3b 0a 20 20 20 20 | end lo|op;. |
|000044c0| 20 65 6e 64 20 4d 61 69 | 6e 3b 0a 0a 0a 33 2e 37 | end Mai|n;...3.7|
|000044d0| 3a 20 48 6f 77 20 64 6f | 20 49 20 69 6e 63 72 65 |: How do| I incre|
|000044e0| 61 73 65 20 74 68 65 20 | 73 74 61 63 6b 20 73 69 |ase the |stack si|
|000044f0| 7a 65 20 66 6f 72 20 61 | 20 74 61 73 6b 3f 0a 0a |ze for a| task?..|
|00004500| 20 20 20 44 65 66 69 6e | 65 20 74 68 65 20 74 61 | Defin|e the ta|
|00004510| 73 6b 20 61 73 20 61 20 | 22 74 61 73 6b 20 74 79 |sk as a |"task ty|
|00004520| 70 65 22 20 61 6e 64 20 | 74 68 65 6e 20 75 73 65 |pe" and |then use|
|00004530| 20 61 20 70 72 61 67 6d | 61 20 72 65 70 72 65 73 | a pragm|a repres|
|00004540| 65 6e 74 61 74 69 6f 6e | 0a 20 20 20 63 6c 61 75 |entation|. clau|
|00004550| 73 65 2e 0a 0a 20 20 20 | 20 20 74 61 73 6b 20 74 |se... | task t|
|00004560| 79 70 65 20 41 5f 54 61 | 73 6b 5f 54 79 70 65 3b |ype A_Ta|sk_Type;|
|00004570| 0a 20 20 20 20 20 66 6f | 72 20 41 5f 54 61 73 6b |. fo|r A_Task|
|00004580| 5f 54 79 70 65 27 53 54 | 4f 52 41 47 45 5f 53 49 |_Type'ST|ORAGE_SI|
|00004590| 5a 45 20 75 73 65 20 31 | 30 5f 30 30 30 3b 0a 20 |ZE use 1|0_000;. |
|000045a0| 20 20 20 20 2d 2d 20 31 | 30 4b 20 62 79 74 65 73 | -- 1|0K bytes|
|000045b0| 20 61 6c 6c 6f 63 61 74 | 65 64 20 74 6f 20 69 6e | allocat|ed to in|
|000045c0| 73 74 61 6e 63 65 73 20 | 6f 66 20 41 5f 54 61 73 |stances |of A_Tas|
|000045d0| 6b 5f 54 79 70 65 0a 20 | 20 20 20 20 41 5f 54 61 |k_Type. | A_Ta|
|000045e0| 73 6b 20 3a 20 41 5f 54 | 61 73 6b 5f 54 79 70 65 |sk : A_T|ask_Type|
|000045f0| 3b 0a 0a 0a 33 2e 38 3a | 20 57 68 61 74 27 73 20 |;...3.8:| What's |
|00004600| 74 68 65 20 64 69 66 66 | 65 72 65 6e 63 65 20 62 |the diff|erence b|
|00004610| 65 74 77 65 65 6e 20 61 | 20 74 79 70 65 20 63 6f |etween a| type co|
|00004620| 6e 76 65 72 73 69 6f 6e | 20 61 6e 64 20 61 20 71 |nversion| and a q|
|00004630| 75 61 6c 69 66 69 65 72 | 3f 0a 0a 20 20 20 55 73 |ualifier|?.. Us|
|00004640| 65 20 61 20 71 75 61 6c | 69 66 69 65 72 20 28 74 |e a qual|ifier (t|
|00004650| 69 63 6b 29 20 74 6f 20 | 74 65 6c 6c 20 74 68 65 |ick) to |tell the|
|00004660| 20 63 6f 6d 70 69 6c 65 | 72 20 77 68 61 74 20 74 | compile|r what t|
|00004670| 79 70 65 20 69 74 20 63 | 61 6e 20 65 78 70 65 63 |ype it c|an expec|
|00004680| 74 3b 0a 20 20 20 74 68 | 69 73 20 69 73 20 73 74 |t;. th|is is st|
|00004690| 72 69 63 74 6c 79 20 61 | 20 63 6f 6d 70 69 6c 65 |rictly a| compile|
|000046a0| 2d 74 69 6d 65 20 69 73 | 73 75 65 3a 20 61 20 71 |-time is|sue: a q|
|000046b0| 75 61 6c 69 66 69 65 72 | 20 22 68 69 6e 74 73 22 |ualifier| "hints"|
|000046c0| 20 74 68 65 20 74 79 70 | 65 2c 0a 20 20 20 75 73 | the typ|e,. us|
|000046d0| 75 61 6c 6c 79 20 74 6f | 20 72 65 6d 6f 76 65 20 |ually to| remove |
|000046e0| 61 6e 20 61 6d 62 69 67 | 75 69 74 79 2e 20 55 73 |an ambig|uity. Us|
|000046f0| 65 20 61 20 63 6f 6e 76 | 65 72 73 69 6f 6e 20 74 |e a conv|ersion t|
|00004700| 6f 20 74 65 6c 6c 20 74 | 68 65 20 63 6f 6d 70 69 |o tell t|he compi|
|00004710| 6c 65 72 0a 20 20 20 74 | 6f 20 63 6f 6e 76 65 72 |ler. t|o conver|
|00004720| 74 20 61 6e 20 65 78 70 | 72 65 73 73 69 6f 6e 20 |t an exp|ression |
|00004730| 66 72 6f 6d 20 6f 6e 65 | 20 74 79 70 65 20 74 6f |from one| type to|
|00004740| 20 61 6e 6f 74 68 65 72 | 20 28 75 73 75 61 6c 6c | another| (usuall|
|00004750| 79 20 77 69 74 68 69 6e | 20 6f 6e 65 0a 20 20 20 |y within| one. |
|00004760| 64 65 72 69 76 61 74 69 | 6f 6e 20 68 69 65 72 61 |derivati|on hiera|
|00004770| 72 63 68 79 29 3b 20 74 | 68 69 73 20 6f 70 65 72 |rchy); t|his oper|
|00004780| 61 74 69 6f 6e 20 6d 61 | 79 20 72 65 71 75 69 72 |ation ma|y requir|
|00004790| 65 20 61 20 63 68 61 6e | 67 65 20 6f 66 0a 20 20 |e a chan|ge of. |
|000047a0| 20 72 65 70 72 65 73 65 | 6e 74 61 74 69 6f 6e 20 | represe|ntation |
|000047b0| 61 74 20 72 75 6e 2d 74 | 69 6d 65 20 28 65 2e 67 |at run-t|ime (e.g|
|000047c0| 2e 20 69 6e 20 63 61 73 | 65 20 6f 66 20 61 20 72 |. in cas|e of a r|
|000047d0| 65 70 72 65 73 65 6e 74 | 61 74 69 6f 6e 20 63 6c |epresent|ation cl|
|000047e0| 61 75 73 65 0a 20 20 20 | 61 70 70 6c 79 69 6e 67 |ause. |applying|
|000047f0| 20 65 78 63 6c 75 73 69 | 76 65 6c 79 20 74 6f 20 | exclusi|vely to |
|00004800| 74 68 65 20 73 6f 75 72 | 63 65 20 74 79 70 65 29 |the sour|ce type)|
|00004810| 2e 0a 0a 20 20 20 20 20 | 41 20 3a 20 49 6e 74 65 |... |A : Inte|
|00004820| 67 65 72 20 3a 3d 20 49 | 6e 74 65 67 65 72 27 28 |ger := I|nteger'(|
|00004830| 31 29 3b 20 20 2d 2d 20 | 74 68 69 73 20 69 73 20 |1); -- |this is |
|00004840| 61 20 71 75 61 6c 69 66 | 69 65 72 3a 20 73 61 6d |a qualif|ier: sam|
|00004850| 65 20 61 73 20 22 3a 3d | 20 31 3b 22 0a 20 20 20 |e as ":=| 1;". |
|00004860| 20 20 42 20 3a 20 49 6e | 74 65 67 65 72 20 3a 3d | B : In|teger :=|
|00004870| 20 49 6e 74 65 67 65 72 | 20 28 31 29 3b 20 20 2d | Integer| (1); -|
|00004880| 2d 20 74 68 69 73 20 69 | 73 20 61 20 63 6f 6e 76 |- this i|s a conv|
|00004890| 65 72 73 69 6f 6e 0a 0a | 0a 33 2e 39 3a 20 48 6f |ersion..|.3.9: Ho|
|000048a0| 77 20 64 6f 20 49 20 61 | 76 6f 69 64 20 74 68 65 |w do I a|void the|
|000048b0| 20 70 6f 74 65 6e 74 69 | 61 6c 20 73 70 61 63 65 | potenti|al space|
|000048c0| 20 69 6e 20 66 72 6f 6e | 74 20 6f 66 20 49 6e 74 | in fron|t of Int|
|000048d0| 65 67 65 72 27 49 6d 61 | 67 65 3f 0a 0a 20 20 20 |eger'Ima|ge?.. |
|000048e0| 55 73 65 20 74 68 65 20 | 66 75 6e 63 74 69 6f 6e |Use the |function|
|000048f0| 20 54 72 69 6d 20 66 72 | 6f 6d 20 70 61 63 6b 61 | Trim fr|om packa|
|00004900| 67 65 20 41 64 61 2e 53 | 74 72 69 6e 67 73 2e 46 |ge Ada.S|trings.F|
|00004910| 69 78 65 64 20 28 79 6f | 75 20 63 61 6e 0a 20 20 |ixed (yo|u can. |
|00004920| 20 61 63 74 75 61 6c 6c | 79 20 74 72 69 6d 20 73 | actuall|y trim s|
|00004930| 74 72 69 6e 67 73 20 69 | 6e 20 6d 61 6e 79 20 6f |trings i|n many o|
|00004940| 74 68 65 72 20 75 73 65 | 66 75 6c 20 77 61 79 73 |ther use|ful ways|
|00004950| 29 3a 0a 0a 20 20 20 20 | 20 66 75 6e 63 74 69 6f |):.. | functio|
|00004960| 6e 20 4d 79 5f 49 6d 61 | 67 65 20 28 49 20 3a 20 |n My_Ima|ge (I : |
|00004970| 49 6e 74 65 67 65 72 29 | 0a 20 20 20 20 20 20 20 |Integer)|. |
|00004980| 72 65 74 75 72 6e 20 53 | 74 72 69 6e 67 20 69 73 |return S|tring is|
|00004990| 0a 20 20 20 20 20 62 65 | 67 69 6e 20 2d 2d 20 4d |. be|gin -- M|
|000049a0| 79 5f 49 6d 61 67 65 0a | 20 20 20 20 20 20 20 72 |y_Image.| r|
|000049b0| 65 74 75 72 6e 20 41 64 | 61 2e 53 74 72 69 6e 67 |eturn Ad|a.String|
|000049c0| 73 2e 46 69 78 65 64 2e | 54 72 69 6d 20 28 49 6e |s.Fixed.|Trim (In|
|000049d0| 74 65 67 65 72 27 49 6d | 61 67 65 20 28 49 29 2c |teger'Im|age (I),|
|000049e0| 20 41 64 61 2e 53 74 72 | 69 6e 67 73 2e 4c 65 66 | Ada.Str|ings.Lef|
|000049f0| 74 29 3b 0a 20 20 20 20 | 20 65 6e 64 20 4d 79 5f |t);. | end My_|
|00004a00| 49 6d 61 67 65 3b 0a 0a | 20 20 20 20 20 2e 2e 2e |Image;..| ...|
|00004a10| 20 4d 79 5f 49 6d 61 67 | 65 20 28 31 32 29 20 3d | My_Imag|e (12) =|
|00004a20| 20 22 31 32 22 20 2e 2e | 2e 0a 0a 0a 20 20 20 49 | "12" ..|.... I|
|00004a30| 6e 20 41 64 61 20 38 33 | 2c 20 63 6f 64 65 20 61 |n Ada 83|, code a|
|00004a40| 20 66 75 6e 63 74 69 6f | 6e 20 74 68 61 74 20 61 | functio|n that a|
|00004a50| 63 63 65 70 74 73 20 61 | 20 73 74 72 69 6e 67 20 |ccepts a| string |
|00004a60| 61 6e 64 20 73 74 72 69 | 70 73 20 74 68 65 0a 20 |and stri|ps the. |
|00004a70| 20 20 6c 65 61 64 69 6e | 67 20 62 6c 61 6e 6b 3a | leadin|g blank:|
|00004a80| 0a 0a 20 20 20 20 20 66 | 75 6e 63 74 69 6f 6e 20 |.. f|unction |
|00004a90| 53 74 72 69 70 5f 4c 65 | 61 64 69 6e 67 5f 42 6c |Strip_Le|ading_Bl|
|00004aa0| 61 6e 6b 20 28 53 74 72 | 20 3a 20 53 74 72 69 6e |ank (Str| : Strin|
|00004ab0| 67 29 0a 20 20 20 20 20 | 20 20 72 65 74 75 72 6e |g). | return|
|00004ac0| 20 53 74 72 69 6e 67 20 | 69 73 0a 20 20 20 20 20 | String |is. |
|00004ad0| 62 65 67 69 6e 20 2d 2d | 20 53 74 72 69 70 5f 4c |begin --| Strip_L|
|00004ae0| 65 61 64 69 6e 67 5f 42 | 6c 61 6e 6b 0a 20 20 20 |eading_B|lank. |
|00004af0| 20 20 20 20 69 66 20 53 | 74 72 20 28 53 74 72 27 | if S|tr (Str'|
|00004b00| 46 69 72 73 74 29 20 3d | 20 27 20 27 20 74 68 65 |First) =| ' ' the|
|00004b10| 6e 0a 20 20 20 20 20 20 | 20 20 20 72 65 74 75 72 |n. | retur|
|00004b20| 6e 20 53 74 72 20 28 31 | 2b 53 74 72 27 46 69 72 |n Str (1|+Str'Fir|
|00004b30| 73 74 20 2e 2e 20 53 74 | 72 27 4c 61 73 74 29 3b |st .. St|r'Last);|
|00004b40| 0a 20 20 20 20 20 20 20 | 65 6c 73 65 0a 20 20 20 |. |else. |
|00004b50| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 53 74 72 | re|turn Str|
|00004b60| 3b 0a 20 20 20 20 20 20 | 20 65 6e 64 20 69 66 3b |;. | end if;|
|00004b70| 0a 20 20 20 20 20 65 6e | 64 20 53 74 72 69 70 5f |. en|d Strip_|
|00004b80| 4c 65 61 64 69 6e 67 5f | 42 6c 61 6e 6b 3b 0a 0a |Leading_|Blank;..|
|00004b90| 20 20 20 20 20 2e 2e 2e | 0a 0a 20 20 20 20 20 66 | ...|.. f|
|00004ba0| 75 6e 63 74 69 6f 6e 20 | 4d 79 5f 49 6d 61 67 65 |unction |My_Image|
|00004bb0| 20 28 49 20 3a 20 49 6e | 74 65 67 65 72 29 0a 20 | (I : In|teger). |
|00004bc0| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 53 74 72 | re|turn Str|
|00004bd0| 69 6e 67 20 69 73 0a 20 | 20 20 20 20 62 65 67 69 |ing is. | begi|
|00004be0| 6e 20 2d 2d 20 4d 79 5f | 49 6d 61 67 65 0a 20 20 |n -- My_|Image. |
|00004bf0| 20 20 20 20 20 72 65 74 | 75 72 6e 20 53 74 72 69 | ret|urn Stri|
|00004c00| 70 5f 4c 65 61 64 69 6e | 67 5f 42 6c 61 6e 6b 20 |p_Leadin|g_Blank |
|00004c10| 28 49 6e 74 65 67 65 72 | 27 49 6d 61 67 65 20 28 |(Integer|'Image (|
|00004c20| 49 29 29 3b 0a 20 20 20 | 20 20 65 6e 64 20 4d 79 |I));. | end My|
|00004c30| 5f 49 6d 61 67 65 3b 0a | 0a 20 20 20 20 20 2e 2e |_Image;.|. ..|
|00004c40| 2e 20 4d 79 5f 49 6d 61 | 67 65 20 28 31 32 29 20 |. My_Ima|ge (12) |
|00004c50| 3d 20 22 31 32 22 20 2e | 2e 2e 0a 0a 0a 33 2e 31 |= "12" .|.....3.1|
|00004c60| 30 3a 20 57 68 79 20 69 | 73 20 61 6e 20 65 78 63 |0: Why i|s an exc|
|00004c70| 65 70 74 69 6f 6e 20 72 | 61 69 73 65 64 20 77 68 |eption r|aised wh|
|00004c80| 65 6e 20 67 69 76 69 6e | 67 20 61 20 64 65 66 61 |en givin|g a defa|
|00004c90| 75 6c 74 20 64 69 73 63 | 72 69 6d 69 6e 61 6e 74 |ult disc|riminant|
|00004ca0| 3f 0a 0a 20 20 20 4c 65 | 74 27 73 20 61 73 73 75 |?.. Le|t's assu|
|00004cb0| 6d 65 20 79 6f 75 20 77 | 6f 75 6c 64 20 6c 69 6b |me you w|ould lik|
|00004cc0| 65 20 74 6f 20 6d 6f 64 | 65 6c 20 76 61 72 79 69 |e to mod|el varyi|
|00004cd0| 6e 67 2d 6c 65 6e 67 74 | 68 20 73 74 72 69 6e 67 |ng-lengt|h string|
|00004ce0| 73 3a 0a 0a 20 20 20 20 | 20 74 79 70 65 20 56 5f |s:.. | type V_|
|00004cf0| 53 74 72 69 6e 67 20 28 | 53 69 7a 65 20 3a 20 4e |String (|Size : N|
|00004d00| 61 74 75 72 61 6c 20 3a | 3d 20 30 29 20 69 73 0a |atural :|= 0) is.|
|00004d10| 20 20 20 20 20 20 20 72 | 65 63 6f 72 64 0a 20 20 | r|ecord. |
|00004d20| 20 20 20 20 20 20 20 53 | 20 3a 20 53 74 72 69 6e | S| : Strin|
|00004d30| 67 20 28 31 20 2e 2e 20 | 53 69 7a 65 29 3b 0a 20 |g (1 .. |Size);. |
|00004d40| 20 20 20 20 20 20 65 6e | 64 20 72 65 63 6f 72 64 | en|d record|
|00004d50| 3b 0a 0a 0a 20 20 20 28 | 66 72 6f 6d 20 52 6f 62 |;... (|from Rob|
|00004d60| 65 72 74 20 44 65 77 61 | 72 29 0a 0a 20 20 20 57 |ert Dewa|r).. W|
|00004d70| 68 65 6e 20 79 6f 75 20 | 67 69 76 65 20 61 20 64 |hen you |give a d|
|00004d80| 65 66 61 75 6c 74 20 64 | 69 73 63 72 69 6d 69 6e |efault d|iscrimin|
|00004d90| 61 6e 74 2c 20 74 68 65 | 6e 20 6f 6e 65 20 6d 65 |ant, the|n one me|
|00004da0| 74 68 6f 64 20 28 49 20 | 61 63 74 75 61 6c 6c 79 |thod (I |actually|
|00004db0| 0a 20 20 20 74 68 69 6e | 6b 20 69 74 20 69 73 20 |. thin|k it is |
|00004dc0| 74 68 65 20 70 72 65 66 | 65 72 72 65 64 20 6d 65 |the pref|erred me|
|00004dd0| 74 68 6f 64 29 20 6f 66 | 20 69 6d 70 6c 65 6d 65 |thod) of| impleme|
|00004de0| 6e 74 61 74 69 6f 6e 20 | 69 73 20 74 6f 20 61 6c |ntation |is to al|
|00004df0| 6c 6f 63 61 74 65 20 74 | 68 65 0a 20 20 20 6d 61 |locate t|he. ma|
|00004e00| 78 69 6d 75 6d 20 70 6f | 73 73 69 62 6c 65 20 6c |ximum po|ssible l|
|00004e10| 65 6e 67 74 68 2e 20 53 | 69 6e 63 65 20 79 6f 75 |ength. S|ince you|
|00004e20| 72 20 64 69 73 63 72 69 | 6d 69 6e 61 6e 74 20 69 |r discri|minant i|
|00004e30| 73 20 6f 66 20 74 79 70 | 65 20 4e 61 74 75 72 61 |s of typ|e Natura|
|00004e40| 6c 2c 0a 20 20 20 74 68 | 69 73 20 63 6c 65 61 72 |l,. th|is clear|
|00004e50| 6c 79 20 77 6f 6e 27 74 | 20 77 6f 72 6b 21 0a 0a |ly won't| work!..|
|00004e60| 20 20 20 47 4e 41 54 20 | 6d 61 79 20 63 6f 6d 70 | GNAT |may comp|
|00004e70| 69 6c 65 20 69 74 2c 20 | 62 75 74 20 69 74 20 77 |ile it, |but it w|
|00004e80| 6f 6e 27 74 20 72 75 6e | 20 69 74 2c 20 61 6e 64 |on't run| it, and|
|00004e90| 20 69 6e 64 65 65 64 20 | 49 20 63 6f 6e 73 69 64 | indeed |I consid|
|00004ea0| 65 72 20 69 74 20 61 0a | 20 20 20 47 4e 41 54 20 |er it a.| GNAT |
|00004eb0| 62 75 67 20 28 6f 6e 20 | 74 68 65 20 74 6f 64 6f |bug (on |the todo|
|00004ec0| 20 6c 69 73 74 29 20 74 | 68 61 74 20 6e 6f 20 77 | list) t|hat no w|
|00004ed0| 61 72 6e 69 6e 67 20 69 | 73 20 69 73 73 75 65 64 |arning i|s issued|
|00004ee0| 20 61 74 20 63 6f 6d 70 | 69 6c 65 20 74 69 6d 65 | at comp|ile time|
|00004ef0| 0a 20 20 20 66 6f 72 20 | 74 68 69 73 20 6d 69 73 |. for |this mis|
|00004f00| 75 73 65 2e 0a 0a 20 20 | 20 53 6f 6d 65 20 63 6f |use... | Some co|
|00004f10| 6d 70 69 6c 65 72 73 2c | 20 6e 6f 74 61 62 6c 79 |mpilers,| notably|
|00004f20| 20 41 6c 73 79 73 20 61 | 6e 64 20 52 52 2c 20 68 | Alsys a|nd RR, h|
|00004f30| 61 76 65 20 61 74 20 6c | 65 61 73 74 20 70 61 72 |ave at l|east par|
|00004f40| 74 69 61 6c 6c 79 20 22 | 73 6f 6c 76 65 64 22 0a |tially "|solved".|
|00004f50| 20 20 20 74 68 69 73 20 | 70 72 6f 62 6c 65 6d 20 | this |problem |
|00004f60| 62 79 20 69 6e 74 72 6f | 64 75 63 69 6e 67 20 68 |by intro|ducing h|
|00004f70| 69 64 64 65 6e 20 70 6f | 69 6e 74 65 72 73 2c 20 |idden po|inters, |
|00004f80| 62 75 74 20 74 68 69 73 | 20 74 6f 20 6d 65 20 69 |but this| to me i|
|00004f90| 73 20 61 6e 0a 20 20 20 | 75 6e 64 65 73 69 72 61 |s an. |undesira|
|00004fa0| 62 6c 65 20 69 6d 70 6c | 65 6d 65 6e 74 61 74 69 |ble impl|ementati|
|00004fb0| 6f 6e 20 63 68 6f 69 63 | 65 2e 0a 0a 20 20 20 46 |on choic|e... F|
|00004fc0| 69 72 73 74 2c 20 69 74 | 20 6d 65 61 6e 73 20 74 |irst, it| means t|
|00004fd0| 68 65 72 65 20 69 73 20 | 68 69 64 64 65 6e 20 68 |here is |hidden h|
|00004fe0| 65 61 70 20 61 63 74 69 | 76 69 74 79 2c 20 77 68 |eap acti|vity, wh|
|00004ff0| 69 63 68 20 73 65 65 6d | 73 0a 20 20 20 75 6e 64 |ich seem|s. und|
|00005000| 65 73 69 72 61 62 6c 65 | 2e 20 49 6e 20 61 20 6c |esirable|. In a l|
|00005010| 61 6e 67 75 61 67 65 20 | 77 68 65 72 65 20 70 6f |anguage |where po|
|00005020| 69 6e 74 65 72 73 20 61 | 72 65 20 65 78 70 6c 69 |inters a|re expli|
|00005030| 63 69 74 2c 20 69 74 20 | 69 73 0a 20 20 20 67 65 |cit, it |is. ge|
|00005040| 6e 65 72 61 6c 6c 79 20 | 61 20 67 6f 6f 64 20 69 |nerally |a good i|
|00005050| 64 65 61 20 69 66 20 61 | 6c 6c 6f 63 61 74 69 6f |dea if a|llocatio|
|00005060| 6e 20 69 73 20 61 6c 73 | 6f 20 65 78 70 6c 69 63 |n is als|o explic|
|00005070| 69 74 2c 20 61 6e 64 20 | 63 65 72 74 61 69 6e 6c |it, and |certainl|
|00005080| 79 0a 20 20 20 66 6f 72 | 20 72 65 61 6c 2d 74 69 |y. for| real-ti|
|00005090| 6d 65 20 77 6f 72 6b 2c | 20 68 69 64 64 65 6e 20 |me work,| hidden |
|000050a0| 61 6e 79 74 68 69 6e 67 | 20 69 73 20 77 6f 72 72 |anything| is worr|
|000050b0| 69 73 6f 6d 65 2e 0a 0a | 20 20 20 53 65 63 6f 6e |isome...| Secon|
|000050c0| 64 2c 20 69 74 20 69 73 | 20 6e 6f 74 20 65 61 73 |d, it is| not eas|
|000050d0| 79 20 74 6f 20 64 6f 20 | 75 6e 69 66 6f 72 6d 6c |y to do |uniforml|
|000050e0| 79 2e 20 41 6c 73 79 73 | 20 65 6e 64 73 20 75 70 |y. Alsys| ends up|
|000050f0| 20 69 6e 74 72 6f 64 75 | 63 69 6e 67 0a 20 20 20 | introdu|cing. |
|00005100| 61 72 62 69 74 72 61 72 | 79 20 72 65 73 74 72 69 |arbitrar|y restri|
|00005110| 63 74 69 6f 6e 73 20 6f | 6e 20 74 68 65 20 63 6f |ctions o|n the co|
|00005120| 6d 70 6f 73 69 74 69 6f | 6e 20 6f 66 20 73 75 63 |mpositio|n of suc|
|00005130| 68 20 74 79 70 65 73 20 | 28 74 72 79 20 6d 61 6b |h types |(try mak|
|00005140| 69 6e 67 20 61 6e 0a 20 | 20 20 61 72 72 61 79 20 |ing an. | array |
|00005150| 6f 66 20 74 68 65 6d 29 | 2c 20 61 6e 64 20 52 52 |of them)|, and RR|
|00005160| 20 69 6e 74 72 6f 64 75 | 63 65 73 20 6e 6f 6e 2d | introdu|ces non-|
|00005170| 63 6f 6e 74 69 67 75 6f | 75 73 20 72 65 70 72 65 |contiguo|us repre|
|00005180| 73 65 6e 74 61 74 69 6f | 6e 73 2c 0a 20 20 20 77 |sentatio|ns,. w|
|00005190| 68 69 63 68 20 61 72 65 | 20 6c 65 67 61 6c 20 62 |hich are| legal b|
|000051a0| 75 74 20 74 72 6f 75 62 | 6c 65 73 6f 6d 65 2e 0a |ut troub|lesome..|
|000051b0| 0a 20 20 20 54 6f 20 22 | 73 6f 6c 76 65 22 20 74 |. To "|solve" t|
|000051c0| 68 65 20 70 72 6f 62 6c | 65 6d 20 79 6f 75 72 73 |he probl|em yours|
|000051d0| 65 6c 66 2c 20 6a 75 73 | 74 20 64 65 63 6c 61 72 |elf, jus|t declar|
|000051e0| 65 20 61 20 72 65 61 73 | 6f 6e 61 62 6c 65 20 6d |e a reas|onable m|
|000051f0| 61 78 69 6d 75 6d 0a 20 | 20 20 6c 65 6e 67 74 68 |aximum. | length|
|00005200| 2c 20 61 6e 64 20 75 73 | 65 20 61 20 73 75 62 74 |, and us|e a subt|
|00005210| 79 70 65 20 72 65 70 72 | 65 73 65 6e 74 69 6e 67 |ype repr|esenting|
|00005220| 20 74 68 69 73 20 6c 65 | 6e 67 74 68 20 61 73 20 | this le|ngth as |
|00005230| 74 68 65 20 73 75 62 74 | 79 70 65 20 6f 66 0a 20 |the subt|ype of. |
|00005240| 20 20 74 68 65 20 64 69 | 73 63 72 69 6d 69 6e 61 | the di|scrimina|
|00005250| 6e 74 3a 0a 0a 20 20 20 | 20 20 4d 61 78 5f 4c 65 |nt:.. | Max_Le|
|00005260| 6e 67 74 68 20 3a 20 63 | 6f 6e 73 74 61 6e 74 20 |ngth : c|onstant |
|00005270| 3a 3d 20 32 30 30 3b 0a | 0a 20 20 20 20 20 73 75 |:= 200;.|. su|
|00005280| 62 74 79 70 65 20 49 6e | 64 65 78 20 69 73 0a 20 |btype In|dex is. |
|00005290| 20 20 20 20 20 20 4e 61 | 74 75 72 61 6c 20 72 61 | Na|tural ra|
|000052a0| 6e 67 65 20 30 20 2e 2e | 20 4d 61 78 5f 4c 65 6e |nge 0 ..| Max_Len|
|000052b0| 67 74 68 3b 0a 0a 20 20 | 20 20 20 74 79 70 65 20 |gth;.. | type |
|000052c0| 56 5f 53 74 72 69 6e 67 | 20 28 53 69 7a 65 20 3a |V_String| (Size :|
|000052d0| 20 49 6e 64 65 78 20 3a | 3d 20 30 29 20 69 73 0a | Index :|= 0) is.|
|000052e0| 20 20 20 20 20 20 20 72 | 65 63 6f 72 64 0a 20 20 | r|ecord. |
|000052f0| 20 20 20 20 20 20 20 53 | 20 3a 20 53 74 72 69 6e | S| : Strin|
|00005300| 67 20 28 31 20 2e 2e 20 | 53 69 7a 65 29 3b 0a 20 |g (1 .. |Size);. |
|00005310| 20 20 20 20 20 20 65 6e | 64 20 72 65 63 6f 72 64 | en|d record|
|00005320| 3b 0a 0a 0a 33 2e 31 31 | 3a 20 57 68 65 6e 20 49 |;...3.11|: When I|
|00005330| 20 77 61 6e 74 20 61 6e | 20 49 6e 74 65 67 65 72 | want an| Integer|
|00005340| 20 74 79 70 65 2c 20 77 | 68 61 74 27 73 20 77 72 | type, w|hat's wr|
|00005350| 6f 6e 67 20 77 69 74 68 | 20 6a 75 73 74 20 75 73 |ong with| just us|
|00005360| 69 6e 67 20 74 68 65 20 | 70 72 65 64 65 66 69 6e |ing the |predefin|
|00005370| 65 64 0a 74 79 70 65 20 | 49 6e 74 65 67 65 72 20 |ed.type |Integer |
|00005380| 6f 72 20 4c 6f 6e 67 5f | 49 6e 74 65 67 65 72 3f |or Long_|Integer?|
|00005390| 20 57 68 79 20 77 6f 75 | 6c 64 20 49 20 65 76 65 | Why wou|ld I eve|
|000053a0| 72 20 77 61 6e 74 20 74 | 6f 20 64 65 63 6c 61 72 |r want t|o declar|
|000053b0| 65 20 6e 65 77 20 49 6e | 74 65 67 65 72 0a 74 79 |e new In|teger.ty|
|000053c0| 70 65 73 3f 0a 0a 20 20 | 20 49 66 20 79 6f 75 20 |pes?.. | If you |
|000053d0| 64 65 63 6c 61 72 65 20 | 32 20 64 69 73 74 69 6e |declare |2 distin|
|000053e0| 63 74 20 69 6e 74 65 67 | 65 72 20 74 79 70 65 73 |ct integ|er types|
|000053f0| 2c 20 66 6f 72 20 65 78 | 61 6d 70 6c 65 2c 0a 0a |, for ex|ample,..|
|00005400| 20 20 20 20 20 74 79 70 | 65 20 44 61 74 61 5f 49 | typ|e Data_I|
|00005410| 6e 64 65 78 20 20 20 20 | 20 20 20 20 69 73 20 72 |ndex | is r|
|00005420| 61 6e 67 65 20 31 2e 2e | 31 30 30 3b 0a 20 20 20 |ange 1..|100;. |
|00005430| 20 20 74 79 70 65 20 54 | 69 6d 65 5f 53 65 72 69 | type T|ime_Seri|
|00005440| 65 73 5f 49 6e 64 65 78 | 20 69 73 20 72 61 6e 67 |es_Index| is rang|
|00005450| 65 20 30 2e 2e 32 2a 2a | 31 35 2d 31 3b 0a 0a 0a |e 0..2**|15-1;...|
|00005460| 20 20 20 74 68 65 6e 20 | 6f 62 6a 65 63 74 73 20 | then |objects |
|00005470| 6f 66 20 74 79 70 65 20 | 44 61 74 61 5f 49 6e 64 |of type |Data_Ind|
|00005480| 65 78 20 63 61 6e 27 74 | 20 62 65 20 61 73 73 69 |ex can't| be assi|
|00005490| 67 6e 65 64 20 28 64 69 | 72 65 63 74 6c 79 29 20 |gned (di|rectly) |
|000054a0| 74 6f 0a 20 20 20 76 61 | 72 69 61 62 6c 65 73 20 |to. va|riables |
|000054b0| 6f 66 20 74 79 70 65 20 | 54 69 6d 65 5f 53 65 72 |of type |Time_Ser|
|000054c0| 69 65 73 5f 49 6e 64 65 | 78 2c 20 61 6e 64 20 76 |ies_Inde|x, and v|
|000054d0| 69 63 65 2d 76 65 72 73 | 61 2e 20 4c 69 6b 65 77 |ice-vers|a. Likew|
|000054e0| 69 73 65 2c 0a 20 20 20 | 76 61 72 69 61 62 6c 65 |ise,. |variable|
|000054f0| 73 20 6f 66 20 74 68 65 | 73 65 20 32 20 74 79 70 |s of the|se 2 typ|
|00005500| 65 73 20 63 61 6e 27 74 | 20 62 65 20 6d 69 78 65 |es can't| be mixe|
|00005510| 64 20 69 6e 20 61 72 69 | 74 68 6d 65 74 69 63 61 |d in ari|thmetica|
|00005520| 6c 20 65 78 70 72 65 73 | 73 69 6f 6e 73 0a 20 20 |l expres|sions. |
|00005530| 20 28 77 69 74 68 6f 75 | 74 20 65 78 70 6c 69 63 | (withou|t explic|
|00005540| 69 74 20 74 79 70 65 20 | 63 6f 6e 76 65 72 73 69 |it type |conversi|
|00005550| 6f 6e 73 29 2e 20 54 68 | 69 73 20 6d 61 79 20 73 |ons). Th|is may s|
|00005560| 65 65 6d 20 6c 69 6b 65 | 20 61 20 73 6f 75 72 63 |eem like| a sourc|
|00005570| 65 20 6f 66 0a 20 20 20 | 65 6e 64 6c 65 73 73 20 |e of. |endless |
|00005580| 69 72 72 69 74 61 74 69 | 6f 6e 2c 20 62 75 74 20 |irritati|on, but |
|00005590| 6f 6e 20 74 68 65 20 63 | 6f 6e 74 72 61 72 79 2c |on the c|ontrary,|
|000055a0| 20 67 6f 6f 64 20 70 72 | 6f 67 61 6d 6d 65 72 73 | good pr|ogammers|
|000055b0| 20 75 73 65 20 69 74 20 | 74 6f 0a 20 20 20 69 6d | use it |to. im|
|000055c0| 70 72 6f 76 65 20 74 68 | 65 20 63 6c 61 72 69 74 |prove th|e clarit|
|000055d0| 79 20 6f 66 20 74 68 65 | 69 72 20 63 6f 64 65 2c |y of the|ir code,|
|000055e0| 20 74 6f 20 6d 61 6b 65 | 20 69 74 20 6d 6f 72 65 | to make| it more|
|000055f0| 20 72 6f 62 75 73 74 2c | 20 61 6e 64 20 6d 6f 72 | robust,| and mor|
|00005600| 65 0a 20 20 20 70 6f 72 | 74 61 62 6c 65 2e 20 54 |e. por|table. T|
|00005610| 68 65 20 66 69 72 73 74 | 20 32 20 65 78 61 6d 70 |he first| 2 examp|
|00005620| 6c 65 73 20 64 69 73 63 | 75 73 73 20 74 68 69 73 |les disc|uss this|
|00005630| 2e 20 54 68 65 20 74 68 | 69 72 64 20 65 78 61 6d |. The th|ird exam|
|00005640| 70 6c 65 0a 20 20 20 64 | 69 73 63 75 73 73 65 73 |ple. d|iscusses|
|00005650| 20 74 68 65 20 64 65 63 | 6c 61 72 61 74 69 6f 6e | the dec|laration|
|00005660| 20 6f 66 20 6d 61 63 68 | 69 6e 65 2d 70 6f 72 74 | of mach|ine-port|
|00005670| 61 62 6c 65 20 33 32 2d | 62 69 74 20 69 6e 74 65 |able 32-|bit inte|
|00005680| 67 65 72 73 2e 0a 20 20 | 20 44 65 63 6c 61 72 69 |gers.. | Declari|
|00005690| 6e 67 20 6f 62 6a 65 63 | 74 73 20 6f 66 20 74 79 |ng objec|ts of ty|
|000056a0| 70 65 20 49 6e 74 65 67 | 65 72 20 63 61 6e 20 62 |pe Integ|er can b|
|000056b0| 65 20 68 69 67 68 6c 79 | 20 6e 6f 6e 2d 70 6f 72 |e highly| non-por|
|000056c0| 74 61 62 6c 65 2c 20 61 | 6e 64 20 6f 66 0a 20 20 |table, a|nd of. |
|000056d0| 20 63 6f 75 72 73 65 20 | 74 79 70 65 20 4c 6f 6e | course |type Lon|
|000056e0| 67 5f 49 6e 74 65 67 65 | 72 20 6d 61 79 20 6e 6f |g_Intege|r may no|
|000056f0| 74 20 65 78 69 73 74 20 | 6f 6e 20 73 6f 6d 65 20 |t exist |on some |
|00005700| 63 6f 6d 70 69 6c 65 72 | 73 2e 0a 0a 20 20 20 20 |compiler|s... |
|00005710| 45 78 61 6d 70 6c 65 20 | 31 2e 0a 0a 20 20 20 53 |Example |1... S|
|00005720| 75 70 70 6f 73 65 20 79 | 6f 75 20 64 65 63 6c 61 |uppose y|ou decla|
|00005730| 72 65 20 61 72 72 61 79 | 73 20 75 73 69 6e 67 20 |re array|s using |
|00005740| 74 68 65 20 61 62 6f 76 | 65 20 69 6e 64 69 63 65 |the abov|e indice|
|00005750| 73 3a 0a 0a 20 20 20 20 | 20 74 79 70 65 20 54 69 |s:.. | type Ti|
|00005760| 6d 65 5f 53 65 72 69 65 | 73 20 69 73 20 61 72 72 |me_Serie|s is arr|
|00005770| 61 79 20 28 54 69 6d 65 | 5f 53 65 72 69 65 73 5f |ay (Time|_Series_|
|00005780| 49 6e 64 65 78 29 20 6f | 66 20 46 6c 6f 61 74 3b |Index) o|f Float;|
|00005790| 0a 20 20 20 20 20 74 79 | 70 65 20 59 5f 41 78 69 |. ty|pe Y_Axi|
|000057a0| 73 5f 44 61 74 61 20 69 | 73 20 61 72 72 61 79 20 |s_Data i|s array |
|000057b0| 28 44 61 74 61 5f 49 6e | 64 65 78 29 20 20 20 20 |(Data_In|dex) |
|000057c0| 20 20 20 20 6f 66 20 46 | 6c 6f 61 74 3b 0a 0a 20 | of F|loat;.. |
|000057d0| 20 20 20 20 4d 65 61 73 | 75 72 65 6d 65 6e 74 20 | Meas|urement |
|000057e0| 3a 20 54 69 6d 65 5f 53 | 65 72 69 65 73 3b 0a 0a |: Time_S|eries;..|
|000057f0| 0a 20 20 20 4e 6f 77 20 | 69 66 20 79 6f 75 20 6d |. Now |if you m|
|00005800| 69 73 74 61 6b 65 6e 6c | 79 20 74 72 79 20 74 6f |istakenl|y try to|
|00005810| 20 69 74 65 72 61 74 65 | 20 6f 76 65 72 20 6f 6e | iterate| over on|
|00005820| 65 20 61 72 72 61 79 20 | 77 69 74 68 20 74 68 65 |e array |with the|
|00005830| 20 69 6e 64 65 78 20 6f | 66 0a 20 20 20 74 68 65 | index o|f. the|
|00005840| 20 6f 74 68 65 72 2c 20 | 74 68 65 20 63 6f 6d 70 | other, |the comp|
|00005850| 69 6c 65 72 20 63 61 6e | 20 63 61 74 63 68 20 74 |iler can| catch t|
|00005860| 68 65 20 65 72 72 6f 72 | 20 61 74 20 63 6f 6d 70 |he error| at comp|
|00005870| 69 6c 65 20 74 69 6d 65 | 3a 0a 0a 20 20 20 20 20 |ile time|:.. |
|00005880| 66 6f 72 20 49 20 69 6e | 20 44 61 74 61 5f 49 6e |for I in| Data_In|
|00005890| 64 65 78 20 6c 6f 6f 70 | 0a 20 20 20 20 20 20 20 |dex loop|. |
|000058a0| 20 53 75 6d 20 3a 3d 20 | 53 75 6d 20 2b 20 4d 65 | Sum := |Sum + Me|
|000058b0| 61 73 75 72 65 6d 65 6e | 74 28 49 29 3b 20 20 2d |asuremen|t(I); -|
|000058c0| 2d 20 63 6f 6d 70 69 6c | 61 74 69 6f 6e 20 65 72 |- compil|ation er|
|000058d0| 72 6f 72 0a 20 20 20 20 | 20 65 6e 64 20 6c 6f 6f |ror. | end loo|
|000058e0| 70 3b 0a 0a 0a 20 20 20 | 20 45 78 61 6d 70 6c 65 |p;... | Example|
|000058f0| 20 32 2e 0a 0a 20 20 20 | 54 68 69 73 20 69 73 20 | 2... |This is |
|00005900| 6c 69 66 74 65 64 20 66 | 72 6f 6d 20 54 75 63 6b |lifted f|rom Tuck|
|00005910| 65 72 20 54 61 66 74 27 | 73 20 62 72 69 65 66 20 |er Taft'|s brief |
|00005920| 69 6e 74 72 6f 64 75 63 | 74 69 6f 6e 20 74 6f 20 |introduc|tion to |
|00005930| 41 64 61 20 39 35 20 69 | 6e 20 74 68 65 0a 20 20 |Ada 95 i|n the. |
|00005940| 20 63 6f 6e 74 72 69 62 | 75 74 65 64 20 70 61 70 | contrib|uted pap|
|00005950| 65 72 73 20 73 65 63 74 | 69 6f 6e 20 6f 66 20 74 |ers sect|ion of t|
|00005960| 68 65 20 41 64 61 20 57 | 6f 72 6c 64 20 57 69 64 |he Ada W|orld Wid|
|00005970| 65 20 57 65 62 20 68 6f | 6d 65 70 61 67 65 2e 20 |e Web ho|mepage. |
|00005980| 48 65 72 65 0a 20 20 20 | 54 75 63 6b 65 72 20 75 |Here. |Tucker u|
|00005990| 73 65 73 20 74 68 65 20 | 41 64 61 20 39 35 20 75 |ses the |Ada 95 u|
|000059a0| 6e 73 69 67 6e 65 64 20 | 69 6e 74 65 67 65 72 73 |nsigned |integers|
|000059b0| 2c 20 63 61 6c 6c 65 64 | 20 6d 6f 64 75 6c 61 72 |, called| modular|
|000059c0| 20 74 79 70 65 73 2c 20 | 69 6e 20 74 68 65 0a 20 | types, |in the. |
|000059d0| 20 20 69 6d 70 6c 65 6d | 65 6e 74 61 74 69 6f 6e | implem|entation|
|000059e0| 20 6f 66 20 61 20 70 72 | 6f 74 65 63 74 65 64 20 | of a pr|otected |
|000059f0| 74 79 70 65 2c 20 77 68 | 69 63 68 20 64 65 66 69 |type, wh|ich defi|
|00005a00| 6e 65 73 20 61 20 64 69 | 73 6b 20 63 6f 6e 74 72 |nes a di|sk contr|
|00005a10| 6f 6c 20 75 6e 69 74 2e | 0a 20 20 20 4d 6f 64 75 |ol unit.|. Modu|
|00005a20| 6c 61 72 20 74 79 70 65 | 73 20 61 72 65 20 69 6e |lar type|s are in|
|00005a30| 74 65 67 65 72 20 74 79 | 70 65 73 20 77 69 74 68 |teger ty|pes with|
|00005a40| 20 22 61 6e 64 22 2c 20 | 22 6f 72 22 20 61 6e 64 | "and", |"or" and|
|00005a50| 20 22 78 6f 72 22 20 64 | 65 66 69 6e 65 64 2c 20 | "xor" d|efined, |
|00005a60| 73 6f 0a 20 20 20 73 79 | 73 74 65 6d 73 20 70 72 |so. sy|stems pr|
|00005a70| 6f 67 72 61 6d 6d 65 72 | 73 20 61 72 65 20 6c 69 |ogrammer|s are li|
|00005a80| 6b 65 6c 79 20 74 6f 20 | 75 73 65 20 74 68 65 6d |kely to |use them|
|00005a90| 20 61 73 20 62 69 74 20 | 6d 61 73 6b 73 2e 20 4a | as bit |masks. J|
|00005aa0| 75 73 74 20 61 73 20 74 | 68 65 0a 20 20 20 61 72 |ust as t|he. ar|
|00005ab0| 72 61 79 20 69 6e 64 69 | 63 65 73 20 6f 66 20 74 |ray indi|ces of t|
|00005ac0| 68 65 20 32 20 61 72 72 | 61 79 73 20 64 65 66 69 |he 2 arr|ays defi|
|00005ad0| 6e 65 64 20 61 62 6f 76 | 65 20 61 72 65 20 6e 65 |ned abov|e are ne|
|00005ae0| 76 65 72 20 6d 65 61 6e | 74 20 74 6f 20 62 65 0a |ver mean|t to be.|
|00005af0| 20 20 20 6d 69 78 65 64 | 2c 20 74 68 65 20 6d 6f | mixed|, the mo|
|00005b00| 64 75 6c 61 72 20 69 6e | 74 65 67 65 72 20 74 79 |dular in|teger ty|
|00005b10| 70 65 73 20 75 73 65 64 | 20 74 6f 20 69 6d 70 6c |pes used| to impl|
|00005b20| 65 6d 65 6e 74 20 74 68 | 65 20 64 69 73 6b 20 63 |ement th|e disk c|
|00005b30| 6f 6e 74 72 6f 6c 0a 20 | 20 20 75 6e 69 74 20 61 |ontrol. | unit a|
|00005b40| 72 65 20 6e 65 76 65 72 | 20 6d 65 61 6e 74 20 74 |re never| meant t|
|00005b50| 6f 20 62 65 20 6d 69 78 | 65 64 2e 20 54 6f 20 6d |o be mix|ed. To m|
|00005b60| 61 6b 65 20 73 75 72 65 | 20 74 68 65 20 63 6f 6d |ake sure| the com|
|00005b70| 70 69 6c 65 72 20 65 6e | 66 6f 72 63 65 73 0a 20 |piler en|forces. |
|00005b80| 20 20 74 68 69 73 2c 20 | 74 68 65 79 20 61 72 65 | this, |they are|
|00005b90| 20 64 65 63 6c 61 72 65 | 64 20 61 73 20 64 69 73 | declare|d as dis|
|00005ba0| 74 69 6e 63 74 20 74 79 | 70 65 73 3a 0a 0a 20 20 |tinct ty|pes:.. |
|00005bb0| 20 20 20 74 79 70 65 20 | 46 6c 61 67 73 20 20 20 | type |Flags |
|00005bc0| 69 73 20 6d 6f 64 20 32 | 2a 2a 34 3b 20 20 2d 2d |is mod 2|**4; --|
|00005bd0| 20 61 20 34 2d 62 69 74 | 20 66 6c 61 67 73 20 66 | a 4-bit| flags f|
|00005be0| 69 65 6c 64 0a 20 20 20 | 20 20 74 79 70 65 20 43 |ield. | type C|
|00005bf0| 6f 6e 74 72 6f 6c 20 69 | 73 20 6d 6f 64 20 32 2a |ontrol i|s mod 2*|
|00005c00| 2a 34 3b 20 20 2d 2d 20 | 41 20 34 2d 62 69 74 20 |*4; -- |A 4-bit |
|00005c10| 63 6f 6e 74 72 6f 6c 20 | 66 69 65 6c 64 0a 0a 20 |control |field.. |
|00005c20| 20 20 20 20 53 74 61 74 | 75 73 5f 4d 61 73 6b 20 | Stat|us_Mask |
|00005c30| 20 3a 20 63 6f 6e 73 74 | 61 6e 74 20 46 6c 61 67 | : const|ant Flag|
|00005c40| 73 20 3a 3d 20 32 23 31 | 30 30 31 23 3b 20 20 20 |s := 2#1|001#; |
|00005c50| 2d 2d 20 53 65 74 20 66 | 69 72 73 74 20 61 6e 64 |-- Set f|irst and|
|00005c60| 20 6c 61 73 74 20 62 69 | 74 73 2e 0a 20 20 20 20 | last bi|ts.. |
|00005c70| 20 53 74 61 74 75 73 5f | 52 65 61 64 79 20 3a 20 | Status_|Ready : |
|00005c80| 63 6f 6e 73 74 61 6e 74 | 20 46 6c 61 67 73 20 3a |constant| Flags :|
|00005c90| 3d 20 32 23 31 30 30 30 | 23 3b 20 20 20 2d 2d 20 |= 2#1000|#; -- |
|00005ca0| 53 74 61 74 75 73 20 3d | 20 52 65 61 64 79 0a 0a |Status =| Ready..|
|00005cb0| 20 20 20 20 20 53 74 61 | 72 74 5f 58 66 72 20 20 | Sta|rt_Xfr |
|00005cc0| 20 20 3a 20 63 6f 6e 73 | 74 61 6e 74 20 43 6f 6e | : cons|tant Con|
|00005cd0| 74 72 6f 6c 20 3a 3d 20 | 32 23 30 30 30 31 23 3b |trol := |2#0001#;|
|00005ce0| 20 2d 2d 20 49 6e 69 74 | 69 61 74 65 20 78 66 72 | -- Init|iate xfr|
|00005cf0| 20 63 6f 6d 6d 61 6e 64 | 0a 0a 0a 20 20 20 4e 6f | command|... No|
|00005d00| 77 20 69 66 20 73 6f 6d | 65 6f 6e 65 20 61 74 74 |w if som|eone att|
|00005d10| 65 6d 70 74 73 20 74 6f | 20 61 70 70 6c 79 20 61 |empts to| apply a|
|00005d20| 20 46 6c 61 67 20 76 61 | 72 69 61 62 6c 65 20 77 | Flag va|riable w|
|00005d30| 68 65 72 65 20 61 20 43 | 6f 6e 74 72 6f 6c 0a 20 |here a C|ontrol. |
|00005d40| 20 20 76 61 72 69 61 62 | 6c 65 20 73 68 6f 75 6c | variab|le shoul|
|00005d50| 64 20 62 65 20 75 73 65 | 64 20 28 6f 72 20 76 69 |d be use|d (or vi|
|00005d60| 63 65 2d 76 65 72 73 61 | 29 20 74 68 65 20 63 6f |ce-versa|) the co|
|00005d70| 6d 70 69 6c 65 72 20 77 | 69 6c 6c 20 63 61 74 63 |mpiler w|ill catc|
|00005d80| 68 20 74 68 65 0a 20 20 | 20 65 72 72 6f 72 2e 20 |h the. | error. |
|00005d90| 54 68 69 73 20 69 73 20 | 65 73 70 65 63 69 61 6c |This is |especial|
|00005da0| 6c 79 20 69 6d 70 6f 72 | 74 61 6e 74 20 77 68 65 |ly impor|tant whe|
|00005db0| 6e 20 74 68 65 20 63 6f | 64 65 20 69 73 20 6d 61 |n the co|de is ma|
|00005dc0| 69 6e 74 61 69 6e 65 64 | 20 62 79 0a 20 20 20 70 |intained| by. p|
|00005dd0| 72 6f 67 72 61 6d 6d 65 | 72 73 20 77 68 6f 20 64 |rogramme|rs who d|
|00005de0| 69 64 20 6e 6f 74 20 77 | 72 69 74 65 20 69 74 2e |id not w|rite it.|
|00005df0| 0a 0a 20 20 20 20 52 65 | 6d 61 72 6b 73 20 6f 6e |.. Re|marks on|
|00005e00| 20 45 78 61 6d 70 6c 65 | 73 20 31 20 61 6e 64 20 | Example|s 1 and |
|00005e10| 32 2e 0a 0a 20 20 20 31 | 2e 20 4e 6f 74 69 63 65 |2... 1|. Notice|
|00005e20| 20 74 68 61 74 20 69 6e | 20 62 6f 74 68 20 65 78 | that in| both ex|
|00005e30| 61 6d 70 6c 65 73 20 74 | 68 65 20 70 72 6f 67 72 |amples t|he progr|
|00005e40| 61 6d 6d 65 72 20 77 61 | 73 20 61 62 6c 65 20 74 |ammer wa|s able t|
|00005e50| 6f 20 73 74 61 74 65 20 | 68 69 73 0a 20 20 20 69 |o state |his. i|
|00005e60| 6e 74 65 6e 74 69 6f 6e | 73 20 72 61 74 68 65 72 |ntention|s rather|
|00005e70| 20 66 6f 72 63 65 66 75 | 6c 6c 79 20 69 6e 20 74 | forcefu|lly in t|
|00005e80| 68 65 20 63 6f 64 65 20 | 2d 20 69 6e 74 65 6e 74 |he code |- intent|
|00005e90| 69 6f 6e 73 20 74 68 61 | 74 20 6f 74 68 65 72 77 |ions tha|t otherw|
|00005ea0| 69 73 65 0a 20 20 20 6d | 69 67 68 74 20 68 61 76 |ise. m|ight hav|
|00005eb0| 65 20 62 65 65 6e 20 65 | 78 70 72 65 73 73 65 64 |e been e|xpressed|
|00005ec0| 20 6d 75 63 68 20 6c 65 | 73 73 20 66 6f 72 63 65 | much le|ss force|
|00005ed0| 66 75 6c 6c 79 20 69 6e | 20 63 6f 6d 6d 65 6e 74 |fully in| comment|
|00005ee0| 20 73 74 61 74 65 6d 65 | 6e 74 73 2e 0a 20 20 20 | stateme|nts.. |
|00005ef0| 42 65 63 61 75 73 65 20 | 6f 66 20 41 64 61 27 73 |Because |of Ada's|
|00005f00| 20 73 74 72 6f 6e 67 20 | 74 79 70 69 6e 67 20 6d | strong |typing m|
|00005f10| 6f 64 65 6c 2c 20 74 68 | 65 20 63 6f 6d 70 69 6c |odel, th|e compil|
|00005f20| 65 72 20 77 61 73 20 61 | 62 6c 65 20 74 6f 20 63 |er was a|ble to c|
|00005f30| 61 74 63 68 0a 20 20 20 | 65 72 72 6f 72 73 20 61 |atch. |errors a|
|00005f40| 74 20 63 6f 6d 70 69 6c | 65 2d 74 69 6d 65 20 77 |t compil|e-time w|
|00005f50| 68 65 6e 20 74 68 65 20 | 70 72 6f 67 72 61 6d 6d |hen the |programm|
|00005f60| 65 72 27 73 20 69 6e 74 | 65 6e 74 69 6f 6e 73 20 |er's int|entions |
|00005f70| 77 65 72 65 20 76 69 6f | 6c 61 74 65 64 2e 0a 0a |were vio|lated...|
|00005f80| 0a 20 20 20 32 2e 20 4e | 6f 74 69 63 65 20 61 6c |. 2. N|otice al|
|00005f90| 73 6f 20 74 68 61 74 20 | 74 68 65 20 49 6e 74 65 |so that |the Inte|
|00005fa0| 67 65 72 20 64 65 63 6c | 61 72 61 74 69 6f 6e 73 |ger decl|arations|
|00005fb0| 20 69 6e 20 74 68 65 20 | 32 20 65 78 61 6d 70 6c | in the |2 exampl|
|00005fc0| 65 73 20 61 72 65 0a 20 | 20 20 6d 61 63 68 69 6e |es are. | machin|
|00005fd0| 65 20 70 6f 72 74 61 62 | 6c 65 2c 20 75 6e 6c 69 |e portab|le, unli|
|00005fe0| 6b 65 20 49 6e 74 65 67 | 65 72 20 61 6e 64 20 4c |ke Integ|er and L|
|00005ff0| 6f 6e 67 5f 49 6e 74 65 | 67 65 72 2e 20 41 20 63 |ong_Inte|ger. A c|
|00006000| 6f 6d 70 69 6c 65 72 20 | 77 69 6c 6c 0a 20 20 20 |ompiler |will. |
|00006010| 74 79 70 69 63 61 6c 6c | 79 20 6d 61 70 20 74 68 |typicall|y map th|
|00006020| 65 73 65 20 69 6e 74 65 | 67 65 72 20 74 79 70 65 |ese inte|ger type|
|00006030| 73 20 6f 6e 74 6f 20 74 | 68 65 20 6d 6f 73 74 20 |s onto t|he most |
|00006040| 65 66 66 69 63 69 65 6e | 74 20 62 61 73 65 20 74 |efficien|t base t|
|00006050| 79 70 65 0a 20 20 20 74 | 68 61 74 20 69 73 20 61 |ype. t|hat is a|
|00006060| 76 61 69 6c 61 62 6c 65 | 20 6f 6e 20 74 68 65 20 |vailable| on the |
|00006070| 74 61 72 67 65 74 20 6d | 61 63 68 69 6e 65 2e 0a |target m|achine..|
|00006080| 0a 20 20 20 20 45 78 61 | 6d 70 6c 65 20 33 2e 0a |. Exa|mple 3..|
|00006090| 0a 20 20 20 41 6c 74 68 | 6f 75 67 68 20 74 68 65 |. Alth|ough the|
|000060a0| 20 65 78 61 6d 70 6c 65 | 73 20 67 69 76 65 6e 20 | example|s given |
|000060b0| 61 62 6f 76 65 20 61 72 | 65 20 67 6f 6f 64 20 6f |above ar|e good o|
|000060c0| 6e 65 73 2c 20 69 74 20 | 69 73 20 6e 6f 74 20 6e |nes, it |is not n|
|000060d0| 65 63 65 73 73 61 72 69 | 6c 79 0a 20 20 20 61 20 |ecessari|ly. a |
|000060e0| 63 6f 6d 6d 6f 6e 20 70 | 72 61 63 74 69 63 65 20 |common p|ractice |
|000060f0| 74 6f 20 64 65 66 69 6e | 65 20 61 20 6c 61 72 67 |to defin|e a larg|
|00006100| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 64 69 73 74 |e number| of dist|
|00006110| 69 6e 63 74 20 69 6e 74 | 65 67 65 72 20 74 79 70 |inct int|eger typ|
|00006120| 65 73 2e 0a 20 20 20 49 | 6e 20 6d 61 6e 79 20 63 |es.. I|n many c|
|00006130| 61 73 65 73 20 69 74 20 | 69 73 20 61 70 70 72 6f |ases it |is appro|
|00006140| 70 72 69 61 74 65 20 74 | 6f 20 75 73 65 20 28 73 |priate t|o use (s|
|00006150| 61 79 29 20 61 20 33 32 | 2d 62 69 74 20 69 6e 74 |ay) a 32|-bit int|
|00006160| 65 67 65 72 20 28 6f 72 | 20 61 0a 20 20 20 73 6d |eger (or| a. sm|
|00006170| 61 6c 6c 20 6e 75 6d 62 | 65 72 20 6f 66 20 73 75 |all numb|er of su|
|00006180| 63 68 20 74 79 70 65 73 | 29 20 61 6e 64 20 64 65 |ch types|) and de|
|00006190| 63 6c 61 72 65 20 61 70 | 70 72 6f 70 72 69 61 74 |clare ap|propriat|
|000061a0| 65 20 73 75 62 74 79 70 | 65 73 20 6f 66 20 69 74 |e subtyp|es of it|
|000061b0| 0a 20 20 20 28 74 68 65 | 6d 29 2e 20 54 6f 20 64 |. (the|m). To d|
|000061c0| 65 63 6c 61 72 65 20 61 | 20 70 6f 72 74 61 62 6c |eclare a| portabl|
|000061d0| 65 20 33 32 2d 62 69 74 | 20 69 6e 74 65 67 65 72 |e 32-bit| integer|
|000061e0| 20 28 6f 72 20 6d 6f 72 | 65 20 61 63 63 75 72 61 | (or mor|e accura|
|000061f0| 74 65 6c 79 2c 20 74 68 | 65 0a 20 20 20 6d 6f 73 |tely, th|e. mos|
|00006200| 74 20 65 66 66 69 63 69 | 65 6e 74 20 69 6e 74 65 |t effici|ent inte|
|00006210| 67 65 72 20 74 68 61 74 | 20 69 73 20 61 74 20 6c |ger that| is at l|
|00006220| 65 61 73 74 20 33 32 2d | 62 69 74 73 29 3a 0a 0a |east 32-|bits):..|
|00006230| 20 20 20 74 79 70 65 20 | 49 6e 74 5f 74 6d 70 20 | type |Int_tmp |
|00006240| 69 73 20 72 61 6e 67 65 | 20 2d 32 2a 2a 33 31 2b |is range| -2**31+|
|00006250| 31 20 2e 2e 20 32 2a 2a | 33 31 2d 31 3b 0a 20 20 |1 .. 2**|31-1;. |
|00006260| 20 74 79 70 65 20 49 6e | 74 65 67 65 72 5f 33 32 | type In|teger_32|
|00006270| 20 69 73 20 72 61 6e 67 | 65 20 49 6e 74 5f 74 6d | is rang|e Int_tm|
|00006280| 70 27 42 61 73 65 27 46 | 69 72 73 74 2e 2e 49 6e |p'Base'F|irst..In|
|00006290| 74 5f 74 6d 70 27 42 61 | 73 65 27 4c 61 73 74 3b |t_tmp'Ba|se'Last;|
|000062a0| 0a 0a 0a 20 20 20 41 20 | 63 6f 6d 70 69 6c 65 72 |... A |compiler|
|000062b0| 20 6d 61 79 20 72 65 6a | 65 63 74 20 74 68 69 73 | may rej|ect this|
|000062c0| 20 64 65 63 6c 61 72 61 | 74 69 6f 6e 20 69 66 20 | declara|tion if |
|000062d0| 6e 6f 20 73 75 69 74 61 | 62 6c 65 20 62 61 73 65 |no suita|ble base|
|000062e0| 20 74 79 70 65 20 69 73 | 0a 20 20 20 61 76 61 69 | type is|. avai|
|000062f0| 6c 61 62 6c 65 2c 20 62 | 75 74 20 74 68 69 73 20 |lable, b|ut this |
|00006300| 69 73 20 72 61 72 65 2e | 20 57 68 61 74 20 68 61 |is rare.| What ha|
|00006310| 70 70 65 6e 73 20 69 73 | 20 74 68 69 73 3a 20 69 |ppens is| this: i|
|00006320| 6e 20 6f 72 64 65 72 20 | 74 6f 0a 20 20 20 69 6d |n order |to. im|
|00006330| 70 6c 65 6d 65 6e 74 20 | 49 6e 74 5f 74 6d 70 2c |plement |Int_tmp,|
|00006340| 20 74 68 65 20 63 6f 6d | 70 69 6c 65 72 20 63 68 | the com|piler ch|
|00006350| 6f 6f 73 65 73 20 61 73 | 20 74 68 65 20 62 61 73 |ooses as| the bas|
|00006360| 65 20 74 79 70 65 20 6f | 66 20 49 6e 74 5f 74 6d |e type o|f Int_tm|
|00006370| 70 20 61 6e 0a 20 20 20 | 69 6e 74 65 67 65 72 20 |p an. |integer |
|00006380| 74 79 70 65 20 74 68 61 | 74 20 69 73 20 61 76 61 |type tha|t is ava|
|00006390| 69 6c 61 62 6c 65 20 6f | 6e 20 74 68 65 20 74 61 |ilable o|n the ta|
|000063a0| 72 67 65 74 20 6d 61 63 | 68 69 6e 65 2e 20 54 68 |rget mac|hine. Th|
|000063b0| 69 73 20 62 61 73 65 20 | 74 79 70 65 0a 20 20 20 |is base |type. |
|000063c0| 69 73 20 75 73 75 61 6c | 6c 79 20 74 68 65 20 6d |is usual|ly the m|
|000063d0| 6f 73 74 20 65 66 66 69 | 63 69 65 6e 74 20 69 6e |ost effi|cient in|
|000063e0| 74 65 67 65 72 20 74 68 | 61 74 20 61 63 63 6f 6d |teger th|at accom|
|000063f0| 6f 64 61 74 65 73 20 74 | 68 65 20 72 61 6e 67 65 |odates t|he range|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.