home *** CD-ROM | disk | FTP | other *** search
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).
Confidence | Program | Detection | Match Type | Support
|
---|
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, with CRLF line terminators
| 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[CRLF]
| 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 0d 0a | 46 72 6f 6d 3a 20 4d 61 |.Kempe..|From: Ma|
|00000090| 67 6e 75 73 2e 4b 65 6d | 70 65 40 64 69 2e 65 70 |gnus.Kem|pe@di.ep|
|000000a0| 66 6c 2e 63 68 20 28 4d | 61 67 6e 75 73 20 4b 65 |fl.ch (M|agnus Ke|
|000000b0| 6d 70 65 29 0d 0a 4e 65 | 77 73 67 72 6f 75 70 73 |mpe)..Ne|wsgroups|
|000000c0| 3a 20 63 6f 6d 70 2e 6c | 61 6e 67 2e 61 64 61 2c |: comp.l|ang.ada,|
|000000d0| 63 6f 6d 70 2e 61 6e 73 | 77 65 72 73 2c 6e 65 77 |comp.ans|wers,new|
|000000e0| 73 2e 61 6e 73 77 65 72 | 73 0d 0a 53 75 62 6a 65 |s.answer|s..Subje|
|000000f0| 63 74 3a 20 41 64 61 20 | 46 41 51 3a 20 50 72 6f |ct: Ada |FAQ: Pro|
|00000100| 67 72 61 6d 6d 69 6e 67 | 20 77 69 74 68 20 41 64 |gramming| with Ad|
|00000110| 61 20 28 70 61 72 74 20 | 31 20 6f 66 20 34 29 0d |a (part |1 of 4).|
|00000120| 0a 46 6f 6c 6c 6f 77 75 | 70 2d 54 6f 3a 20 70 6f |.Followu|p-To: po|
|00000130| 73 74 65 72 0d 0a 44 61 | 74 65 3a 20 31 37 20 4d |ster..Da|te: 17 M|
|00000140| 61 72 20 31 39 39 36 20 | 31 34 3a 32 31 3a 35 38 |ar 1996 |14:21:58|
|00000150| 20 47 4d 54 0d 0a 4f 72 | 67 61 6e 69 7a 61 74 69 | GMT..Or|ganizati|
|00000160| 6f 6e 3a 20 4e 6f 6e 65 | 0d 0a 4c 69 6e 65 73 3a |on: None|..Lines:|
|00000170| 20 38 31 31 0d 0a 53 65 | 6e 64 65 72 3a 20 6d 61 | 811..Se|nder: ma|
|00000180| 67 6e 75 73 40 6c 67 6c | 73 75 6e 34 2e 65 70 66 |gnus@lgl|sun4.epf|
|00000190| 6c 2e 63 68 20 28 4d 61 | 67 6e 75 73 20 4b 65 6d |l.ch (Ma|gnus Kem|
|000001a0| 70 65 29 0d 0a 41 70 70 | 72 6f 76 65 64 3a 20 6e |pe)..App|roved: n|
|000001b0| 65 77 73 2d 61 6e 73 77 | 65 72 73 2d 72 65 71 75 |ews-answ|ers-requ|
|000001c0| 65 73 74 40 4d 49 54 2e | 45 44 55 0d 0a 44 69 73 |est@MIT.|EDU..Dis|
|000001d0| 74 72 69 62 75 74 69 6f | 6e 3a 20 77 6f 72 6c 64 |tributio|n: world|
|000001e0| 0d 0a 4d 65 73 73 61 67 | 65 2d 49 44 3a 20 3c 34 |..Messag|e-ID: <4|
|000001f0| 69 68 37 36 36 24 66 71 | 32 40 64 69 73 75 6e 6d |ih766$fq|2@disunm|
|00000200| 73 2e 65 70 66 6c 2e 63 | 68 3e 0d 0a 52 65 70 6c |s.epfl.c|h>..Repl|
|00000210| 79 2d 54 6f 3a 20 4d 61 | 67 6e 75 73 2e 4b 65 6d |y-To: Ma|gnus.Kem|
|00000220| 70 65 40 64 69 2e 65 70 | 66 6c 2e 63 68 20 28 4d |pe@di.ep|fl.ch (M|
|00000230| 61 67 6e 75 73 20 4b 65 | 6d 70 65 29 0d 0a 4e 4e |agnus Ke|mpe)..NN|
|00000240| 54 50 2d 50 6f 73 74 69 | 6e 67 2d 48 6f 73 74 3a |TP-Posti|ng-Host:|
|00000250| 20 6c 67 6c 73 75 6e 34 | 2e 65 70 66 6c 2e 63 68 | lglsun4|.epfl.ch|
|00000260| 0d 0a 4d 69 6d 65 2d 56 | 65 72 73 69 6f 6e 3a 20 |..Mime-V|ersion: |
|00000270| 31 2e 30 0d 0a 43 6f 6e | 74 65 6e 74 2d 54 79 70 |1.0..Con|tent-Typ|
|00000280| 65 3a 20 74 65 78 74 2f | 70 6c 61 69 6e 3b 20 63 |e: text/|plain; c|
|00000290| 68 61 72 73 65 74 3d 69 | 73 6f 2d 38 38 35 39 2d |harset=i|so-8859-|
|000002a0| 31 0d 0a 43 6f 6e 74 65 | 6e 74 2d 54 72 61 6e 73 |1..Conte|nt-Trans|
|000002b0| 66 65 72 2d 45 6e 63 6f | 64 69 6e 67 3a 20 38 62 |fer-Enco|ding: 8b|
|000002c0| 69 74 0d 0a 53 75 6d 6d | 61 72 79 3a 20 41 64 61 |it..Summ|ary: Ada|
|000002d0| 20 50 72 6f 67 72 61 6d | 6d 65 72 27 73 20 46 72 | Program|mer's Fr|
|000002e0| 65 71 75 65 6e 74 6c 79 | 20 41 73 6b 65 64 20 51 |equently| Asked Q|
|000002f0| 75 65 73 74 69 6f 6e 73 | 20 28 61 6e 64 20 61 6e |uestions| (and an|
|00000300| 73 77 65 72 73 29 2c 0d | 0a 20 20 20 20 20 20 20 |swers),.|. |
|00000310| 20 20 20 20 70 61 72 74 | 20 31 20 6f 66 20 34 2e | part| 1 of 4.|
|00000320| 0d 0a 20 20 20 20 20 20 | 20 20 20 50 6c 65 61 73 |.. | Pleas|
|00000330| 65 20 72 65 61 64 20 62 | 65 66 6f 72 65 20 70 6f |e read b|efore po|
|00000340| 73 74 69 6e 67 2e 0d 0a | 4b 65 79 77 6f 72 64 73 |sting...|Keywords|
|00000350| 3a 20 61 64 76 61 6e 63 | 65 64 20 6c 61 6e 67 75 |: advanc|ed langu|
|00000360| 61 67 65 2c 20 61 72 74 | 69 66 69 63 69 61 6c 20 |age, art|ificial |
|00000370| 6c 61 6e 67 75 61 67 65 | 73 2c 20 63 6f 6d 70 75 |language|s, compu|
|00000380| 74 65 72 20 73 6f 66 74 | 77 61 72 65 2c 0d 0a 20 |ter soft|ware,.. |
|00000390| 20 20 20 20 20 20 20 20 | 20 64 61 74 61 20 70 72 | | data pr|
|000003a0| 6f 63 65 73 73 69 6e 67 | 2c 20 70 72 6f 67 72 61 |ocessing|, progra|
|000003b0| 6d 6d 69 6e 67 20 6c 61 | 6e 67 75 61 67 65 73 2c |mming la|nguages,|
|000003c0| 20 41 64 61 0d 0a 58 72 | 65 66 3a 20 73 65 6e 61 | Ada..Xr|ef: sena|
|000003d0| 74 6f 72 2d 62 65 64 66 | 65 6c 6c 6f 77 2e 6d 69 |tor-bedf|ellow.mi|
|000003e0| 74 2e 65 64 75 20 63 6f | 6d 70 2e 6c 61 6e 67 2e |t.edu co|mp.lang.|
|000003f0| 61 64 61 3a 34 32 34 37 | 35 20 63 6f 6d 70 2e 61 |ada:4247|5 comp.a|
|00000400| 6e 73 77 65 72 73 3a 31 | 37 36 31 32 20 6e 65 77 |nswers:1|7612 new|
|00000410| 73 2e 61 6e 73 77 65 72 | 73 3a 36 37 31 37 36 0d |s.answer|s:67176.|
|00000420| 0a 0d 0a 41 72 63 68 69 | 76 65 2d 6e 61 6d 65 3a |...Archi|ve-name:|
|00000430| 20 63 6f 6d 70 75 74 65 | 72 2d 6c 61 6e 67 2f 41 | compute|r-lang/A|
|00000440| 64 61 2f 70 72 6f 67 72 | 61 6d 6d 69 6e 67 2f 70 |da/progr|amming/p|
|00000450| 61 72 74 31 0d 0a 43 6f | 6d 70 2d 6c 61 6e 67 2d |art1..Co|mp-lang-|
|00000460| 61 64 61 2d 61 72 63 68 | 69 76 65 2d 6e 61 6d 65 |ada-arch|ive-name|
|00000470| 3a 20 70 72 6f 67 72 61 | 6d 6d 69 6e 67 2f 70 61 |: progra|mming/pa|
|00000480| 72 74 31 0d 0a 50 6f 73 | 74 69 6e 67 2d 46 72 65 |rt1..Pos|ting-Fre|
|00000490| 71 75 65 6e 63 79 3a 20 | 6d 6f 6e 74 68 6c 79 0d |quency: |monthly.|
|000004a0| 0a 4c 61 73 74 2d 6d 6f | 64 69 66 69 65 64 3a 20 |.Last-mo|dified: |
|000004b0| 32 38 20 46 65 62 72 75 | 61 72 79 20 31 39 39 36 |28 Febru|ary 1996|
|000004c0| 0d 0a 4c 61 73 74 2d 70 | 6f 73 74 65 64 3a 20 32 |..Last-p|osted: 2|
|000004d0| 36 20 4a 61 6e 75 61 72 | 79 20 31 39 39 36 0d 0a |6 Januar|y 1996..|
|000004e0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |.. | |
|000004f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000500| 20 41 64 61 20 50 72 6f | 67 72 61 6d 6d 65 72 27 | Ada Pro|grammer'|
|00000510| 73 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |s.. | |
|00000520| 20 20 20 20 20 20 20 20 | 20 20 46 72 65 71 75 65 | | Freque|
|00000530| 6e 74 6c 79 20 41 73 6b | 65 64 20 51 75 65 73 74 |ntly Ask|ed Quest|
|00000540| 69 6f 6e 73 20 28 46 41 | 51 29 0d 0a 0d 0a 20 20 |ions (FA|Q).... |
|00000550| 20 49 4d 50 4f 52 54 41 | 4e 54 20 4e 4f 54 45 3a | IMPORTA|NT NOTE:|
|00000560| 20 4e 6f 20 46 41 51 20 | 63 61 6e 20 73 75 62 73 | No FAQ |can subs|
|00000570| 74 69 74 75 74 65 20 66 | 6f 72 20 72 65 61 6c 20 |titute f|or real |
|00000580| 74 65 61 63 68 69 6e 67 | 20 61 6e 64 0d 0a 20 20 |teaching| and.. |
|00000590| 20 64 6f 63 75 6d 65 6e | 74 61 74 69 6f 6e 2e 20 | documen|tation. |
|000005a0| 54 68 65 72 65 20 69 73 | 20 61 6e 20 61 6e 6e 6f |There is| an anno|
|000005b0| 74 61 74 65 64 20 6c 69 | 73 74 20 6f 66 20 41 64 |tated li|st of Ad|
|000005c0| 61 20 62 6f 6f 6b 73 20 | 69 6e 20 74 68 65 0d 0a |a books |in the..|
|000005d0| 20 20 20 63 6f 6d 70 61 | 6e 69 6f 6e 20 63 6f 6d | compa|nion com|
|000005e0| 70 2e 6c 61 6e 67 2e 61 | 64 61 20 46 41 51 2e 0d |p.lang.a|da FAQ..|
|000005f0| 0a 0d 0a 54 68 69 73 20 | 69 73 20 70 61 72 74 20 |...This |is part |
|00000600| 31 20 6f 66 20 61 20 34 | 2d 70 61 72 74 20 70 6f |1 of a 4|-part po|
|00000610| 73 74 69 6e 67 2e 0d 0a | 50 61 72 74 20 32 20 62 |sting...|Part 2 b|
|00000620| 65 67 69 6e 73 20 77 69 | 74 68 20 71 75 65 73 74 |egins wi|th quest|
|00000630| 69 6f 6e 20 35 2e 0d 0a | 50 61 72 74 20 33 20 62 |ion 5...|Part 3 b|
|00000640| 65 67 69 6e 73 20 77 69 | 74 68 20 71 75 65 73 74 |egins wi|th quest|
|00000650| 69 6f 6e 20 36 2e 0d 0a | 50 61 72 74 20 34 20 62 |ion 6...|Part 4 b|
|00000660| 65 67 69 6e 73 20 77 69 | 74 68 20 71 75 65 73 74 |egins wi|th quest|
|00000670| 69 6f 6e 20 39 2e 0d 0a | 54 68 65 79 20 73 68 6f |ion 9...|They sho|
|00000680| 75 6c 64 20 62 65 20 74 | 68 65 20 6e 65 78 74 20 |uld be t|he next |
|00000690| 70 6f 73 74 69 6e 67 73 | 20 69 6e 20 74 68 69 73 |postings| in this|
|000006a0| 20 74 68 72 65 61 64 2e | 0d 0a 0d 0a 20 20 20 20 | thread.|.... |
|000006b0| 52 65 63 65 6e 74 20 63 | 68 61 6e 67 65 73 20 74 |Recent c|hanges t|
|000006c0| 6f 20 74 68 69 73 20 46 | 41 51 20 61 72 65 20 6c |o this F|AQ are l|
|000006d0| 69 73 74 65 64 20 69 6e | 20 74 68 65 20 66 69 72 |isted in| the fir|
|000006e0| 73 74 20 73 65 63 74 69 | 6f 6e 20 61 66 74 65 72 |st secti|on after|
|000006f0| 20 74 68 65 20 74 61 62 | 6c 65 0d 0a 20 20 20 20 | the tab|le.. |
|00000700| 6f 66 20 63 6f 6e 74 65 | 6e 74 73 20 28 69 6e 20 |of conte|nts (in |
|00000710| 70 61 72 74 20 31 29 2e | 20 54 68 69 73 20 64 6f |part 1).| This do|
|00000720| 63 75 6d 65 6e 74 20 69 | 73 20 75 6e 64 65 72 20 |cument i|s under |
|00000730| 65 78 70 6c 69 63 69 74 | 20 63 6f 70 79 72 69 67 |explicit| copyrig|
|00000740| 68 74 2e 0d 0a 0d 0a 0d | 0a 49 6e 74 72 6f 64 75 |ht......|.Introdu|
|00000750| 63 74 69 6f 6e 0d 0a 0d | 0a 20 20 20 41 64 61 20 |ction...|. Ada |
|00000760| 69 73 20 61 6e 20 61 64 | 76 61 6e 63 65 64 2c 20 |is an ad|vanced, |
|00000770| 6d 6f 64 65 72 6e 20 70 | 72 6f 67 72 61 6d 6d 69 |modern p|rogrammi|
|00000780| 6e 67 20 6c 61 6e 67 75 | 61 67 65 2c 20 64 65 73 |ng langu|age, des|
|00000790| 69 67 6e 65 64 20 61 6e | 64 0d 0a 20 20 20 73 74 |igned an|d.. st|
|000007a0| 61 6e 64 61 72 64 69 7a | 65 64 20 74 6f 20 73 75 |andardiz|ed to su|
|000007b0| 70 70 6f 72 74 20 61 6e | 64 20 73 74 72 6f 6e 67 |pport an|d strong|
|000007c0| 6c 79 20 65 6e 63 6f 75 | 72 61 67 65 20 77 69 64 |ly encou|rage wid|
|000007d0| 65 6c 79 20 72 65 63 6f | 67 6e 69 7a 65 64 0d 0a |ely reco|gnized..|
|000007e0| 20 20 20 73 6f 66 74 77 | 61 72 65 20 65 6e 67 69 | softw|are engi|
|000007f0| 6e 65 65 72 69 6e 67 20 | 70 72 69 6e 63 69 70 6c |neering |principl|
|00000800| 65 73 3a 20 72 65 6c 69 | 61 62 69 6c 69 74 79 2c |es: reli|ability,|
|00000810| 20 70 6f 72 74 61 62 69 | 6c 69 74 79 2c 20 6d 6f | portabi|lity, mo|
|00000820| 64 75 6c 61 72 69 74 79 | 2c 0d 0a 20 20 20 72 65 |dularity|,.. re|
|00000830| 75 73 61 62 69 6c 69 74 | 79 2c 20 70 72 6f 67 72 |usabilit|y, progr|
|00000840| 61 6d 6d 69 6e 67 20 61 | 73 20 61 20 68 75 6d 61 |amming a|s a huma|
|00000850| 6e 20 61 63 74 69 76 69 | 74 79 2c 20 65 66 66 69 |n activi|ty, effi|
|00000860| 63 69 65 6e 63 79 2c 0d | 0a 20 20 20 6d 61 69 6e |ciency,.|. main|
|00000870| 74 61 69 6e 61 62 69 6c | 69 74 79 2c 20 69 6e 66 |tainabil|ity, inf|
|00000880| 6f 72 6d 61 74 69 6f 6e | 20 68 69 64 69 6e 67 2c |ormation| hiding,|
|00000890| 20 61 62 73 74 72 61 63 | 74 20 64 61 74 61 20 74 | abstrac|t data t|
|000008a0| 79 70 65 73 2c 20 67 65 | 6e 65 72 69 63 69 74 79 |ypes, ge|nericity|
|000008b0| 2c 0d 0a 20 20 20 63 6f | 6e 63 75 72 72 65 6e 74 |,.. co|ncurrent|
|000008c0| 20 70 72 6f 67 72 61 6d | 6d 69 6e 67 2c 20 6f 62 | program|ming, ob|
|000008d0| 6a 65 63 74 2d 6f 72 69 | 65 6e 74 65 64 20 70 72 |ject-ori|ented pr|
|000008e0| 6f 67 72 61 6d 6d 69 6e | 67 2c 20 65 74 63 2e 0d |ogrammin|g, etc..|
|000008f0| 0a 0d 0a 20 20 20 41 6c | 6c 20 76 61 6c 69 64 61 |... Al|l valida|
|00000900| 74 65 64 20 41 64 61 20 | 63 6f 6d 70 69 6c 65 72 |ted Ada |compiler|
|00000910| 73 20 28 69 2e 65 2e 20 | 61 20 68 75 67 65 20 6d |s (i.e. |a huge m|
|00000920| 61 6a 6f 72 69 74 79 20 | 6f 66 20 74 68 65 20 63 |ajority |of the c|
|00000930| 6f 6d 6d 65 72 63 69 61 | 6c 0d 0a 20 20 20 41 64 |ommercia|l.. Ad|
|00000940| 61 20 63 6f 6d 70 69 6c | 65 72 73 29 20 68 61 76 |a compil|ers) hav|
|00000950| 65 20 70 61 73 73 65 64 | 20 61 20 63 6f 6e 74 72 |e passed| a contr|
|00000960| 6f 6c 6c 65 64 20 76 61 | 6c 69 64 61 74 69 6f 6e |olled va|lidation|
|00000970| 20 70 72 6f 63 65 73 73 | 20 75 73 69 6e 67 20 61 | process| using a|
|00000980| 6e 0d 0a 20 20 20 65 78 | 74 65 6e 73 69 76 65 20 |n.. ex|tensive |
|00000990| 76 61 6c 69 64 61 74 69 | 6f 6e 20 73 75 69 74 65 |validati|on suite|
|000009a0| 2e 20 41 64 61 20 69 73 | 20 6e 6f 74 20 61 20 73 |. Ada is| not a s|
|000009b0| 75 70 65 72 73 65 74 20 | 6f 72 20 65 78 74 65 6e |uperset |or exten|
|000009c0| 73 69 6f 6e 20 6f 66 20 | 61 6e 79 0d 0a 20 20 20 |sion of |any.. |
|000009d0| 6f 74 68 65 72 20 6c 61 | 6e 67 75 61 67 65 2e 20 |other la|nguage. |
|000009e0| 41 64 61 20 64 6f 65 73 | 20 6e 6f 74 20 61 6c 6c |Ada does| not all|
|000009f0| 6f 77 20 74 68 65 20 64 | 61 6e 67 65 72 6f 75 73 |ow the d|angerous|
|00000a00| 20 70 72 61 63 74 69 63 | 65 73 20 6f 72 20 65 66 | practic|es or ef|
|00000a10| 66 65 63 74 73 0d 0a 20 | 20 20 6f 66 20 6f 6c 64 |fects.. | of old|
|00000a20| 20 6c 61 6e 67 75 61 67 | 65 73 2c 20 61 6c 74 68 | languag|es, alth|
|00000a30| 6f 75 67 68 20 69 74 20 | 64 6f 65 73 20 70 72 6f |ough it |does pro|
|00000a40| 76 69 64 65 20 73 74 61 | 6e 64 61 72 64 69 7a 65 |vide sta|ndardize|
|00000a50| 64 20 6d 65 63 68 61 6e | 69 73 6d 73 20 74 6f 0d |d mechan|isms to.|
|00000a60| 0a 20 20 20 69 6e 74 65 | 72 66 61 63 65 20 77 69 |. inte|rface wi|
|00000a70| 74 68 20 6f 74 68 65 72 | 20 6c 61 6e 67 75 61 67 |th other| languag|
|00000a80| 65 73 20 73 75 63 68 20 | 61 73 20 46 6f 72 74 72 |es such |as Fortr|
|00000a90| 61 6e 2c 20 43 6f 62 6f | 6c 2c 20 61 6e 64 20 43 |an, Cobo|l, and C|
|00000aa0| 2e 0d 0a 0d 0a 20 20 20 | 41 64 61 20 69 73 20 72 |..... |Ada is r|
|00000ab0| 65 63 6f 67 6e 69 7a 65 | 64 20 61 73 20 61 6e 20 |ecognize|d as an |
|00000ac0| 65 78 63 65 6c 6c 65 6e | 74 20 76 65 68 69 63 6c |excellen|t vehicl|
|00000ad0| 65 20 66 6f 72 20 65 64 | 75 63 61 74 69 6f 6e 20 |e for ed|ucation |
|00000ae0| 69 6e 20 70 72 6f 67 72 | 61 6d 6d 69 6e 67 0d 0a |in progr|amming..|
|00000af0| 20 20 20 61 6e 64 20 73 | 6f 66 74 77 61 72 65 20 | and s|oftware |
|00000b00| 65 6e 67 69 6e 65 65 72 | 69 6e 67 2c 20 69 6e 63 |engineer|ing, inc|
|00000b10| 6c 75 64 69 6e 67 20 66 | 6f 72 20 61 20 66 69 72 |luding f|or a fir|
|00000b20| 73 74 20 70 72 6f 67 72 | 61 6d 6d 69 6e 67 20 63 |st progr|amming c|
|00000b30| 6f 75 72 73 65 2e 0d 0a | 0d 0a 20 20 20 41 64 61 |ourse...|.. Ada|
|00000b40| 20 69 73 20 64 65 66 69 | 6e 65 64 20 62 79 20 61 | is defi|ned by a|
|00000b50| 6e 20 69 6e 74 65 72 6e | 61 74 69 6f 6e 61 6c 20 |n intern|ational |
|00000b60| 73 74 61 6e 64 61 72 64 | 20 28 74 68 65 20 6c 61 |standard| (the la|
|00000b70| 6e 67 75 61 67 65 20 72 | 65 66 65 72 65 6e 63 65 |nguage r|eference|
|00000b80| 0d 0a 20 20 20 6d 61 6e | 75 61 6c 2c 20 6f 72 20 |.. man|ual, or |
|00000b90| 4c 52 4d 29 2c 20 77 68 | 69 63 68 20 68 61 73 20 |LRM), wh|ich has |
|00000ba0| 62 65 65 6e 20 72 65 76 | 69 73 65 64 20 69 6e 20 |been rev|ised in |
|00000bb0| 31 39 39 35 2e 20 41 64 | 61 20 69 73 20 74 61 75 |1995. Ad|a is tau|
|00000bc0| 67 68 74 20 61 6e 64 0d | 0a 20 20 20 75 73 65 64 |ght and.|. used|
|00000bd0| 20 61 6c 6c 20 61 72 6f | 75 6e 64 20 74 68 65 20 | all aro|und the |
|00000be0| 77 6f 72 6c 64 20 28 6e | 6f 74 20 6a 75 73 74 20 |world (n|ot just |
|00000bf0| 69 6e 20 74 68 65 20 55 | 53 41 29 2e 20 41 64 61 |in the U|SA). Ada|
|00000c00| 20 69 73 20 75 73 65 64 | 20 69 6e 20 61 20 76 65 | is used| in a ve|
|00000c10| 72 79 0d 0a 20 20 20 77 | 69 64 65 20 72 61 6e 67 |ry.. w|ide rang|
|00000c20| 65 20 6f 66 20 61 70 70 | 6c 69 63 61 74 69 6f 6e |e of app|lication|
|00000c30| 73 3a 20 62 61 6e 6b 69 | 6e 67 2c 20 6d 65 64 69 |s: banki|ng, medi|
|00000c40| 63 61 6c 20 64 65 76 69 | 63 65 73 2c 0d 0a 20 20 |cal devi|ces,.. |
|00000c50| 20 74 65 6c 65 63 6f 6d | 6d 75 6e 69 63 61 74 69 | telecom|municati|
|00000c60| 6f 6e 73 2c 20 61 69 72 | 20 74 72 61 66 66 69 63 |ons, air| traffic|
|00000c70| 20 63 6f 6e 74 72 6f 6c | 2c 20 61 69 72 70 6c 61 | control|, airpla|
|00000c80| 6e 65 73 2c 20 72 61 69 | 6c 72 6f 61 64 0d 0a 20 |nes, rai|lroad.. |
|00000c90| 20 20 73 69 67 6e 61 6c | 6c 69 6e 67 2c 20 73 61 | signal|ling, sa|
|00000ca0| 74 65 6c 6c 69 74 65 73 | 2c 20 72 6f 63 6b 65 74 |tellites|, rocket|
|00000cb0| 73 2c 20 65 74 63 2e 0d | 0a 0d 0a 20 20 20 54 68 |s, etc..|... Th|
|00000cc0| 65 20 6c 61 74 65 73 74 | 20 76 65 72 73 69 6f 6e |e latest| version|
|00000cd0| 20 6f 66 20 74 68 69 73 | 20 46 41 51 20 69 73 20 | of this| FAQ is |
|00000ce0| 61 6c 77 61 79 73 20 61 | 63 63 65 73 73 69 62 6c |always a|ccessibl|
|00000cf0| 65 20 74 68 72 6f 75 67 | 68 20 57 57 57 20 61 73 |e throug|h WWW as|
|00000d00| 0d 0a 20 20 20 68 74 74 | 70 3a 2f 2f 6c 67 6c 77 |.. htt|p://lglw|
|00000d10| 77 77 2e 65 70 66 6c 2e | 63 68 2f 41 64 61 2f 46 |ww.epfl.|ch/Ada/F|
|00000d20| 41 51 2f 70 72 6f 67 72 | 61 6d 6d 69 6e 67 2e 68 |AQ/progr|amming.h|
|00000d30| 74 6d 6c 23 74 69 74 6c | 65 0d 0a 0d 0a 4d 61 69 |tml#titl|e....Mai|
|00000d40| 6e 74 65 6e 61 6e 63 65 | 0d 0a 0d 0a 20 20 20 54 |ntenance|.... T|
|00000d50| 68 69 73 20 46 41 51 20 | 69 73 20 6d 61 69 6e 74 |his FAQ |is maint|
|00000d60| 61 69 6e 65 64 20 6f 6e | 20 61 6e 20 69 6e 64 69 |ained on| an indi|
|00000d70| 76 69 64 75 61 6c 20 76 | 6f 6c 75 6e 74 65 65 72 |vidual v|olunteer|
|00000d80| 20 62 61 73 69 73 2c 20 | 62 79 20 4d 61 67 6e 75 | basis, |by Magnu|
|00000d90| 73 0d 0a 20 20 20 4b 65 | 6d 70 65 20 28 4d 61 67 |s.. Ke|mpe (Mag|
|00000da0| 6e 75 73 2e 4b 65 6d 70 | 65 40 64 69 2e 65 70 66 |nus.Kemp|e@di.epf|
|00000db0| 6c 2e 63 68 29 2e 20 5b | 4e 6f 74 65 3a 20 54 68 |l.ch). [|Note: Th|
|00000dc0| 69 73 20 69 73 20 64 6f | 6e 65 20 61 73 20 61 20 |is is do|ne as a |
|00000dd0| 68 6f 62 62 79 2c 20 6e | 6f 74 0d 0a 20 20 20 69 |hobby, n|ot.. i|
|00000de0| 6e 20 6d 79 20 63 61 70 | 61 63 69 74 79 20 61 73 |n my cap|acity as|
|00000df0| 20 61 6e 20 65 6d 70 6c | 6f 79 65 65 20 61 74 20 | an empl|oyee at |
|00000e00| 74 68 65 20 53 77 69 73 | 73 20 46 65 64 65 72 61 |the Swis|s Federa|
|00000e10| 6c 20 49 6e 73 74 69 74 | 75 74 65 20 6f 66 0d 0a |l Instit|ute of..|
|00000e20| 20 20 20 54 65 63 68 6e | 6f 6c 6f 67 79 2e 20 2d | Techn|ology. -|
|00000e30| 2d 4d 4b 5d 0d 0a 0d 0a | 20 20 20 54 68 65 20 63 |-MK]....| The c|
|00000e40| 6f 64 69 6e 67 20 73 74 | 79 6c 65 20 75 73 65 64 |oding st|yle used|
|00000e50| 20 69 6e 20 6d 6f 73 74 | 20 6f 66 20 74 68 65 20 | in most| of the |
|00000e60| 65 78 61 6d 70 6c 65 20 | 41 64 61 20 63 6f 64 65 |example |Ada code|
|00000e70| 20 69 73 20 6d 79 20 6f | 77 6e 2c 20 61 6e 64 0d | is my o|wn, and.|
|00000e80| 0a 20 20 20 79 6f 75 27 | 6c 6c 20 68 61 76 65 20 |. you'|ll have |
|00000e90| 74 6f 20 6c 69 76 65 20 | 77 69 74 68 20 69 74 20 |to live |with it |
|00000ea0| 28 79 6f 75 20 6d 61 79 | 20 77 61 6e 74 20 74 6f |(you may| want to|
|00000eb0| 20 61 64 6f 70 74 20 69 | 74 20 3a 2d 29 2e 0d 0a | adopt i|t :-)...|
|00000ec0| 0d 0a 0d 0a 20 20 20 20 | 20 5f 5f 5f 5f 5f 5f 5f |.... | _______|
|00000ed0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000ee0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000ef0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000f00| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 0d 0a 0d 0a 20 20 |________|__.... |
|00000f10| 20 4f 70 69 6e 69 6f 6e | 73 20 28 69 66 20 61 6e | Opinion|s (if an|
|00000f20| 79 29 20 65 78 70 72 65 | 73 73 65 64 20 61 72 65 |y) expre|ssed are|
|00000f30| 20 74 68 6f 73 65 20 6f | 66 20 74 68 65 20 73 75 | those o|f the su|
|00000f40| 62 6d 69 74 74 65 72 73 | 20 61 6e 64 2f 6f 72 0d |bmitters| and/or.|
|00000f50| 0a 20 20 20 6d 61 69 6e | 74 61 69 6e 65 72 2e 0d |. main|tainer..|
|00000f60| 0a 20 20 20 20 20 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |. __|________|
|00000f70| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000f80| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000f90| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000fa0| 5f 5f 5f 5f 5f 5f 5f 0d | 0a 0d 0a 54 61 62 6c 65 |_______.|...Table|
|00000fb0| 20 6f 66 20 43 6f 6e 74 | 65 6e 74 73 3a 0d 0a 0d | of Cont|ents:...|
|00000fc0| 0a 20 20 20 20 20 2a 20 | 31 3a 20 52 65 63 65 6e |. * |1: Recen|
|00000fd0| 74 20 63 68 61 6e 67 65 | 73 20 74 6f 20 74 68 69 |t change|s to thi|
|00000fe0| 73 20 46 41 51 0d 0a 0d | 0a 20 20 20 20 20 2a 20 |s FAQ...|. * |
|00000ff0| 32 3a 20 49 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 61 |2: Infor|mation a|
|00001000| 62 6f 75 74 20 74 68 69 | 73 20 64 6f 63 75 6d 65 |bout thi|s docume|
|00001010| 6e 74 0d 0a 0d 0a 20 20 | 20 20 20 2a 20 33 3a 20 |nt.... | * 3: |
|00001020| 45 6c 65 6d 65 6e 74 61 | 72 79 20 51 75 65 73 74 |Elementa|ry Quest|
|00001030| 69 6f 6e 73 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |ions.. | |
|00001040| 2b 20 33 2e 31 3a 20 48 | 6f 77 20 64 6f 20 49 20 |+ 3.1: H|ow do I |
|00001050| 6d 61 6b 65 20 6f 70 65 | 72 61 74 69 6f 6e 73 20 |make ope|rations |
|00001060| 64 69 72 65 63 74 6c 79 | 20 76 69 73 69 62 6c 65 |directly| visible|
|00001070| 20 77 69 74 68 6f 75 74 | 0d 0a 20 20 20 20 20 20 | without|.. |
|00001080| 20 20 20 20 20 20 22 75 | 73 65 22 69 6e 67 20 61 | "u|se"ing a|
|00001090| 20 70 61 63 6b 61 67 65 | 3f 0d 0a 20 20 20 20 20 | package|?.. |
|000010a0| 20 20 20 20 20 2b 20 33 | 2e 32 3a 20 48 6f 77 20 | + 3|.2: How |
|000010b0| 64 6f 20 49 20 61 73 73 | 69 67 6e 20 74 6f 20 61 |do I ass|ign to a|
|000010c0| 6e 20 61 72 72 61 79 20 | 6f 66 20 6c 65 6e 67 74 |n array |of lengt|
|000010d0| 68 20 31 3f 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |h 1?.. | |
|000010e0| 2b 20 33 2e 33 3a 20 48 | 6f 77 20 64 6f 20 49 20 |+ 3.3: H|ow do I |
|000010f0| 63 72 65 61 74 65 20 61 | 20 43 2d 73 74 79 6c 65 |create a| C-style|
|00001100| 20 6e 75 6c 2d 74 65 72 | 6d 69 6e 61 74 65 64 20 | nul-ter|minated |
|00001110| 73 74 72 69 6e 67 3f 0d | 0a 20 20 20 20 20 20 20 |string?.|. |
|00001120| 20 20 20 2b 20 33 2e 34 | 3a 20 48 6f 77 20 63 61 | + 3.4|: How ca|
|00001130| 6e 20 49 20 63 72 65 61 | 74 65 20 61 6e 20 61 72 |n I crea|te an ar|
|00001140| 72 61 79 20 6f 66 20 73 | 74 72 69 6e 67 73 20 6f |ray of s|trings o|
|00001150| 66 20 76 61 72 69 6f 75 | 73 20 6c 65 6e 67 74 68 |f variou|s length|
|00001160| 3f 0d 0a 20 20 20 20 20 | 20 20 20 20 20 2b 20 33 |?.. | + 3|
|00001170| 2e 35 3a 20 49 20 6b 6e | 6f 77 20 61 6e 20 65 78 |.5: I kn|ow an ex|
|00001180| 63 65 70 74 69 6f 6e 20 | 69 73 20 72 61 69 73 65 |ception |is raise|
|00001190| 64 2c 20 62 75 74 20 6d | 79 20 70 72 6f 67 72 61 |d, but m|y progra|
|000011a0| 6d 20 71 75 69 74 73 20 | 77 69 74 68 0d 0a 20 20 |m quits |with.. |
|000011b0| 20 20 20 20 20 20 20 20 | 20 20 6e 6f 20 77 61 72 | | no war|
|000011c0| 6e 69 6e 67 2e 20 57 68 | 79 3f 0d 0a 20 20 20 20 |ning. Wh|y?.. |
|000011d0| 20 20 20 20 20 20 2b 20 | 33 2e 36 3a 20 49 20 68 | + |3.6: I h|
|000011e0| 61 76 65 20 6f 6e 6c 79 | 20 6f 6e 65 20 74 61 73 |ave only| one tas|
|000011f0| 6b 20 69 6e 20 6d 79 20 | 70 72 6f 67 72 61 6d 2c |k in my |program,|
|00001200| 20 62 75 74 20 69 74 20 | 64 6f 65 73 6e 27 74 20 | but it |doesn't |
|00001210| 73 65 65 6d 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |seem.. | |
|00001220| 20 20 74 6f 20 72 75 6e | 2e 20 57 68 79 3f 0d 0a | to run|. Why?..|
|00001230| 20 20 20 20 20 20 20 20 | 20 20 2b 20 33 2e 37 3a | | + 3.7:|
|00001240| 20 48 6f 77 20 64 6f 20 | 49 20 69 6e 63 72 65 61 | How do |I increa|
|00001250| 73 65 20 74 68 65 20 73 | 74 61 63 6b 20 73 69 7a |se the s|tack siz|
|00001260| 65 20 66 6f 72 20 61 20 | 74 61 73 6b 3f 0d 0a 20 |e for a |task?.. |
|00001270| 20 20 20 20 20 20 20 20 | 20 2b 20 33 2e 38 3a 20 | | + 3.8: |
|00001280| 57 68 61 74 27 73 20 74 | 68 65 20 64 69 66 66 65 |What's t|he diffe|
|00001290| 72 65 6e 63 65 20 62 65 | 74 77 65 65 6e 20 61 20 |rence be|tween a |
|000012a0| 74 79 70 65 20 63 6f 6e | 76 65 72 73 69 6f 6e 20 |type con|version |
|000012b0| 61 6e 64 20 61 0d 0a 20 | 20 20 20 20 20 20 20 20 |and a.. | |
|000012c0| 20 20 20 71 75 61 6c 69 | 66 69 65 72 3f 0d 0a 20 | quali|fier?.. |
|000012d0| 20 20 20 20 20 20 20 20 | 20 2b 20 33 2e 39 3a 20 | | + 3.9: |
|000012e0| 48 6f 77 20 64 6f 20 49 | 20 61 76 6f 69 64 20 74 |How do I| avoid t|
|000012f0| 68 65 20 70 6f 74 65 6e | 74 69 61 6c 20 73 70 61 |he poten|tial spa|
|00001300| 63 65 20 69 6e 20 66 72 | 6f 6e 74 20 6f 66 0d 0a |ce in fr|ont of..|
|00001310| 20 20 20 20 20 20 20 20 | 20 20 20 20 49 6e 74 65 | | Inte|
|00001320| 67 65 72 27 49 6d 61 67 | 65 3f 0d 0a 20 20 20 20 |ger'Imag|e?.. |
|00001330| 20 20 20 20 20 20 2b 20 | 33 2e 31 30 3a 20 57 68 | + |3.10: Wh|
|00001340| 79 20 69 73 20 61 6e 20 | 65 78 63 65 70 74 69 6f |y is an |exceptio|
|00001350| 6e 20 72 61 69 73 65 64 | 20 77 68 65 6e 20 67 69 |n raised| when gi|
|00001360| 76 69 6e 67 20 61 20 64 | 65 66 61 75 6c 74 0d 0a |ving a d|efault..|
|00001370| 20 20 20 20 20 20 20 20 | 20 20 20 20 64 69 73 63 | | disc|
|00001380| 72 69 6d 69 6e 61 6e 74 | 3f 0d 0a 20 20 20 20 20 |riminant|?.. |
|00001390| 20 20 20 20 20 2b 20 33 | 2e 31 31 3a 20 57 68 65 | + 3|.11: Whe|
|000013a0| 6e 20 49 20 77 61 6e 74 | 20 61 6e 20 49 6e 74 65 |n I want| an Inte|
|000013b0| 67 65 72 20 74 79 70 65 | 2c 20 77 68 61 74 27 73 |ger type|, what's|
|000013c0| 20 77 72 6f 6e 67 20 77 | 69 74 68 20 6a 75 73 74 | wrong w|ith just|
|000013d0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 75 73 |.. | us|
|000013e0| 69 6e 67 20 74 68 65 20 | 70 72 65 64 65 66 69 6e |ing the |predefin|
|000013f0| 65 64 20 74 79 70 65 20 | 49 6e 74 65 67 65 72 20 |ed type |Integer |
|00001400| 6f 72 20 4c 6f 6e 67 5f | 49 6e 74 65 67 65 72 3f |or Long_|Integer?|
|00001410| 20 57 68 79 20 77 6f 75 | 6c 64 0d 0a 20 20 20 20 | Why wou|ld.. |
|00001420| 20 20 20 20 20 20 20 20 | 49 20 65 76 65 72 20 77 | |I ever w|
|00001430| 61 6e 74 20 74 6f 20 64 | 65 63 6c 61 72 65 20 6e |ant to d|eclare n|
|00001440| 65 77 20 49 6e 74 65 67 | 65 72 20 74 79 70 65 73 |ew Integ|er types|
|00001450| 3f 0d 0a 20 20 20 20 20 | 20 20 20 20 20 2b 20 33 |?.. | + 3|
|00001460| 2e 31 32 3a 20 53 69 6e | 63 65 20 49 20 63 61 6e |.12: Sin|ce I can|
|00001470| 20 61 6c 77 61 79 73 20 | 64 65 63 6c 61 72 65 20 | always |declare |
|00001480| 6d 79 20 6f 77 6e 20 70 | 6f 72 74 61 62 6c 65 20 |my own p|ortable |
|00001490| 69 6e 74 65 67 65 72 0d | 0a 20 20 20 20 20 20 20 |integer.|. |
|000014a0| 20 20 20 20 20 74 79 70 | 65 73 2c 20 77 68 79 20 | typ|es, why |
|000014b0| 77 6f 75 6c 64 20 49 20 | 65 76 65 72 20 77 61 6e |would I |ever wan|
|000014c0| 74 20 74 6f 20 75 73 65 | 20 74 68 65 20 70 72 65 |t to use| the pre|
|000014d0| 64 65 66 69 6e 65 64 20 | 74 79 70 65 0d 0a 20 20 |defined |type.. |
|000014e0| 20 20 20 20 20 20 20 20 | 20 20 49 6e 74 65 67 65 | | Intege|
|000014f0| 72 3f 0d 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |r?.. | + |
|00001500| 33 2e 31 33 3a 20 49 20 | 61 6d 20 6c 65 61 72 6e |3.13: I |am learn|
|00001510| 69 6e 67 20 41 64 61 2e | 20 43 61 6e 20 49 20 65 |ing Ada.| Can I e|
|00001520| 78 70 65 72 69 6d 65 6e | 74 20 77 69 74 68 20 61 |xperimen|t with a|
|00001530| 20 67 61 6d 65 0d 0a 20 | 20 20 20 20 20 20 20 20 | game.. | |
|00001540| 20 20 20 70 72 6f 67 72 | 61 6d 3f 0d 0a 20 20 20 | progr|am?.. |
|00001550| 20 20 20 20 20 20 20 2b | 20 33 2e 31 34 3a 20 48 | +| 3.14: H|
|00001560| 6f 77 20 63 61 6e 20 49 | 20 64 6f 20 61 20 6e 6f |ow can I| do a no|
|00001570| 6e 2d 62 6c 6f 63 6b 69 | 6e 67 2c 20 6b 65 79 73 |n-blocki|ng, keys|
|00001580| 74 72 6f 6b 65 2d 61 74 | 2d 61 2d 74 69 6d 65 20 |troke-at|-a-time |
|00001590| 72 65 61 64 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |read.. | |
|000015a0| 20 20 66 72 6f 6d 20 74 | 68 65 20 74 65 72 6d 69 | from t|he termi|
|000015b0| 6e 61 6c 3f 0d 0a 0d 0a | 0d 0a 20 20 20 20 20 2a |nal?....|.. *|
|000015c0| 20 34 3a 20 41 64 76 61 | 6e 74 61 67 65 73 20 6f | 4: Adva|ntages o|
|000015d0| 66 20 41 64 61 0d 0a 20 | 20 20 20 20 20 20 20 20 |f Ada.. | |
|000015e0| 20 2b 20 34 2e 31 3a 20 | 57 68 79 20 75 73 65 20 | + 4.1: |Why use |
|000015f0| 41 64 61 3f 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |Ada?.. | |
|00001600| 2b 20 34 2e 32 3a 20 41 | 64 61 20 73 65 65 6d 73 |+ 4.2: A|da seems|
|00001610| 20 6c 61 72 67 65 20 61 | 6e 64 20 63 6f 6d 70 6c | large a|nd compl|
|00001620| 65 78 2c 20 77 68 79 20 | 69 73 20 69 74 20 74 68 |ex, why |is it th|
|00001630| 69 73 20 77 61 79 3f 0d | 0a 20 20 20 20 20 20 20 |is way?.|. |
|00001640| 20 20 20 2b 20 34 2e 33 | 3a 20 49 73 20 74 68 65 | + 4.3|: Is the|
|00001650| 72 65 20 61 20 63 6f 6e | 74 65 73 74 20 77 69 74 |re a con|test wit|
|00001660| 68 20 66 61 6d 65 20 61 | 6e 64 20 6d 6f 6e 65 79 |h fame a|nd money|
|00001670| 20 66 6f 72 20 67 6f 6f | 64 20 41 64 61 0d 0a 20 | for goo|d Ada.. |
|00001680| 20 20 20 20 20 20 20 20 | 20 20 20 70 72 6f 67 72 | | progr|
|00001690| 61 6d 6d 65 72 73 3f 0d | 0a 0d 0a 0d 0a 20 20 20 |ammers?.|..... |
|000016a0| 20 20 2a 20 35 3a 20 4f | 62 6a 65 63 74 2d 4f 72 | * 5: O|bject-Or|
|000016b0| 69 65 6e 74 65 64 20 50 | 72 6f 67 72 61 6d 6d 69 |iented P|rogrammi|
|000016c0| 6e 67 20 77 69 74 68 20 | 41 64 61 0d 0a 20 20 20 |ng with |Ada.. |
|000016d0| 20 20 20 20 20 20 20 2b | 20 35 2e 31 3a 20 57 68 | +| 5.1: Wh|
|000016e0| 79 20 64 6f 65 73 20 41 | 64 61 20 68 61 76 65 20 |y does A|da have |
|000016f0| 22 74 61 67 67 65 64 20 | 74 79 70 65 73 22 20 69 |"tagged |types" i|
|00001700| 6e 73 74 65 61 64 20 6f | 66 20 63 6c 61 73 73 65 |nstead o|f classe|
|00001710| 73 3f 0d 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |s?.. | + |
|00001720| 35 2e 32 3a 20 56 61 72 | 69 61 6e 74 20 72 65 63 |5.2: Var|iant rec|
|00001730| 6f 72 64 73 20 73 65 65 | 6d 20 6c 69 6b 65 20 61 |ords see|m like a|
|00001740| 20 64 65 61 64 20 66 65 | 61 74 75 72 65 20 6e 6f | dead fe|ature no|
|00001750| 77 2e 20 57 68 65 6e 0d | 0a 20 20 20 20 20 20 20 |w. When.|. |
|00001760| 20 20 20 20 20 73 68 6f | 75 6c 64 20 49 20 75 73 | sho|uld I us|
|00001770| 65 20 74 68 65 6d 20 69 | 6e 73 74 65 61 64 20 6f |e them i|nstead o|
|00001780| 66 20 74 61 67 67 65 64 | 20 74 79 70 65 73 3f 0d |f tagged| types?.|
|00001790| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 35 2e 33 |. | + 5.3|
|000017a0| 3a 20 57 68 61 74 20 69 | 73 20 6d 65 61 6e 74 20 |: What i|s meant |
|000017b0| 62 79 20 22 69 6e 74 65 | 72 66 61 63 65 20 69 6e |by "inte|rface in|
|000017c0| 68 65 72 69 74 61 6e 63 | 65 22 20 61 6e 64 20 68 |heritanc|e" and h|
|000017d0| 6f 77 20 64 6f 65 73 0d | 0a 20 20 20 20 20 20 20 |ow does.|. |
|000017e0| 20 20 20 20 20 41 64 61 | 20 73 75 70 70 6f 72 74 | Ada| support|
|000017f0| 20 69 74 3f 0d 0a 20 20 | 20 20 20 20 20 20 20 20 | it?.. | |
|00001800| 2b 20 35 2e 34 3a 20 48 | 6f 77 20 64 6f 20 79 6f |+ 5.4: H|ow do yo|
|00001810| 75 20 64 6f 20 6d 75 6c | 74 69 70 6c 65 20 69 6e |u do mul|tiple in|
|00001820| 68 65 72 69 74 61 6e 63 | 65 20 69 6e 20 41 64 61 |heritanc|e in Ada|
|00001830| 20 39 58 3f 0d 0a 20 20 | 20 20 20 20 20 20 20 20 | 9X?.. | |
|00001840| 2b 20 35 2e 35 3a 20 57 | 68 79 20 61 72 65 20 43 |+ 5.5: W|hy are C|
|00001850| 6f 6e 74 72 6f 6c 6c 65 | 64 20 74 79 70 65 73 20 |ontrolle|d types |
|00001860| 73 6f 2c 20 77 65 6c 6c | 2c 20 73 74 72 61 6e 67 |so, well|, strang|
|00001870| 65 3f 0d 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |e?.. | + |
|00001880| 35 2e 36 3a 20 57 68 61 | 74 20 64 6f 20 22 63 6f |5.6: Wha|t do "co|
|00001890| 76 61 72 69 61 6e 63 65 | 22 20 61 6e 64 20 22 63 |variance|" and "c|
|000018a0| 6f 6e 74 72 61 76 61 72 | 69 61 6e 63 65 22 20 6d |ontravar|iance" m|
|000018b0| 65 61 6e 2c 20 61 6e 64 | 20 64 6f 65 73 0d 0a 20 |ean, and| does.. |
|000018c0| 20 20 20 20 20 20 20 20 | 20 20 20 41 64 61 20 73 | | Ada s|
|000018d0| 75 70 70 6f 72 74 20 65 | 69 74 68 65 72 20 6f 72 |upport e|ither or|
|000018e0| 20 62 6f 74 68 3f 0d 0a | 20 20 20 20 20 20 20 20 | both?..| |
|000018f0| 20 20 2b 20 35 2e 37 3a | 20 57 68 61 74 20 69 73 | + 5.7:| What is|
|00001900| 20 6d 65 61 6e 74 20 62 | 79 20 75 70 63 61 73 74 | meant b|y upcast|
|00001910| 69 6e 67 2f 65 78 70 61 | 6e 64 69 6e 67 20 61 6e |ing/expa|nding an|
|00001920| 64 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 64 |d.. | d|
|00001930| 6f 77 6e 63 61 73 74 69 | 6e 67 2f 6e 61 72 72 6f |owncasti|ng/narro|
|00001940| 77 69 6e 67 3f 0d 0a 20 | 20 20 20 20 20 20 20 20 |wing?.. | |
|00001950| 20 2b 20 35 2e 38 3a 20 | 48 6f 77 20 64 6f 65 73 | + 5.8: |How does|
|00001960| 20 41 64 61 20 64 6f 20 | 22 6e 61 72 72 6f 77 69 | Ada do |"narrowi|
|00001970| 6e 67 22 3f 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |ng"?.. | |
|00001980| 2b 20 35 2e 39 3a 20 57 | 68 61 74 20 69 73 20 74 |+ 5.9: W|hat is t|
|00001990| 68 65 20 64 69 66 66 65 | 72 65 6e 63 65 20 62 65 |he diffe|rence be|
|000019a0| 74 77 65 65 6e 20 61 20 | 63 6c 61 73 73 2d 77 69 |tween a |class-wi|
|000019b0| 64 65 20 61 63 63 65 73 | 73 20 74 79 70 65 0d 0a |de acces|s type..|
|000019c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 61 6e 64 20 | | and |
|000019d0| 61 20 22 67 65 6e 65 72 | 61 6c 22 20 63 6c 61 73 |a "gener|al" clas|
|000019e0| 73 2d 77 69 64 65 20 61 | 63 63 65 73 73 20 74 79 |s-wide a|ccess ty|
|000019f0| 70 65 3f 0d 0a 0d 0a 0d | 0a 20 20 20 20 20 2a 20 |pe?.....|. * |
|00001a00| 36 3a 20 41 64 61 20 4e | 75 6d 65 72 69 63 73 0d |6: Ada N|umerics.|
|00001a10| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 36 2e 31 |. | + 6.1|
|00001a20| 3a 20 57 68 65 72 65 20 | 63 61 6e 20 49 20 66 69 |: Where |can I fi|
|00001a30| 6e 64 20 61 6e 6f 6e 79 | 6d 6f 75 73 20 66 74 70 |nd anony|mous ftp|
|00001a40| 20 73 69 74 65 73 20 66 | 6f 72 20 41 64 61 20 6d | sites f|or Ada m|
|00001a50| 61 74 68 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ath.. | |
|00001a60| 20 70 61 63 6b 61 67 65 | 73 3f 20 49 6e 20 70 61 | package|s? In pa|
|00001a70| 72 74 69 63 75 6c 61 72 | 20 77 68 65 72 65 20 61 |rticular| where a|
|00001a80| 72 65 20 74 68 65 20 72 | 61 6e 64 6f 6d 20 6e 75 |re the r|andom nu|
|00001a90| 6d 62 65 72 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |mber.. | |
|00001aa0| 20 20 67 65 6e 65 72 61 | 74 6f 72 73 3f 0d 0a 20 | genera|tors?.. |
|00001ab0| 20 20 20 20 20 20 20 20 | 20 2b 20 36 2e 32 3a 20 | | + 6.2: |
|00001ac0| 48 6f 77 20 63 61 6e 20 | 49 20 77 72 69 74 65 20 |How can |I write |
|00001ad0| 70 6f 72 74 61 62 6c 65 | 20 63 6f 64 65 20 69 6e |portable| code in|
|00001ae0| 20 41 64 61 20 38 33 20 | 75 73 69 6e 67 20 70 72 | Ada 83 |using pr|
|00001af0| 65 64 65 66 69 6e 65 64 | 0d 0a 20 20 20 20 20 20 |edefined|.. |
|00001b00| 20 20 20 20 20 20 74 79 | 70 65 73 20 6c 69 6b 65 | ty|pes like|
|00001b10| 20 46 6c 6f 61 74 20 61 | 6e 64 20 4c 6f 6e 67 5f | Float a|nd Long_|
|00001b20| 46 6c 6f 61 74 3f 20 4c | 69 6b 65 77 69 73 65 2c |Float? L|ikewise,|
|00001b30| 20 68 6f 77 20 63 61 6e | 20 49 20 77 72 69 74 65 | how can| I write|
|00001b40| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 70 6f |.. | po|
|00001b50| 72 74 61 62 6c 65 20 63 | 6f 64 65 20 74 68 61 74 |rtable c|ode that|
|00001b60| 20 75 73 65 73 20 4d 61 | 74 68 20 66 75 6e 63 74 | uses Ma|th funct|
|00001b70| 69 6f 6e 73 20 6c 69 6b | 65 20 53 69 6e 20 61 6e |ions lik|e Sin an|
|00001b80| 64 20 4c 6f 67 20 74 68 | 61 74 0d 0a 20 20 20 20 |d Log th|at.. |
|00001b90| 20 20 20 20 20 20 20 20 | 61 72 65 20 64 65 66 69 | |are defi|
|00001ba0| 6e 65 64 20 66 6f 72 20 | 46 6c 6f 61 74 20 61 6e |ned for |Float an|
|00001bb0| 64 20 4c 6f 6e 67 5f 46 | 6c 6f 61 74 3f 0d 0a 20 |d Long_F|loat?.. |
|00001bc0| 20 20 20 20 20 20 20 20 | 20 2b 20 36 2e 33 3a 20 | | + 6.3: |
|00001bd0| 49 73 20 41 64 61 20 61 | 6e 79 20 67 6f 6f 64 20 |Is Ada a|ny good |
|00001be0| 61 74 20 6e 75 6d 65 72 | 69 63 73 2c 20 61 6e 64 |at numer|ics, and|
|00001bf0| 20 77 68 65 72 65 20 63 | 61 6e 20 49 20 6c 65 61 | where c|an I lea|
|00001c00| 72 6e 20 6d 6f 72 65 0d | 0a 20 20 20 20 20 20 20 |rn more.|. |
|00001c10| 20 20 20 20 20 61 62 6f | 75 74 20 69 74 3f 0d 0a | abo|ut it?..|
|00001c20| 20 20 20 20 20 20 20 20 | 20 20 2b 20 36 2e 34 3a | | + 6.4:|
|00001c30| 20 48 6f 77 20 64 6f 20 | 49 20 67 65 74 20 52 65 | How do |I get Re|
|00001c40| 61 6c 20 76 61 6c 75 65 | 64 20 61 6e 64 20 43 6f |al value|d and Co|
|00001c50| 6d 70 6c 65 78 20 76 61 | 6c 75 65 64 20 6d 61 74 |mplex va|lued mat|
|00001c60| 68 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 66 |h.. | f|
|00001c70| 75 6e 63 74 69 6f 6e 73 | 20 69 6e 20 41 64 61 20 |unctions| in Ada |
|00001c80| 39 35 3f 0d 0a 20 20 20 | 20 20 20 20 20 20 20 2b |95?.. | +|
|00001c90| 20 36 2e 35 3a 20 57 68 | 61 74 20 6c 69 62 72 61 | 6.5: Wh|at libra|
|00001ca0| 72 69 65 73 20 6f 72 20 | 70 75 62 6c 69 63 20 61 |ries or |public a|
|00001cb0| 6c 67 6f 72 69 74 68 6d | 73 20 65 78 69 73 74 20 |lgorithm|s exist |
|00001cc0| 66 6f 72 20 41 64 61 3f | 0d 0a 0d 0a 0d 0a 20 20 |for Ada?|...... |
|00001cd0| 20 20 20 2a 20 37 3a 20 | 45 66 66 69 63 69 65 6e | * 7: |Efficien|
|00001ce0| 63 79 20 6f 66 20 41 64 | 61 20 43 6f 6e 73 74 72 |cy of Ad|a Constr|
|00001cf0| 75 63 74 73 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |ucts.. | |
|00001d00| 2b 20 37 2e 31 3a 20 48 | 6f 77 20 6d 75 63 68 20 |+ 7.1: H|ow much |
|00001d10| 65 78 74 72 61 20 6f 76 | 65 72 68 65 61 64 20 64 |extra ov|erhead d|
|00001d20| 6f 20 67 65 6e 65 72 69 | 63 73 20 68 61 76 65 3f |o generi|cs have?|
|00001d30| 0d 0a 0d 0a 0d 0a 20 20 | 20 20 20 2a 20 38 3a 20 |...... | * 8: |
|00001d40| 41 64 76 61 6e 63 65 64 | 20 50 72 6f 67 72 61 6d |Advanced| Program|
|00001d50| 6d 69 6e 67 20 54 65 63 | 68 6e 69 71 75 65 73 20 |ming Tec|hniques |
|00001d60| 77 69 74 68 20 41 64 61 | 0d 0a 20 20 20 20 20 20 |with Ada|.. |
|00001d70| 20 20 20 20 2b 20 38 2e | 31 3a 20 48 6f 77 20 63 | + 8.|1: How c|
|00001d80| 61 6e 20 49 20 72 65 64 | 65 66 69 6e 65 20 74 68 |an I red|efine th|
|00001d90| 65 20 61 73 73 69 67 6e | 6d 65 6e 74 20 6f 70 65 |e assign|ment ope|
|00001da0| 72 61 74 69 6f 6e 3f 0d | 0a 20 20 20 20 20 20 20 |ration?.|. |
|00001db0| 20 20 20 2b 20 38 2e 32 | 3a 20 44 6f 65 73 20 41 | + 8.2|: Does A|
|00001dc0| 64 61 20 68 61 76 65 20 | 61 75 74 6f 6d 61 74 69 |da have |automati|
|00001dd0| 63 20 63 6f 6e 73 74 72 | 75 63 74 6f 72 73 20 61 |c constr|uctors a|
|00001de0| 6e 64 20 64 65 73 74 72 | 75 63 74 6f 72 73 3f 0d |nd destr|uctors?.|
|00001df0| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 38 2e 33 |. | + 8.3|
|00001e00| 3a 20 53 68 6f 75 6c 64 | 20 49 20 73 74 69 63 6b |: Should| I stick|
|00001e10| 20 74 6f 20 61 20 6f 6e | 65 20 70 61 63 6b 61 67 | to a on|e packag|
|00001e20| 65 2c 20 6f 6e 65 20 74 | 79 70 65 20 61 70 70 72 |e, one t|ype appr|
|00001e30| 6f 61 63 68 20 77 68 69 | 6c 65 0d 0a 20 20 20 20 |oach whi|le.. |
|00001e40| 20 20 20 20 20 20 20 20 | 77 72 69 74 69 6e 67 20 | |writing |
|00001e50| 41 64 61 20 73 6f 66 74 | 77 61 72 65 3f 0d 0a 20 |Ada soft|ware?.. |
|00001e60| 20 20 20 20 20 20 20 20 | 20 2b 20 38 2e 34 3a 20 | | + 8.4: |
|00001e70| 57 68 61 74 20 69 73 20 | 74 68 65 20 22 42 65 61 |What is |the "Bea|
|00001e80| 75 6a 6f 6c 61 69 73 20 | 45 66 66 65 63 74 22 3f |ujolais |Effect"?|
|00001e90| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 2b 20 38 2e |.. | + 8.|
|00001ea0| 35 3a 20 57 68 61 74 20 | 61 62 6f 75 74 20 74 68 |5: What |about th|
|00001eb0| 65 20 22 52 69 70 70 6c | 65 20 45 66 66 65 63 74 |e "Rippl|e Effect|
|00001ec0| 22 3f 0d 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |"?.. | + |
|00001ed0| 38 2e 36 3a 20 48 6f 77 | 20 74 6f 20 77 72 69 74 |8.6: How| to writ|
|00001ee0| 65 20 61 6e 20 41 64 61 | 20 70 72 6f 67 72 61 6d |e an Ada| program|
|00001ef0| 20 74 6f 20 63 6f 6d 70 | 75 74 65 20 77 68 65 6e | to comp|ute when|
|00001f00| 20 6f 6e 65 20 68 61 73 | 20 68 61 64 0d 0a 20 20 | one has| had.. |
|00001f10| 20 20 20 20 20 20 20 20 | 20 20 74 6f 6f 20 6d 75 | | too mu|
|00001f20| 63 68 20 61 6c 63 6f 68 | 6f 6c 20 74 6f 20 6c 65 |ch alcoh|ol to le|
|00001f30| 67 61 6c 6c 79 20 64 72 | 69 76 65 3f 0d 0a 20 20 |gally dr|ive?.. |
|00001f40| 20 20 20 20 20 20 20 20 | 2b 20 38 2e 37 3a 20 44 | |+ 8.7: D|
|00001f50| 6f 65 73 20 41 64 61 20 | 68 61 76 65 20 6d 61 63 |oes Ada |have mac|
|00001f60| 72 6f 73 3f 0d 0a 0d 0a | 0d 0a 20 20 20 20 20 2a |ros?....|.. *|
|00001f70| 20 39 3a 20 41 64 61 20 | 61 6e 64 20 4f 74 68 65 | 9: Ada |and Othe|
|00001f80| 72 20 50 72 6f 67 72 61 | 6d 6d 69 6e 67 20 4c 61 |r Progra|mming La|
|00001f90| 6e 67 75 61 67 65 73 0d | 0a 20 20 20 20 20 20 20 |nguages.|. |
|00001fa0| 20 20 20 2b 20 39 2e 31 | 3a 20 57 68 65 72 65 20 | + 9.1|: Where |
|00001fb0| 63 61 6e 20 49 20 66 69 | 6e 64 20 70 72 6f 67 72 |can I fi|nd progr|
|00001fc0| 61 6d 73 20 74 68 61 74 | 20 77 69 6c 6c 20 74 72 |ams that| will tr|
|00001fd0| 61 6e 73 6c 61 74 65 20 | 66 72 6f 6d 20 5b 73 6f |anslate |from [so|
|00001fe0| 6d 65 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |me.. | |
|00001ff0| 6c 61 6e 67 75 61 67 65 | 5d 20 74 6f 20 41 64 61 |language|] to Ada|
|00002000| 3f 0d 0a 20 20 20 20 20 | 20 20 20 20 20 2b 20 39 |?.. | + 9|
|00002010| 2e 32 3a 20 48 6f 77 20 | 63 61 6e 20 49 20 63 6f |.2: How |can I co|
|00002020| 6e 76 65 72 74 20 41 64 | 61 20 38 33 20 73 6f 75 |nvert Ad|a 83 sou|
|00002030| 72 63 65 73 20 74 6f 20 | 41 64 61 20 39 58 3f 0d |rces to |Ada 9X?.|
|00002040| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 39 2e 33 |. | + 9.3|
|00002050| 3a 20 49 20 68 65 61 72 | 20 74 68 61 74 20 41 64 |: I hear| that Ad|
|00002060| 61 20 69 73 20 73 6c 6f | 77 65 72 20 74 68 61 6e |a is slo|wer than|
|00002070| 20 46 6f 72 74 72 61 6e | 20 6f 72 20 43 2c 20 69 | Fortran| or C, i|
|00002080| 73 20 74 68 61 74 0d 0a | 20 20 20 20 20 20 20 20 |s that..| |
|00002090| 20 20 20 20 74 72 75 65 | 3f 0d 0a 20 20 20 20 20 | true|?.. |
|000020a0| 20 20 20 20 20 2b 20 39 | 2e 34 3a 20 49 73 6e 27 | + 9|.4: Isn'|
|000020b0| 74 20 41 64 61 20 6c 65 | 73 73 20 22 65 6c 65 67 |t Ada le|ss "eleg|
|000020c0| 61 6e 74 22 20 74 68 61 | 6e 20 45 69 66 66 65 6c |ant" tha|n Eiffel|
|000020d0| 3f 0d 0a 20 20 20 20 20 | 20 20 20 20 20 2b 20 39 |?.. | + 9|
|000020e0| 2e 35 3a 20 41 72 65 20 | 74 68 65 72 65 20 61 6e |.5: Are |there an|
|000020f0| 79 20 70 61 70 65 72 73 | 20 64 65 74 61 69 6c 69 |y papers| detaili|
|00002100| 6e 67 20 74 68 65 20 64 | 69 66 66 65 72 65 6e 63 |ng the d|ifferenc|
|00002110| 65 73 20 62 65 74 77 65 | 65 6e 0d 0a 20 20 20 20 |es betwe|en.. |
|00002120| 20 20 20 20 20 20 20 20 | 41 64 61 20 61 6e 64 20 | |Ada and |
|00002130| 43 2b 2b 3f 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |C++?.. | |
|00002140| 2b 20 39 2e 36 3a 20 49 | 20 6b 65 65 70 20 68 65 |+ 9.6: I| keep he|
|00002150| 61 72 69 6e 67 20 74 68 | 61 74 20 41 64 61 20 69 |aring th|at Ada i|
|00002160| 73 20 61 20 22 73 74 72 | 6f 6e 67 6c 79 20 74 79 |s a "str|ongly ty|
|00002170| 70 65 64 20 6c 61 6e 67 | 75 61 67 65 22 2c 0d 0a |ped lang|uage",..|
|00002180| 20 20 20 20 20 20 20 20 | 20 20 20 20 62 75 74 20 | | but |
|00002190| 69 74 20 73 65 65 6d 73 | 20 64 69 66 66 65 72 65 |it seems| differe|
|000021a0| 6e 74 20 66 72 6f 6d 20 | 77 68 61 74 27 73 20 6d |nt from |what's m|
|000021b0| 65 61 6e 74 20 69 6e 20 | 43 2b 2b 2e 20 41 72 65 |eant in |C++. Are|
|000021c0| 20 74 68 65 79 0d 0a 20 | 20 20 20 20 20 20 20 20 | they.. | |
|000021d0| 20 20 20 64 69 66 66 65 | 72 65 6e 74 3f 0d 0a 20 | diffe|rent?.. |
|000021e0| 20 20 20 20 20 20 20 20 | 20 2b 20 39 2e 37 3a 20 | | + 9.7: |
|000021f0| 49 27 6d 20 74 6f 6c 64 | 20 41 64 61 20 64 6f 65 |I'm told| Ada doe|
|00002200| 73 20 61 6c 6c 20 73 6f | 72 74 73 20 6f 66 20 73 |s all so|rts of s|
|00002210| 74 61 74 69 63 20 74 79 | 70 65 20 63 68 65 63 6b |tatic ty|pe check|
|00002220| 69 6e 67 2c 20 62 75 74 | 0d 0a 20 20 20 20 20 20 |ing, but|.. |
|00002230| 20 20 20 20 20 20 63 61 | 6e 27 74 20 79 6f 75 20 | ca|n't you |
|00002240| 67 65 74 20 74 68 65 20 | 73 61 6d 65 20 65 66 66 |get the |same eff|
|00002250| 65 63 74 20 75 73 69 6e | 67 20 61 20 74 6f 6f 6c |ect usin|g a tool|
|00002260| 20 6c 69 6b 65 20 22 6c | 69 6e 74 22 20 77 69 74 | like "l|int" wit|
|00002270| 68 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 43 |h.. | C|
|00002280| 3f 0d 0a 20 20 20 20 20 | 20 20 20 20 20 2b 20 39 |?.. | + 9|
|00002290| 2e 38 3a 20 44 6f 65 73 | 20 41 64 61 20 68 61 76 |.8: Does| Ada hav|
|000022a0| 65 20 73 6f 6d 65 74 68 | 69 6e 67 20 6c 69 6b 65 |e someth|ing like|
|000022b0| 20 74 68 65 20 53 74 61 | 6e 64 61 72 64 20 54 65 | the Sta|ndard Te|
|000022c0| 6d 70 6c 61 74 65 0d 0a | 20 20 20 20 20 20 20 20 |mplate..| |
|000022d0| 20 20 20 20 4c 69 62 72 | 61 72 79 20 28 53 54 4c | Libr|ary (STL|
|000022e0| 29 20 69 6e 20 43 2b 2b | 2c 20 6f 72 20 6c 69 6b |) in C++|, or lik|
|000022f0| 65 20 74 68 65 20 63 6f | 6d 70 6f 6e 65 6e 74 73 |e the co|mponents|
|00002300| 20 6f 6e 65 20 66 69 6e | 64 73 20 69 6e 0d 0a 20 | one fin|ds in.. |
|00002310| 20 20 20 20 20 20 20 20 | 20 20 20 53 6d 61 6c 6c | | Small|
|00002320| 74 61 6c 6b 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |talk env|ironment|
|00002330| 73 3f 0d 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |s?.. | + |
|00002340| 39 2e 39 3a 20 57 68 65 | 72 65 20 63 61 6e 20 49 |9.9: Whe|re can I|
|00002350| 20 66 69 6e 64 20 74 68 | 65 20 65 71 75 69 76 61 | find th|e equiva|
|00002360| 6c 65 6e 74 20 6f 66 20 | 22 70 72 69 6e 74 66 22 |lent of |"printf"|
|00002370| 20 69 6e 20 41 64 61 3f | 0d 0a 0d 0a 0d 0a 20 20 | in Ada?|...... |
|00002380| 20 20 20 2a 20 31 30 3a | 20 49 6e 74 65 72 66 61 | * 10:| Interfa|
|00002390| 63 69 6e 67 20 77 69 74 | 68 20 41 64 61 0d 0a 20 |cing wit|h Ada.. |
|000023a0| 20 20 20 20 20 20 20 20 | 20 2b 20 31 30 2e 31 3a | | + 10.1:|
|000023b0| 20 49 20 61 6d 20 77 72 | 69 74 69 6e 67 20 73 6f | I am wr|iting so|
|000023c0| 66 74 77 61 72 65 20 74 | 68 61 74 20 75 73 65 64 |ftware t|hat used|
|000023d0| 20 74 68 65 20 44 69 73 | 74 72 69 62 75 74 65 64 | the Dis|tributed|
|000023e0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 49 6e |.. | In|
|000023f0| 74 65 72 61 63 74 69 76 | 65 20 53 69 6d 75 6c 61 |teractiv|e Simula|
|00002400| 74 69 6f 6e 20 28 44 49 | 53 29 20 69 6e 74 65 72 |tion (DI|S) inter|
|00002410| 66 61 63 65 2c 20 64 6f | 65 73 20 61 6e 20 69 6e |face, do|es an in|
|00002420| 74 65 72 66 61 63 65 0d | 0a 20 20 20 20 20 20 20 |terface.|. |
|00002430| 20 20 20 20 20 65 78 69 | 73 74 20 69 6e 20 41 64 | exi|st in Ad|
|00002440| 61 3f 0d 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |a?.. | + |
|00002450| 31 30 2e 32 3a 20 49 73 | 20 74 68 65 72 65 20 61 |10.2: Is| there a|
|00002460| 6e 79 20 73 75 70 70 6f | 72 74 20 66 6f 72 20 43 |ny suppo|rt for C|
|00002470| 6f 6d 6d 6f 6e 20 4f 62 | 6a 65 63 74 20 52 65 71 |ommon Ob|ject Req|
|00002480| 75 65 73 74 20 42 72 6f | 6b 65 72 0d 0a 20 20 20 |uest Bro|ker.. |
|00002490| 20 20 20 20 20 20 20 20 | 20 41 72 63 68 69 74 65 | | Archite|
|000024a0| 63 74 75 72 65 20 28 43 | 4f 52 42 41 29 20 66 6f |cture (C|ORBA) fo|
|000024b0| 72 20 41 64 61 20 39 58 | 3f 0d 0a 0d 0a 0d 0a 20 |r Ada 9X|?...... |
|000024c0| 20 20 20 20 2a 20 31 31 | 3a 20 46 69 6e 64 69 6e | * 11|: Findin|
|000024d0| 67 20 41 64 64 69 74 69 | 6f 6e 61 6c 20 49 6e 66 |g Additi|onal Inf|
|000024e0| 6f 72 6d 61 74 69 6f 6e | 0d 0a 20 20 20 20 20 20 |ormation|.. |
|000024f0| 20 20 20 20 2b 20 31 31 | 2e 31 3a 20 57 68 65 72 | + 11|.1: Wher|
|00002500| 65 20 63 61 6e 20 49 20 | 66 69 6e 64 20 41 64 61 |e can I |find Ada|
|00002510| 20 62 6f 6f 6b 73 3f 0d | 0a 20 20 20 20 20 20 20 | books?.|. |
|00002520| 20 20 20 2b 20 31 31 2e | 32 3a 20 41 72 65 20 74 | + 11.|2: Are t|
|00002530| 68 65 72 65 20 6f 74 68 | 65 72 20 41 64 61 2d 72 |here oth|er Ada-r|
|00002540| 65 6c 61 74 65 64 20 46 | 41 51 73 3f 0d 0a 20 20 |elated F|AQs?.. |
|00002550| 20 20 20 20 20 20 20 20 | 2b 20 31 31 2e 33 3a 20 | |+ 11.3: |
|00002560| 57 68 61 74 20 69 73 20 | 74 68 65 20 22 48 42 41 |What is |the "HBA|
|00002570| 50 20 57 57 57 20 53 65 | 72 76 65 72 22 3f 0d 0a |P WWW Se|rver"?..|
|00002580| 0d 0a 0d 0a 20 20 20 20 | 20 2a 20 31 32 3a 20 50 |.... | * 12: P|
|00002590| 72 65 74 74 79 2d 70 72 | 69 6e 74 69 6e 67 20 61 |retty-pr|inting a|
|000025a0| 6e 64 20 4d 65 61 73 75 | 72 69 6e 67 20 41 64 61 |nd Measu|ring Ada|
|000025b0| 20 53 6f 75 72 63 65 20 | 43 6f 64 65 0d 0a 20 20 | Source |Code.. |
|000025c0| 20 20 20 20 20 20 20 20 | 2b 20 31 32 2e 31 3a 20 | |+ 12.1: |
|000025d0| 49 73 20 74 68 65 72 65 | 20 73 6f 66 74 77 61 72 |Is there| softwar|
|000025e0| 65 20 74 68 61 74 20 67 | 65 6e 65 72 61 74 65 73 |e that g|enerates|
|000025f0| 20 61 20 70 72 65 74 74 | 79 20 50 6f 73 74 53 63 | a prett|y PostSc|
|00002600| 72 69 70 74 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |ript.. | |
|00002610| 20 20 66 69 6c 65 20 66 | 72 6f 6d 20 41 64 61 20 | file f|rom Ada |
|00002620| 73 6f 75 72 63 65 20 63 | 6f 64 65 3f 0d 0a 20 20 |source c|ode?.. |
|00002630| 20 20 20 20 20 20 20 20 | 2b 20 31 32 2e 32 3a 20 | |+ 12.2: |
|00002640| 49 20 75 73 65 20 76 67 | 72 69 6e 64 20 74 6f 20 |I use vg|rind to |
|00002650| 64 6f 20 22 70 72 65 74 | 74 79 20 70 72 69 6e 74 |do "pret|ty print|
|00002660| 69 6e 67 22 20 6f 66 20 | 6d 79 20 73 6f 75 72 63 |ing" of |my sourc|
|00002670| 65 2e 20 49 73 0d 0a 20 | 20 20 20 20 20 20 20 20 |e. Is.. | |
|00002680| 20 20 20 74 68 65 72 65 | 20 61 20 76 67 72 69 6e | there| a vgrin|
|00002690| 64 20 64 65 66 69 6e 69 | 74 69 6f 6e 20 66 6f 72 |d defini|tion for|
|000026a0| 20 41 64 61 3f 0d 0a 20 | 20 20 20 20 20 20 20 20 | Ada?.. | |
|000026b0| 20 2b 20 31 32 2e 33 3a | 20 48 6f 77 20 61 62 6f | + 12.3:| How abo|
|000026c0| 75 74 20 61 20 73 6f 75 | 72 63 65 20 63 6f 64 65 |ut a sou|rce code|
|000026d0| 20 72 65 66 6f 72 6d 61 | 74 74 65 72 3f 0d 0a 20 | reforma|tter?.. |
|000026e0| 20 20 20 20 20 20 20 20 | 20 2b 20 31 32 2e 34 3a | | + 12.4:|
|000026f0| 20 48 6f 77 20 63 61 6e | 20 49 20 63 6f 75 6e 74 | How can| I count|
|00002700| 20 73 6f 75 72 63 65 20 | 6c 69 6e 65 73 20 6f 66 | source |lines of|
|00002710| 20 63 6f 64 65 20 28 53 | 4c 4f 43 29 3f 0d 0a 20 | code (S|LOC)?.. |
|00002720| 20 20 20 20 20 20 20 20 | 20 2b 20 31 32 2e 35 3a | | + 12.5:|
|00002730| 20 43 61 6e 20 49 20 6d | 65 61 73 75 72 65 20 6f | Can I m|easure o|
|00002740| 74 68 65 72 20 74 68 69 | 6e 67 73 3f 0d 0a 0d 0a |ther thi|ngs?....|
|00002750| 0d 0a 20 20 20 20 20 2a | 20 31 33 3a 20 43 72 65 |.. *| 13: Cre|
|00002760| 64 69 74 73 0d 0a 0d 0a | 20 20 20 20 20 2a 20 31 |dits....| * 1|
|00002770| 34 3a 20 43 6f 70 79 69 | 6e 67 20 74 68 69 73 20 |4: Copyi|ng this |
|00002780| 46 41 51 0d 0a 0d 0a 0d | 0a 20 20 20 20 20 5f 5f |FAQ.....|. __|
|00002790| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000027a0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000027b0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000027c0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 0d |________|_______.|
|000027d0| 0a 0d 0a 31 3a 20 52 65 | 63 65 6e 74 20 63 68 61 |...1: Re|cent cha|
|000027e0| 6e 67 65 73 20 74 6f 20 | 74 68 69 73 20 46 41 51 |nges to |this FAQ|
|000027f0| 0d 0a 0d 0a 20 20 20 20 | 20 2a 20 39 36 30 32 32 |.... | * 96022|
|00002800| 38 3a 20 72 65 66 65 72 | 65 6e 63 65 73 20 66 6f |8: refer|ences fo|
|00002810| 72 20 72 65 64 65 66 69 | 6e 69 6e 67 20 74 68 65 |r redefi|ning the|
|00002820| 20 61 73 73 69 67 6e 6d | 65 6e 74 20 6f 70 65 72 | assignm|ent oper|
|00002830| 61 74 69 6f 6e 20 28 38 | 2e 31 29 0d 0a 20 20 20 |ation (8|.1).. |
|00002840| 20 20 20 20 28 73 77 69 | 74 63 68 65 64 20 71 75 | (swi|tched qu|
|00002850| 65 73 74 69 6f 6e 73 20 | 38 2e 31 20 61 6e 64 20 |estions |8.1 and |
|00002860| 38 2e 32 29 2e 0d 0a 20 | 20 20 20 20 2a 20 39 36 |8.2)... | * 96|
|00002870| 30 31 33 30 3a 20 61 6e | 6f 74 68 65 72 20 67 61 |0130: an|other ga|
|00002880| 6d 65 20 77 72 69 74 74 | 65 6e 20 69 6e 20 41 64 |me writt|en in Ad|
|00002890| 61 20 28 33 2e 31 33 29 | 2e 0d 0a 20 20 20 20 20 |a (3.13)|... |
|000028a0| 2a 20 39 36 30 31 32 33 | 3a 20 41 52 41 20 63 6f |* 960123|: ARA co|
|000028b0| 6e 74 65 73 74 20 66 6f | 72 20 67 6f 6f 64 20 41 |ntest fo|r good A|
|000028c0| 64 61 20 28 34 2e 33 29 | 2e 0d 0a 20 20 20 20 20 |da (4.3)|... |
|000028d0| 2a 20 39 35 30 39 32 35 | 3a 20 72 65 6d 6f 76 65 |* 950925|: remove|
|000028e0| 64 20 61 20 63 6f 75 70 | 6c 65 20 6f 66 20 6e 6f |d a coup|le of no|
|000028f0| 6e 2d 70 72 6f 67 72 61 | 6d 6d 69 6e 67 20 71 75 |n-progra|mming qu|
|00002900| 65 73 74 69 6f 6e 73 2e | 0d 0a 20 20 20 20 20 2a |estions.|.. *|
|00002910| 20 39 35 30 38 32 38 3a | 20 74 68 65 20 63 68 61 | 950828:| the cha|
|00002920| 6e 67 65 20 6c 6f 67 73 | 20 6e 6f 77 20 69 6e 64 |nge logs| now ind|
|00002930| 69 63 61 74 65 20 74 68 | 65 20 73 65 63 74 69 6f |icate th|e sectio|
|00002940| 6e 2f 71 75 65 73 74 69 | 6f 6e 20 6e 75 6d 62 65 |n/questi|on numbe|
|00002950| 72 2e 0d 0a 20 20 20 20 | 20 2a 20 39 35 30 38 31 |r... | * 95081|
|00002960| 39 3a 20 6e 6f 6e 2d 62 | 6c 6f 63 6b 69 6e 67 2c |9: non-b|locking,|
|00002970| 20 6b 65 79 73 74 72 6f | 6b 65 2d 61 74 2d 61 2d | keystro|ke-at-a-|
|00002980| 74 69 6d 65 20 72 65 61 | 64 69 6e 67 20 28 33 2e |time rea|ding (3.|
|00002990| 31 34 29 2e 0d 0a 20 20 | 20 20 20 2a 20 39 35 30 |14)... | * 950|
|000029a0| 38 31 39 3a 20 73 6f 6d | 65 20 55 52 4c 20 75 70 |819: som|e URL up|
|000029b0| 64 61 74 65 73 3a 20 41 | 64 61 49 43 20 66 69 6c |dates: A|daIC fil|
|000029c0| 65 73 20 6b 65 65 70 20 | 6d 6f 76 69 6e 67 20 61 |es keep |moving a|
|000029d0| 72 6f 75 6e 64 2e 0d 0a | 20 20 20 20 20 2a 20 39 |round...| * 9|
|000029e0| 35 30 36 33 30 3a 20 63 | 6f 72 72 65 63 74 65 64 |50630: c|orrected|
|000029f0| 20 61 6e 73 77 65 72 73 | 20 6f 6e 20 74 61 73 6b | answers| on task|
|00002a00| 20 73 77 69 74 63 68 69 | 6e 67 20 28 33 2e 36 29 | switchi|ng (3.6)|
|00002a10| 20 61 6e 64 20 63 6f 6e | 76 65 72 73 69 6f 6e 0d | and con|version.|
|00002a20| 0a 20 20 20 20 20 20 20 | 76 73 2e 20 71 75 61 6c |. |vs. qual|
|00002a30| 69 66 69 65 72 20 28 33 | 2e 38 29 2e 0d 0a 20 20 |ifier (3|.8)... |
|00002a40| 20 20 20 2a 20 39 35 30 | 35 31 37 3a 20 22 67 65 | * 950|517: "ge|
|00002a50| 6e 65 72 61 6c 22 20 63 | 6c 61 73 73 2d 77 69 64 |neral" c|lass-wid|
|00002a60| 65 20 61 63 63 65 73 73 | 20 74 79 70 65 20 28 35 |e access| type (5|
|00002a70| 2e 39 29 2e 0d 0a 20 20 | 20 20 20 2a 20 39 35 30 |.9)... | * 950|
|00002a80| 34 31 33 3a 20 76 61 72 | 69 61 6e 74 20 72 65 63 |413: var|iant rec|
|00002a90| 6f 72 64 73 20 76 73 2e | 20 74 61 67 67 65 64 20 |ords vs.| tagged |
|00002aa0| 74 79 70 65 73 20 28 35 | 2e 32 29 2c 20 73 75 62 |types (5|.2), sub|
|00002ab0| 6d 69 74 74 65 64 20 62 | 79 0d 0a 20 20 20 20 20 |mitted b|y.. |
|00002ac0| 20 20 4b 2e a0 53 68 69 | 6c 6c 69 6e 67 74 6f 6e | K..Shi|llington|
|00002ad0| 2e 0d 0a 20 20 20 20 20 | 2a 20 39 35 30 34 30 36 |... |* 950406|
|00002ae0| 3a 20 77 68 79 20 41 64 | 61 20 64 6f 65 73 20 6e |: why Ad|a does n|
|00002af0| 6f 74 20 61 6e 64 20 73 | 68 6f 75 6c 64 20 6e 6f |ot and s|hould no|
|00002b00| 74 20 68 61 76 65 20 6d | 61 63 72 6f 73 20 28 38 |t have m|acros (8|
|00002b10| 2e 37 29 2e 0d 0a 20 20 | 20 20 20 2a 20 39 35 30 |.7)... | * 950|
|00002b20| 33 32 30 3a 20 6d 6f 72 | 65 20 6f 6e 20 44 49 53 |320: mor|e on DIS|
|00002b30| 20 28 31 30 2e 31 29 2e | 0d 0a 20 20 20 20 20 2a | (10.1).|.. *|
|00002b40| 20 39 35 30 33 31 35 3a | 20 41 64 61 20 69 73 20 | 950315:| Ada is |
|00002b50| 67 6f 6f 64 20 61 74 20 | 6e 75 6d 65 72 69 63 73 |good at |numerics|
|00002b60| 20 28 36 2e 33 29 2c 20 | 62 79 20 4a 2e a0 50 61 | (6.3), |by J..Pa|
|00002b70| 72 6b 65 72 2e 0d 0a 20 | 20 20 20 20 2a 20 39 35 |rker... | * 95|
|00002b80| 30 33 30 39 3a 20 64 72 | 69 6e 6b 69 6e 67 20 61 |0309: dr|inking a|
|00002b90| 6e 64 20 64 72 69 76 69 | 6e 67 20 65 78 61 6d 70 |nd drivi|ng examp|
|00002ba0| 6c 65 20 28 38 2e 36 29 | 2e 0d 0a 20 20 20 20 20 |le (8.6)|... |
|00002bb0| 2a 20 39 35 30 33 30 36 | 3a 20 61 64 64 65 64 20 |* 950306|: added |
|00002bc0| 63 6f 75 6e 74 69 6e 67 | 20 53 4c 4f 43 20 28 31 |counting| SLOC (1|
|00002bd0| 32 2e 34 29 20 61 6e 64 | 20 6d 65 61 73 75 72 69 |2.4) and| measuri|
|00002be0| 6e 67 20 28 31 32 2e 35 | 29 2e 0d 0a 20 20 20 20 |ng (12.5|)... |
|00002bf0| 20 2a 20 39 35 30 32 32 | 32 3a 20 66 69 78 65 64 | * 95022|2: fixed|
|00002c00| 20 73 6f 6d 65 20 74 79 | 70 6f 73 2e 0d 0a 20 20 | some ty|pos... |
|00002c10| 20 20 20 2a 20 39 35 30 | 32 30 37 3a 20 72 65 76 | * 950|207: rev|
|00002c20| 69 73 65 64 20 69 6e 74 | 72 6f 64 75 63 74 69 6f |ised int|roductio|
|00002c30| 6e 2e 0d 0a 20 20 20 20 | 20 2a 20 39 35 30 32 30 |n... | * 95020|
|00002c40| 32 3a 20 75 70 64 61 74 | 65 64 20 64 69 73 63 75 |2: updat|ed discu|
|00002c50| 73 73 69 6f 6e 20 6f 66 | 20 43 2b 2b 20 53 54 4c |ssion of| C++ STL|
|00002c60| 20 61 6e 64 20 53 6d 61 | 6c 6c 74 61 6c 6b 20 6c | and Sma|lltalk l|
|00002c70| 69 62 72 61 72 79 20 28 | 39 2e 38 29 2e 0d 0a 20 |ibrary (|9.8)... |
|00002c80| 20 20 20 20 2a 20 39 35 | 30 31 32 36 3a 20 61 64 | * 95|0126: ad|
|00002c90| 76 61 6e 74 61 67 65 73 | 20 6f 66 20 63 6f 64 65 |vantages| of code|
|00002ca0| 20 73 68 61 72 69 6e 67 | 20 66 6f 72 20 67 65 6e | sharing| for gen|
|00002cb0| 65 72 69 63 73 20 28 37 | 2e 31 29 3b 20 50 61 73 |erics (7|.1); Pas|
|00002cc0| 63 61 6c 20 74 6f 0d 0a | 20 20 20 20 20 20 20 41 |cal to..| A|
|00002cd0| 64 61 20 74 6f 6f 6c 20 | 28 39 2e 31 29 2e 0d 0a |da tool |(9.1)...|
|00002ce0| 20 20 20 20 20 2a 20 39 | 35 30 31 32 35 3a 20 77 | * 9|50125: w|
|00002cf0| 68 79 20 64 65 66 69 6e | 65 20 6e 65 77 20 69 6e |hy defin|e new in|
|00002d00| 74 65 67 65 72 20 74 79 | 70 65 73 20 28 33 2e 31 |teger ty|pes (3.1|
|00002d10| 31 29 2c 20 61 6e 64 20 | 77 68 79 20 75 73 65 20 |1), and |why use |
|00002d20| 74 68 65 0d 0a 20 20 20 | 20 20 20 20 70 72 65 64 |the.. | pred|
|00002d30| 65 66 69 6e 65 64 20 49 | 6e 74 65 67 65 72 20 74 |efined I|nteger t|
|00002d40| 79 70 65 20 28 33 2e 31 | 32 29 2c 20 73 75 62 6d |ype (3.1|2), subm|
|00002d50| 69 74 74 65 64 20 62 79 | 20 4a 2e a0 50 61 72 6b |itted by| J..Park|
|00002d60| 65 72 2e 0d 0a 20 20 20 | 20 20 2a 20 39 35 30 31 |er... | * 9501|
|00002d70| 32 34 3a 20 61 70 70 72 | 6f 76 65 64 20 66 6f 72 |24: appr|oved for|
|00002d80| 20 70 6f 73 74 69 6e 67 | 20 69 6e 20 2a 2e 61 6e | posting| in *.an|
|00002d90| 73 77 65 72 73 2e 0d 0a | 20 20 20 20 20 2a 20 39 |swers...| * 9|
|00002da0| 35 30 31 31 36 3a 20 63 | 6f 6e 76 65 72 74 69 6e |50116: c|onvertin|
|00002db0| 67 20 41 64 61 20 38 33 | 20 63 6f 64 65 20 74 6f |g Ada 83| code to|
|00002dc0| 20 41 64 61 20 39 58 20 | 28 39 2e 32 29 2e 0d 0a | Ada 9X |(9.2)...|
|00002dd0| 20 20 20 20 20 2a 20 39 | 35 30 31 30 36 3a 20 6c | * 9|50106: l|
|00002de0| 65 6e 67 74 68 79 20 63 | 6f 64 65 20 73 65 63 74 |engthy c|ode sect|
|00002df0| 69 6f 6e 73 20 65 78 74 | 72 61 63 74 65 64 20 61 |ions ext|racted a|
|00002e00| 6e 64 20 70 75 74 20 6f | 6e 20 46 54 50 20 73 65 |nd put o|n FTP se|
|00002e10| 72 76 65 72 2e 0d 0a 20 | 20 20 20 20 2a 20 39 35 |rver... | * 95|
|00002e20| 30 31 30 35 3a 20 70 72 | 69 6e 74 66 20 73 6f 6c |0105: pr|intf sol|
|00002e30| 75 74 69 6f 6e 20 28 39 | 2e 39 29 3b 20 75 70 64 |ution (9|.9); upd|
|00002e40| 61 74 65 20 6f 6e 20 65 | 78 63 65 70 74 69 6f 6e |ate on e|xception|
|00002e50| 20 74 72 61 63 65 73 20 | 61 6e 64 0d 0a 20 20 20 | traces |and.. |
|00002e60| 20 20 20 20 76 67 72 69 | 6e 64 2e 0d 0a 20 20 20 | vgri|nd... |
|00002e70| 20 20 2a 20 39 35 30 31 | 30 34 3a 20 6c 69 6e 6b | * 9501|04: link|
|00002e80| 73 20 66 72 6f 6d 20 54 | 4f 43 20 74 6f 20 61 6c |s from T|OC to al|
|00002e90| 6c 20 71 75 65 73 74 69 | 6f 6e 73 2e 0d 0a 0d 0a |l questi|ons.....|
|00002ea0| 0d 0a 20 20 20 57 68 61 | 74 27 73 20 69 6d 70 6f |.. Wha|t's impo|
|00002eb0| 72 74 61 6e 74 20 61 6e | 64 20 6d 69 73 73 69 6e |rtant an|d missin|
|00002ec0| 67 3a 0d 0a 20 20 20 20 | 20 2a 20 65 76 65 72 79 |g:.. | * every|
|00002ed0| 74 68 69 6e 67 2c 20 6c | 69 66 65 2c 20 61 6e 64 |thing, l|ife, and|
|00002ee0| 20 34 32 0d 0a 0d 0a 0d | 0a 20 20 20 20 20 5f 5f | 42.....|. __|
|00002ef0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002f00| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002f10| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002f20| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 0d |________|_______.|
|00002f30| 0a 0d 0a 0d 0a 32 3a 20 | 49 6e 66 6f 72 6d 61 74 |.....2: |Informat|
|00002f40| 69 6f 6e 20 61 62 6f 75 | 74 20 74 68 69 73 20 64 |ion abou|t this d|
|00002f50| 6f 63 75 6d 65 6e 74 0d | 0a 0d 0a 20 20 20 54 68 |ocument.|... Th|
|00002f60| 69 73 20 66 69 6c 65 20 | 69 73 20 70 6f 73 74 65 |is file |is poste|
|00002f70| 64 20 6d 6f 6e 74 68 6c | 79 20 74 6f 20 63 6f 6d |d monthl|y to com|
|00002f80| 70 2e 6c 61 6e 67 2e 61 | 64 61 2c 20 63 6f 6d 70 |p.lang.a|da, comp|
|00002f90| 2e 61 6e 73 77 65 72 73 | 2c 20 61 6e 64 0d 0a 20 |.answers|, and.. |
|00002fa0| 20 20 6e 65 77 73 2e 61 | 6e 73 77 65 72 73 2e 0d | news.a|nswers..|
|00002fb0| 0a 0d 0a 20 20 20 54 68 | 69 73 20 64 6f 63 75 6d |... Th|is docum|
|00002fc0| 65 6e 74 20 68 61 73 20 | 61 20 68 6f 6d 65 20 6f |ent has |a home o|
|00002fd0| 6e 20 74 68 65 20 48 6f | 6d 65 20 6f 66 20 74 68 |n the Ho|me of th|
|00002fe0| 65 20 42 72 61 76 65 20 | 41 64 61 20 50 72 6f 67 |e Brave |Ada Prog|
|00002ff0| 72 61 6d 6d 65 72 73 0d | 0a 20 20 20 28 48 42 41 |rammers.|. (HBA|
|00003000| 50 29 20 57 57 57 20 53 | 65 72 76 65 72 2c 20 69 |P) WWW S|erver, i|
|00003010| 6e 20 68 79 70 65 72 74 | 65 78 74 20 66 6f 72 6d |n hypert|ext form|
|00003020| 61 74 2c 20 55 52 4c 0d | 0a 20 20 20 68 74 74 70 |at, URL.|. http|
|00003030| 3a 2f 2f 6c 67 6c 77 77 | 77 2e 65 70 66 6c 2e 63 |://lglww|w.epfl.c|
|00003040| 68 2f 41 64 61 2f 46 41 | 51 2f 70 72 6f 67 72 61 |h/Ada/FA|Q/progra|
|00003050| 6d 6d 69 6e 67 2e 68 74 | 6d 6c 0d 0a 0d 0a 20 20 |mming.ht|ml.... |
|00003060| 20 49 74 20 69 73 20 61 | 76 61 69 6c 61 62 6c 65 | It is a|vailable|
|00003070| 20 2d 2d 61 73 20 70 6f | 73 74 65 64 20 69 6e 20 | --as po|sted in |
|00003080| 2a 2e 61 6e 73 77 65 72 | 73 2d 2d 20 6f 6e 20 72 |*.answer|s-- on r|
|00003090| 74 66 6d 2e 6d 69 74 2e | 65 64 75 2c 20 77 68 69 |tfm.mit.|edu, whi|
|000030a0| 63 68 0d 0a 20 20 20 61 | 72 63 68 69 76 65 73 20 |ch.. a|rchives |
|000030b0| 61 6c 6c 20 46 41 51 20 | 66 69 6c 65 73 20 70 6f |all FAQ |files po|
|000030c0| 73 74 65 64 20 74 6f 20 | 2a 2e 61 6e 73 77 65 72 |sted to |*.answer|
|000030d0| 73 3b 20 73 65 65 0d 0a | 20 20 20 66 74 70 3a 2f |s; see..| ftp:/|
|000030e0| 2f 72 74 66 6d 2e 6d 69 | 74 2e 65 64 75 2f 70 75 |/rtfm.mi|t.edu/pu|
|000030f0| 62 2f 75 73 65 6e 65 74 | 2d 62 79 2d 67 72 6f 75 |b/usenet|-by-grou|
|00003100| 70 2f 6e 65 77 73 2e 61 | 6e 73 77 65 72 73 2f 63 |p/news.a|nswers/c|
|00003110| 6f 6d 70 75 74 65 72 2d | 6c 61 6e 67 2f 41 64 61 |omputer-|lang/Ada|
|00003120| 0d 0a 0d 0a 20 20 20 54 | 68 65 20 74 65 78 74 2d |.... T|he text-|
|00003130| 6f 6e 6c 79 20 76 65 72 | 73 69 6f 6e 20 69 73 20 |only ver|sion is |
|00003140| 61 6c 73 6f 20 61 76 61 | 69 6c 61 62 6c 65 20 69 |also ava|ilable i|
|00003150| 6e 20 64 69 72 65 63 74 | 6f 72 79 0d 0a 20 20 20 |n direct|ory.. |
|00003160| 66 74 70 3a 2f 2f 6c 67 | 6c 66 74 70 2e 65 70 66 |ftp://lg|lftp.epf|
|00003170| 6c 2e 63 68 2f 70 75 62 | 2f 41 64 61 2f 46 41 51 |l.ch/pub|/Ada/FAQ|
|00003180| 0d 0a 0d 0a 20 20 20 4d | 61 67 6e 75 73 20 4b 65 |.... M|agnus Ke|
|00003190| 6d 70 65 20 6d 61 69 6e | 74 61 69 6e 73 20 74 68 |mpe main|tains th|
|000031a0| 69 73 20 64 6f 63 75 6d | 65 6e 74 3b 20 69 74 27 |is docum|ent; it'|
|000031b0| 73 20 61 20 68 6f 62 62 | 79 2c 20 6e 6f 74 20 61 |s a hobb|y, not a|
|000031c0| 20 6a 6f 62 2e 0d 0a 20 | 20 20 46 65 65 64 62 61 | job... | Feedba|
|000031d0| 63 6b 20 28 63 6f 72 72 | 65 63 74 69 6f 6e 73 2c |ck (corr|ections,|
|000031e0| 20 73 75 67 67 65 73 74 | 69 6f 6e 73 2c 20 69 64 | suggest|ions, id|
|000031f0| 65 61 73 29 20 61 62 6f | 75 74 20 69 74 20 69 73 |eas) abo|ut it is|
|00003200| 20 74 6f 20 62 65 20 73 | 65 6e 74 20 76 69 61 0d | to be s|ent via.|
|00003210| 0a 20 20 20 65 2d 6d 61 | 69 6c 20 74 6f 20 4d 61 |. e-ma|il to Ma|
|00003220| 67 6e 75 73 2e 4b 65 6d | 70 65 40 64 69 2e 65 70 |gnus.Kem|pe@di.ep|
|00003230| 66 6c 2e 63 68 0d 0a 20 | 20 20 54 68 61 6e 6b 73 |fl.ch.. | Thanks|
|00003240| 2e 0d 0a 0d 0a 20 20 20 | 49 6e 20 61 6c 6c 20 63 |..... |In all c|
|00003250| 61 73 65 73 2c 20 74 68 | 65 20 6d 6f 73 74 20 75 |ases, th|e most u|
|00003260| 70 2d 74 6f 2d 64 61 74 | 65 20 76 65 72 73 69 6f |p-to-dat|e versio|
|00003270| 6e 20 6f 66 20 74 68 65 | 20 46 41 51 20 69 73 20 |n of the| FAQ is |
|00003280| 74 68 65 20 76 65 72 73 | 69 6f 6e 0d 0a 20 20 20 |the vers|ion.. |
|00003290| 6d 61 69 6e 74 61 69 6e | 65 64 20 6f 6e 20 74 68 |maintain|ed on th|
|000032a0| 65 20 48 42 41 50 20 57 | 57 57 20 53 65 72 76 65 |e HBAP W|WW Serve|
|000032b0| 72 2e 20 50 6c 65 61 73 | 65 20 65 78 63 75 73 65 |r. Pleas|e excuse|
|000032c0| 20 61 6e 79 20 66 6f 72 | 6d 61 74 74 69 6e 67 0d | any for|matting.|
|000032d0| 0a 20 20 20 69 6e 63 6f | 6e 73 69 73 74 65 6e 63 |. inco|nsistenc|
|000032e0| 69 65 73 20 69 6e 20 74 | 68 65 20 70 6f 73 74 65 |ies in t|he poste|
|000032f0| 64 20 76 65 72 73 69 6f | 6e 20 6f 66 20 74 68 69 |d versio|n of thi|
|00003300| 73 20 64 6f 63 75 6d 65 | 6e 74 2c 20 61 73 20 69 |s docume|nt, as i|
|00003310| 74 20 69 73 0d 0a 20 20 | 20 61 75 74 6f 6d 61 74 |t is.. | automat|
|00003320| 69 63 61 6c 6c 79 20 67 | 65 6e 65 72 61 74 65 64 |ically g|enerated|
|00003330| 20 66 72 6f 6d 20 74 68 | 65 20 6f 6e 2d 6c 69 6e | from th|e on-lin|
|00003340| 65 20 76 65 72 73 69 6f | 6e 2e 0d 0a 0d 0a 20 20 |e versio|n..... |
|00003350| 20 20 20 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f | _____|________|
|00003360| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003370| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003380| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00003390| 5f 5f 5f 5f 0d 0a 0d 0a | 0d 0a 33 3a 20 45 6c 65 |____....|..3: Ele|
|000033a0| 6d 65 6e 74 61 72 79 20 | 51 75 65 73 74 69 6f 6e |mentary |Question|
|000033b0| 73 0d 0a 0d 0a 0d 0a 33 | 2e 31 3a 20 48 6f 77 20 |s......3|.1: How |
|000033c0| 64 6f 20 49 20 6d 61 6b | 65 20 6f 70 65 72 61 74 |do I mak|e operat|
|000033d0| 69 6f 6e 73 20 64 69 72 | 65 63 74 6c 79 20 76 69 |ions dir|ectly vi|
|000033e0| 73 69 62 6c 65 20 77 69 | 74 68 6f 75 74 20 22 75 |sible wi|thout "u|
|000033f0| 73 65 22 69 6e 67 20 74 | 68 65 20 70 61 63 6b 61 |se"ing t|he packa|
|00003400| 67 65 3f 0d 0a 0d 0a 20 | 20 20 49 6e 20 41 64 61 |ge?.... | In Ada|
|00003410| 20 38 33 2c 20 79 6f 75 | 20 63 61 6e 20 72 65 6e | 83, you| can ren|
|00003420| 61 6d 65 20 74 68 65 20 | 6f 70 65 72 61 74 69 6f |ame the |operatio|
|00003430| 6e 73 20 69 6e 20 79 6f | 75 72 20 73 63 6f 70 65 |ns in yo|ur scope|
|00003440| 2e 0d 0a 0d 0a 20 20 20 | 20 20 2d 2d 20 53 61 79 |..... | -- Say|
|00003450| 20 79 6f 75 20 68 61 76 | 65 20 61 6e 20 69 6e 74 | you hav|e an int|
|00003460| 65 67 65 72 20 74 79 70 | 65 20 63 61 6c 6c 65 64 |eger typ|e called|
|00003470| 20 49 6e 74 20 69 6e 20 | 70 61 63 6b 61 67 65 20 | Int in |package |
|00003480| 54 79 70 65 73 0d 0a 20 | 20 20 20 20 66 75 6e 63 |Types.. | func|
|00003490| 74 69 6f 6e 20 22 3c 22 | 20 28 4c 65 66 74 2c 20 |tion "<"| (Left, |
|000034a0| 52 69 67 68 74 20 3a 20 | 54 79 70 65 73 2e 49 6e |Right : |Types.In|
|000034b0| 74 29 0d 0a 20 20 20 20 | 20 20 20 72 65 74 75 72 |t).. | retur|
|000034c0| 6e 20 42 6f 6f 6c 65 61 | 6e 0d 0a 20 20 20 20 20 |n Boolea|n.. |
|000034d0| 20 20 72 65 6e 61 6d 65 | 73 20 54 79 70 65 73 2e | rename|s Types.|
|000034e0| 22 3c 22 3b 0d 0a 20 20 | 20 20 20 2d 2d 20 4d 61 |"<";.. | -- Ma|
|000034f0| 6b 65 20 73 75 72 65 20 | 74 68 65 20 70 72 6f 66 |ke sure |the prof|
|00003500| 69 6c 65 73 20 6f 66 20 | 74 68 65 20 66 69 72 73 |iles of |the firs|
|00003510| 74 20 61 6e 64 20 6c 61 | 73 74 20 22 3c 22 20 6d |t and la|st "<" m|
|00003520| 61 74 63 68 21 0d 0a 0d | 0a 0d 0a 20 20 20 46 6f |atch!...|... Fo|
|00003530| 72 20 6f 70 65 72 61 74 | 6f 72 73 2c 20 41 64 61 |r operat|ors, Ada|
|00003540| 20 39 35 20 69 6e 74 72 | 6f 64 75 63 65 73 20 74 | 95 intr|oduces t|
|00003550| 68 65 20 22 75 73 65 20 | 74 79 70 65 22 20 63 6c |he "use |type" cl|
|00003560| 61 75 73 65 3a 0d 0a 0d | 0a 20 20 20 20 20 75 73 |ause:...|. us|
|00003570| 65 20 74 79 70 65 20 54 | 79 70 65 73 2e 49 6e 74 |e type T|ypes.Int|
|00003580| 3b 20 2d 2d 20 6d 61 6b | 65 73 20 6f 70 65 72 61 |; -- mak|es opera|
|00003590| 74 6f 72 73 20 64 69 72 | 65 63 74 6c 79 20 76 69 |tors dir|ectly vi|
|000035a0| 73 69 62 6c 65 0d 0a 0d | 0a 0d 0a 33 2e 32 3a 20 |sible...|...3.2: |
|000035b0| 48 6f 77 20 64 6f 20 49 | 20 61 73 73 69 67 6e 20 |How do I| assign |
|000035c0| 74 6f 20 61 6e 20 61 72 | 72 61 79 20 6f 66 20 6c |to an ar|ray of l|
|000035d0| 65 6e 67 74 68 20 31 3f | 0d 0a 0d 0a 20 20 20 42 |ength 1?|.... B|
|000035e0| 65 63 61 75 73 65 20 6f | 66 20 61 6d 62 69 67 75 |ecause o|f ambigu|
|000035f0| 69 74 79 20 6f 66 20 70 | 61 72 65 6e 74 68 65 73 |ity of p|arenthes|
|00003600| 65 73 2c 20 6e 61 6d 65 | 64 20 6e 6f 74 61 74 69 |es, name|d notati|
|00003610| 6f 6e 20 6d 75 73 74 20 | 62 65 20 75 73 65 64 20 |on must |be used |
|00003620| 66 6f 72 0d 0a 20 20 20 | 6f 6e 65 2d 65 6c 65 6d |for.. |one-elem|
|00003630| 65 6e 74 20 61 67 67 72 | 65 67 61 74 65 73 20 28 |ent aggr|egates (|
|00003640| 6f 72 2c 20 75 6e 64 65 | 72 20 61 20 64 69 66 66 |or, unde|r a diff|
|00003650| 65 72 65 6e 74 20 61 6e | 67 6c 65 3a 20 61 20 70 |erent an|gle: a p|
|00003660| 6f 73 69 74 69 6f 6e 61 | 6c 0d 0a 20 20 20 61 67 |ositiona|l.. ag|
|00003670| 67 72 65 67 61 74 65 20 | 6d 75 73 74 20 68 61 76 |gregate |must hav|
|00003680| 65 20 6d 6f 72 65 20 74 | 68 61 6e 20 6f 6e 65 20 |e more t|han one |
|00003690| 63 6f 6d 70 6f 6e 65 6e | 74 29 2e 0d 0a 0d 0a 20 |componen|t)..... |
|000036a0| 20 20 53 65 65 20 5b 52 | 4d 39 58 20 34 2e 33 2e | See [R|M9X 4.3.|
|000036b0| 33 28 37 29 5d 20 61 73 | 20 77 65 6c 6c 20 61 73 |3(7)] as| well as|
|000036c0| 20 74 68 65 20 73 79 6e | 74 61 78 20 72 75 6c 65 | the syn|tax rule|
|000036d0| 20 6f 66 0d 0a 20 20 20 | 70 6f 73 69 74 69 6f 6e | of.. |position|
|000036e0| 61 6c 5f 61 72 72 61 79 | 5f 61 67 67 72 65 67 61 |al_array|_aggrega|
|000036f0| 74 65 20 69 6e 20 5b 52 | 4d 39 58 20 34 2e 33 2e |te in [R|M9X 4.3.|
|00003700| 33 5d 3b 20 68 69 73 74 | 6f 72 69 61 6e 73 20 73 |3]; hist|orians s|
|00003710| 65 65 20 5b 52 4d 38 33 | 0d 0a 20 20 20 34 2e 33 |ee [RM83|.. 4.3|
|00003720| 28 34 29 5d 2e 0d 0a 0d | 0a 20 20 20 20 20 64 65 |(4)]....|. de|
|00003730| 63 6c 61 72 65 0d 0a 20 | 20 20 20 20 20 20 41 72 |clare.. | Ar|
|00003740| 72 61 79 5f 6f 66 5f 4f | 6e 65 20 3a 20 61 72 72 |ray_of_O|ne : arr|
|00003750| 61 79 20 28 31 2e 2e 31 | 29 20 6f 66 20 46 6c 6f |ay (1..1|) of Flo|
|00003760| 61 74 3b 0d 0a 20 20 20 | 20 20 62 65 67 69 6e 0d |at;.. | begin.|
|00003770| 0a 20 20 20 20 20 20 20 | 2d 2d 20 41 72 72 61 79 |. |-- Array|
|00003780| 5f 6f 66 5f 4f 6e 65 20 | 3a 3d 20 28 31 30 2e 30 |_of_One |:= (10.0|
|00003790| 29 3b 20 20 20 2d 2d 20 | 57 6f 6e 27 74 20 77 6f |); -- |Won't wo|
|000037a0| 72 6b 2c 20 70 61 72 73 | 65 64 20 61 73 20 61 6e |rk, pars|ed as an|
|000037b0| 20 65 78 70 72 65 73 73 | 69 6f 6e 0d 0a 20 20 20 | express|ion.. |
|000037c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000037d0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000037e0| 20 2d 2d 20 77 69 74 68 | 69 6e 20 70 61 72 65 6e | -- with|in paren|
|000037f0| 74 68 65 73 65 73 0d 0a | 0d 0a 20 20 20 20 20 20 |theses..|.. |
|00003800| 20 41 72 72 61 79 5f 6f | 66 5f 4f 6e 65 20 3a 3d | Array_o|f_One :=|
|00003810| 20 28 31 20 3d 3e 20 31 | 30 2e 30 29 3b 20 2d 2d | (1 => 1|0.0); --|
|00003820| 20 4e 6f 20 61 6d 62 69 | 67 75 69 74 79 20 68 65 | No ambi|guity he|
|00003830| 72 65 0d 0a 20 20 20 20 | 20 65 6e 64 3b 0d 0a 0d |re.. | end;...|
|00003840| 0a 0d 0a 20 20 20 59 6f | 75 20 63 61 6e 27 74 20 |... Yo|u can't |
|00003850| 77 72 69 74 65 20 61 20 | 6f 6e 65 2d 65 6c 65 6d |write a |one-elem|
|00003860| 65 6e 74 20 70 6f 73 69 | 74 69 6f 6e 61 6c 20 61 |ent posi|tional a|
|00003870| 67 67 72 65 67 61 74 65 | 20 69 6e 20 41 64 61 2e |ggregate| in Ada.|
|00003880| 20 4e 6f 72 20 61 0d 0a | 20 20 20 7a 65 72 6f 2d | Nor a..| zero-|
|00003890| 65 6c 65 6d 65 6e 74 20 | 61 67 67 72 65 67 61 74 |element |aggregat|
|000038a0| 65 2e 20 54 68 65 20 72 | 65 61 73 6f 6e 20 66 6f |e. The r|eason fo|
|000038b0| 72 20 74 68 69 73 20 72 | 65 73 74 72 69 63 74 69 |r this r|estricti|
|000038c0| 6f 6e 20 69 73 20 74 68 | 61 74 20 69 74 0d 0a 20 |on is th|at it.. |
|000038d0| 20 20 77 6f 75 6c 64 20 | 62 65 20 64 69 66 66 69 | would |be diffi|
|000038e0| 63 75 6c 74 20 66 6f 72 | 20 63 6f 6d 70 69 6c 65 |cult for| compile|
|000038f0| 72 73 20 74 6f 20 64 65 | 74 65 72 6d 69 6e 65 20 |rs to de|termine |
|00003900| 77 68 65 74 68 65 72 3a | 0d 0a 0d 0a 20 20 20 20 |whether:|.... |
|00003910| 20 28 20 65 78 70 20 29 | 0d 0a 0d 0a 20 20 20 69 | ( exp )|.... i|
|00003920| 73 20 61 20 70 61 72 65 | 6e 74 68 65 73 69 7a 65 |s a pare|nthesize|
|00003930| 64 20 65 78 70 72 65 73 | 73 69 6f 6e 20 6f 66 20 |d expres|sion of |
|00003940| 73 6f 6d 65 20 74 79 70 | 65 2c 20 6f 72 20 61 6e |some typ|e, or an|
|00003950| 20 61 67 67 72 65 67 61 | 74 65 20 6f 66 20 61 6e | aggrega|te of an|
|00003960| 0d 0a 20 20 20 61 72 72 | 61 79 20 74 79 70 65 2e |.. arr|ay type.|
|00003970| 20 49 66 20 41 64 61 20 | 68 61 64 20 75 73 65 64 | If Ada |had used|
|00003980| 20 73 6f 6d 65 20 6f 74 | 68 65 72 20 6e 6f 74 61 | some ot|her nota|
|00003990| 74 69 6f 6e 20 66 6f 72 | 20 61 67 67 72 65 67 61 |tion for| aggrega|
|000039a0| 74 65 73 20 28 73 61 79 | 2c 0d 0a 20 20 20 22 5b |tes (say|,.. "[|
|000039b0| 2e 2e 2e 5d 22 29 2c 20 | 74 68 65 6e 20 74 68 69 |...]"), |then thi|
|000039c0| 73 20 70 72 6f 62 6c 65 | 6d 20 77 6f 75 6c 64 20 |s proble|m would |
|000039d0| 6e 6f 74 20 65 78 69 73 | 74 2e 0d 0a 0d 0a 20 20 |not exis|t..... |
|000039e0| 20 41 70 70 61 72 65 6e | 74 6c 79 20 74 68 65 20 | Apparen|tly the |
|000039f0| 6f 72 69 67 69 6e 61 6c | 20 72 65 71 75 69 72 65 |original| require|
|00003a00| 6d 65 6e 74 73 20 66 6f | 72 20 41 64 61 20 66 6f |ments fo|r Ada fo|
|00003a10| 72 62 61 64 65 20 75 73 | 69 6e 67 20 63 65 72 74 |rbade us|ing cert|
|00003a20| 61 69 6e 0d 0a 20 20 20 | 41 53 43 49 49 20 63 68 |ain.. |ASCII ch|
|00003a30| 61 72 61 63 74 65 72 73 | 2c 20 6c 69 6b 65 20 27 |aracters|, like '|
|00003a40| 5b 27 20 61 6e 64 20 27 | 5d 27 2c 20 62 65 63 61 |[' and '|]', beca|
|00003a50| 75 73 65 20 74 68 6f 73 | 65 20 63 68 61 72 61 63 |use thos|e charac|
|00003a60| 74 65 72 73 20 77 65 72 | 65 20 6e 6f 74 0d 0a 20 |ters wer|e not.. |
|00003a70| 20 20 61 76 61 69 6c 61 | 62 6c 65 20 6f 6e 20 61 | availa|ble on a|
|00003a80| 6c 6c 20 68 61 72 64 77 | 61 72 65 2e 20 41 6c 73 |ll hardw|are. Als|
|00003a90| 6f 2c 20 63 65 72 74 61 | 69 6e 20 63 68 61 72 61 |o, certa|in chara|
|00003aa0| 63 74 65 72 73 20 61 72 | 65 20 75 73 65 64 20 66 |cters ar|e used f|
|00003ab0| 6f 72 0d 0a 20 20 20 64 | 69 66 66 65 72 65 6e 74 |or.. d|ifferent|
|00003ac0| 20 70 75 72 70 6f 73 65 | 73 20 61 6e 64 20 67 6c | purpose|s and gl|
|00003ad0| 79 70 68 73 20 69 6e 20 | 63 6f 75 6e 74 72 69 65 |yphs in |countrie|
|00003ae0| 73 20 74 68 61 74 20 6e | 65 65 64 20 61 64 64 69 |s that n|eed addi|
|00003af0| 74 69 6f 6e 61 6c 0d 0a | 20 20 20 6c 65 74 74 65 |tional..| lette|
|00003b00| 72 73 20 6e 6f 74 20 70 | 72 65 73 65 6e 74 20 69 |rs not p|resent i|
|00003b10| 6e 20 41 53 43 49 49 2e | 0d 0a 0d 0a 0d 0a 33 2e |n ASCII.|......3.|
|00003b20| 33 3a 20 48 6f 77 20 64 | 6f 20 49 20 63 72 65 61 |3: How d|o I crea|
|00003b30| 74 65 20 61 20 43 2d 73 | 74 79 6c 65 20 6e 75 6c |te a C-s|tyle nul|
|00003b40| 2d 74 65 72 6d 69 6e 61 | 74 65 64 20 73 74 72 69 |-termina|ted stri|
|00003b50| 6e 67 3f 0d 0a 0d 0a 20 | 20 20 49 6e 20 61 20 64 |ng?.... | In a d|
|00003b60| 65 63 6c 61 72 61 74 69 | 6f 6e 20 62 6c 6f 63 6b |eclarati|on block|
|00003b70| 2c 20 61 70 70 65 6e 64 | 20 61 6e 20 41 53 43 49 |, append| an ASCI|
|00003b80| 49 2e 4e 55 4c 20 74 6f | 20 63 72 65 61 74 65 20 |I.NUL to| create |
|00003b90| 61 20 63 6f 6e 73 74 61 | 6e 74 20 41 64 61 0d 0a |a consta|nt Ada..|
|00003ba0| 20 20 20 73 74 72 69 6e | 67 2e 0d 0a 0d 0a 20 20 | strin|g..... |
|00003bb0| 20 20 20 64 65 63 6c 61 | 72 65 0d 0a 20 20 20 20 | decla|re.. |
|00003bc0| 20 20 20 53 74 72 5f 4e | 75 6c 20 3a 20 63 6f 6e | Str_N|ul : con|
|00003bd0| 73 74 61 6e 74 20 53 74 | 72 69 6e 67 20 3a 3d 20 |stant St|ring := |
|00003be0| 53 74 72 20 26 20 41 53 | 43 49 49 2e 4e 55 4c 3b |Str & AS|CII.NUL;|
|00003bf0| 0d 0a 20 20 20 20 20 62 | 65 67 69 6e 0d 0a 20 20 |.. b|egin.. |
|00003c00| 20 20 20 20 20 43 61 6c | 6c 5f 52 65 71 75 69 72 | Cal|l_Requir|
|00003c10| 69 6e 67 5f 43 5f 53 74 | 72 69 6e 67 20 28 53 74 |ing_C_St|ring (St|
|00003c20| 72 5f 4e 75 6c 20 28 53 | 74 72 5f 4e 75 6c 27 46 |r_Nul (S|tr_Nul'F|
|00003c30| 69 72 73 74 29 27 41 64 | 64 72 65 73 73 29 3b 0d |irst)'Ad|dress);.|
|00003c40| 0a 20 20 20 20 20 65 6e | 64 3b 0d 0a 0d 0a 2d 2d |. en|d;....--|
|00003c50| 20 6f 72 20 2d 2d 0d 0a | 0d 0a 20 20 20 20 20 66 | or --..|.. f|
|00003c60| 75 6e 63 74 69 6f 6e 20 | 4e 75 6c 5f 54 65 72 6d |unction |Nul_Term|
|00003c70| 69 6e 61 74 65 20 28 53 | 74 72 20 3a 20 53 74 72 |inate (S|tr : Str|
|00003c80| 69 6e 67 29 0d 0a 20 20 | 20 20 20 20 20 72 65 74 |ing).. | ret|
|00003c90| 75 72 6e 20 53 74 72 69 | 6e 67 20 69 73 0d 0a 20 |urn Stri|ng is.. |
|00003ca0| 20 20 20 20 20 20 53 74 | 72 5f 4e 75 6c 20 3a 20 | St|r_Nul : |
|00003cb0| 63 6f 6e 73 74 61 6e 74 | 20 53 74 72 69 6e 67 20 |constant| String |
|00003cc0| 3a 3d 20 53 74 72 20 26 | 20 41 53 43 49 49 2e 4e |:= Str &| ASCII.N|
|00003cd0| 55 4c 3b 0d 0a 20 20 20 | 20 20 62 65 67 69 6e 0d |UL;.. | begin.|
|00003ce0| 0a 20 20 20 20 20 20 20 | 72 65 74 75 72 6e 20 53 |. |return S|
|00003cf0| 74 72 5f 4e 75 6c 3b 0d | 0a 20 20 20 20 20 65 6e |tr_Nul;.|. en|
|00003d00| 64 20 4e 75 6c 5f 54 65 | 72 6d 69 6e 61 74 65 3b |d Nul_Te|rminate;|
|00003d10| 0d 0a 0d 0a 0d 0a 33 2e | 34 3a 20 48 6f 77 20 63 |......3.|4: How c|
|00003d20| 61 6e 20 49 20 63 72 65 | 61 74 65 20 61 6e 20 61 |an I cre|ate an a|
|00003d30| 72 72 61 79 20 6f 66 20 | 73 74 72 69 6e 67 73 20 |rray of |strings |
|00003d40| 6f 66 20 76 61 72 69 6f | 75 73 20 6c 65 6e 67 74 |of vario|us lengt|
|00003d50| 68 3f 0d 0a 0d 0a 20 20 | 20 49 6e 20 41 64 61 20 |h?.... | In Ada |
|00003d60| 38 33 2c 20 79 6f 75 20 | 68 61 76 65 20 74 6f 20 |83, you |have to |
|00003d70| 75 73 65 20 73 74 72 69 | 6e 67 20 61 63 63 65 73 |use stri|ng acces|
|00003d80| 73 20 74 79 70 65 73 20 | 61 6e 64 20 22 6e 65 77 |s types |and "new|
|00003d90| 22 20 74 6f 20 67 65 74 | 0d 0a 20 20 20 22 72 61 |" to get|.. "ra|
|00003da0| 67 67 65 64 22 20 61 72 | 72 61 79 73 3a 0d 0a 0d |gged" ar|rays:...|
|00003db0| 0a 20 20 20 20 20 74 79 | 70 65 20 53 74 72 69 6e |. ty|pe Strin|
|00003dc0| 67 5f 41 63 63 65 73 73 | 20 69 73 0d 0a 20 20 20 |g_Access| is.. |
|00003dd0| 20 20 20 20 61 63 63 65 | 73 73 20 53 74 72 69 6e | acce|ss Strin|
|00003de0| 67 3b 0d 0a 0d 0a 20 20 | 20 20 20 53 74 72 69 6e |g;.... | Strin|
|00003df0| 67 73 20 3a 20 63 6f 6e | 73 74 61 6e 74 20 61 72 |gs : con|stant ar|
|00003e00| 72 61 79 20 28 50 6f 73 | 69 74 69 76 65 20 72 61 |ray (Pos|itive ra|
|00003e10| 6e 67 65 20 31 2e 2e 33 | 29 20 6f 66 20 53 74 72 |nge 1..3|) of Str|
|00003e20| 69 6e 67 5f 41 63 63 65 | 73 73 0d 0a 20 20 20 20 |ing_Acce|ss.. |
|00003e30| 20 20 20 20 20 20 20 20 | 20 3a 3d 20 28 20 31 20 | | := ( 1 |
|00003e40| 3d 3e 20 6e 65 77 20 53 | 74 72 69 6e 67 27 28 22 |=> new S|tring'("|
|00003e50| 4f 6e 65 22 29 2c 0d 0a | 20 20 20 20 20 20 20 20 |One"),..| |
|00003e60| 20 20 20 20 20 20 20 20 | 20 20 32 20 3d 3e 20 6e | | 2 => n|
|00003e70| 65 77 20 53 74 72 69 6e | 67 27 28 22 54 77 6f 22 |ew Strin|g'("Two"|
|00003e80| 29 2c 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |),.. | |
|00003e90| 20 20 20 20 20 20 33 20 | 3d 3e 20 6e 65 77 20 53 | 3 |=> new S|
|00003ea0| 74 72 69 6e 67 27 28 22 | 54 68 72 65 65 22 29 0d |tring'("|Three").|
|00003eb0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00003ec0| 20 29 3b 0d 0a 0d 0a 0d | 0a 20 20 20 49 6e 20 41 | );.....|. In A|
|00003ed0| 64 61 20 39 35 2c 20 74 | 68 65 20 70 72 6f 63 65 |da 95, t|he proce|
|00003ee0| 73 73 20 69 73 20 73 69 | 6d 70 6c 69 66 69 65 64 |ss is si|mplified|
|00003ef0| 20 62 79 20 75 73 69 6e | 67 20 61 6c 69 61 73 65 | by usin|g aliase|
|00003f00| 64 20 63 6f 6e 73 74 61 | 6e 74 73 3a 0d 0a 0d 0a |d consta|nts:....|
|00003f10| 20 20 20 20 20 74 79 70 | 65 20 53 74 72 69 6e 67 | typ|e String|
|00003f20| 5f 41 63 63 65 73 73 20 | 69 73 0d 0a 20 20 20 20 |_Access |is.. |
|00003f30| 20 20 20 61 63 63 65 73 | 73 20 63 6f 6e 73 74 61 | acces|s consta|
|00003f40| 6e 74 20 53 74 72 69 6e | 67 3b 0d 0a 0d 0a 20 20 |nt Strin|g;.... |
|00003f50| 20 20 20 4f 6e 65 20 3a | 20 61 6c 69 61 73 65 64 | One :| aliased|
|00003f60| 20 63 6f 6e 73 74 61 6e | 74 20 53 74 72 69 6e 67 | constan|t String|
|00003f70| 20 3a 3d 20 22 4f 6e 65 | 22 3b 0d 0a 20 20 20 20 | := "One|";.. |
|00003f80| 20 54 77 6f 20 3a 20 61 | 6c 69 61 73 65 64 20 63 | Two : a|liased c|
|00003f90| 6f 6e 73 74 61 6e 74 20 | 53 74 72 69 6e 67 20 3a |onstant |String :|
|00003fa0| 3d 20 22 54 77 6f 22 3b | 0d 0a 20 20 20 20 20 54 |= "Two";|.. T|
|00003fb0| 68 72 65 65 20 3a 20 61 | 6c 69 61 73 65 64 20 63 |hree : a|liased c|
|00003fc0| 6f 6e 73 74 61 6e 74 20 | 53 74 72 69 6e 67 20 3a |onstant |String :|
|00003fd0| 3d 20 22 54 68 72 65 65 | 22 3b 0d 0a 0d 0a 20 20 |= "Three|";.... |
|00003fe0| 20 20 20 53 74 72 69 6e | 67 73 20 3a 20 63 6f 6e | Strin|gs : con|
|00003ff0| 73 74 61 6e 74 20 61 72 | 72 61 79 20 28 50 6f 73 |stant ar|ray (Pos|
|00004000| 69 74 69 76 65 20 72 61 | 6e 67 65 20 3c 3e 29 20 |itive ra|nge <>) |
|00004010| 6f 66 20 53 74 72 69 6e | 67 5f 41 63 63 65 73 73 |of Strin|g_Access|
|00004020| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 3a |.. | :|
|00004030| 3d 20 28 20 31 20 3d 3e | 20 4f 6e 65 27 41 63 63 |= ( 1 =>| One'Acc|
|00004040| 65 73 73 2c 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |ess,.. | |
|00004050| 20 20 20 20 20 20 20 20 | 32 20 3d 3e 20 54 77 6f | |2 => Two|
|00004060| 27 41 63 63 65 73 73 2c | 0d 0a 20 20 20 20 20 20 |'Access,|.. |
|00004070| 20 20 20 20 20 20 20 20 | 20 20 20 20 33 20 3d 3e | | 3 =>|
|00004080| 20 54 68 72 65 65 27 41 | 63 63 65 73 73 0d 0a 20 | Three'A|ccess.. |
|00004090| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 29 | | )|
|000040a0| 3b 0d 0a 0d 0a 0d 0a 33 | 2e 35 3a 20 49 20 6b 6e |;......3|.5: I kn|
|000040b0| 6f 77 20 61 6e 20 65 78 | 63 65 70 74 69 6f 6e 20 |ow an ex|ception |
|000040c0| 69 73 20 72 61 69 73 65 | 64 2c 20 62 75 74 20 6d |is raise|d, but m|
|000040d0| 79 20 70 72 6f 67 72 61 | 6d 20 71 75 69 74 73 20 |y progra|m quits |
|000040e0| 77 69 74 68 20 6e 6f 20 | 77 61 72 6e 69 6e 67 2e |with no |warning.|
|000040f0| 20 57 68 79 3f 0d 0a 0d | 0a 0d 0a 20 20 20 4f 6e | Why?...|... On|
|00004100| 20 73 6f 6d 65 20 41 64 | 61 20 63 6f 6d 70 69 6c | some Ad|a compil|
|00004110| 65 72 73 2c 20 79 6f 75 | 20 68 61 76 65 20 74 6f |ers, you| have to|
|00004120| 20 6d 61 6e 75 61 6c 6c | 79 20 22 77 69 74 68 22 | manuall|y "with"|
|00004130| 20 54 65 78 74 5f 49 4f | 20 62 65 66 6f 72 65 0d | Text_IO| before.|
|00004140| 0a 20 20 20 65 78 63 65 | 70 74 69 6f 6e 20 69 6e |. exce|ption in|
|00004150| 66 6f 72 6d 61 74 69 6f | 6e 20 69 73 20 64 69 70 |formatio|n is dip|
|00004160| 6c 61 79 65 64 20 74 6f | 20 74 68 65 20 74 65 72 |layed to| the ter|
|00004170| 6d 69 6e 61 6c 2e 0d 0a | 0d 0a 20 20 20 4f 6e 20 |minal...|.. On |
|00004180| 6f 74 68 65 72 20 41 64 | 61 20 63 6f 6d 70 69 6c |other Ad|a compil|
|00004190| 65 72 73 2c 20 79 6f 75 | 20 6d 75 73 74 20 73 65 |ers, you| must se|
|000041a0| 74 20 61 6e 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |t an env|ironment|
|000041b0| 20 76 61 72 69 61 62 6c | 65 20 66 6c 61 67 20 69 | variabl|e flag i|
|000041c0| 6e 0d 0a 20 20 20 6f 72 | 64 65 72 20 74 6f 20 63 |n.. or|der to c|
|000041d0| 61 75 73 65 20 74 68 65 | 20 65 78 63 65 70 74 69 |ause the| excepti|
|000041e0| 6f 6e 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 74 |on infor|mation t|
|000041f0| 72 61 63 65 20 74 6f 20 | 62 65 20 64 69 73 70 6c |race to |be displ|
|00004200| 61 79 65 64 2e 0d 0a 0d | 0a 0d 0a 33 2e 36 3a 20 |ayed....|...3.6: |
|00004210| 49 20 68 61 76 65 20 6f | 6e 6c 79 20 6f 6e 65 20 |I have o|nly one |
|00004220| 74 61 73 6b 20 69 6e 20 | 6d 79 20 70 72 6f 67 72 |task in |my progr|
|00004230| 61 6d 2c 20 62 75 74 20 | 69 74 20 64 6f 65 73 6e |am, but |it doesn|
|00004240| 27 74 20 73 65 65 6d 20 | 74 6f 20 72 75 6e 2e 20 |'t seem |to run. |
|00004250| 57 68 79 3f 0d 0a 0d 0a | 20 20 20 49 6e 20 41 64 |Why?....| In Ad|
|00004260| 61 2c 20 74 68 65 20 6d | 61 69 6e 20 70 72 6f 63 |a, the m|ain proc|
|00004270| 65 64 75 72 65 20 69 73 | 20 61 75 74 6f 6d 61 74 |edure is| automat|
|00004280| 69 63 61 6c 6c 79 20 64 | 65 73 69 67 6e 61 74 65 |ically d|esignate|
|00004290| 64 20 61 73 20 61 20 74 | 61 73 6b 2e 20 54 68 69 |d as a t|ask. Thi|
|000042a0| 73 0d 0a 20 20 20 74 61 | 73 6b 20 6d 61 79 20 62 |s.. ta|sk may b|
|000042b0| 65 20 72 75 6e 6e 69 6e | 67 20 66 6f 72 65 76 65 |e runnin|g foreve|
|000042c0| 72 2c 20 74 68 75 73 20 | 73 74 61 72 76 69 6e 67 |r, thus |starving|
|000042d0| 20 79 6f 75 72 20 6f 74 | 68 65 72 20 74 61 73 6b | your ot|her task|
|000042e0| 28 73 29 2c 20 62 65 63 | 61 75 73 65 0d 0a 20 20 |(s), bec|ause.. |
|000042f0| 20 72 6f 75 6e 64 2d 72 | 6f 62 69 6e 20 73 63 68 | round-r|obin sch|
|00004300| 65 64 75 6c 69 6e 67 20 | 28 74 69 6d 65 2d 73 6c |eduling |(time-sl|
|00004310| 69 63 69 6e 67 29 20 69 | 73 20 6e 6f 74 20 72 65 |icing) i|s not re|
|00004320| 71 75 69 72 65 64 20 28 | 70 72 65 2d 65 6d 70 74 |quired (|pre-empt|
|00004330| 69 76 65 0d 0a 20 20 20 | 73 63 68 65 64 75 6c 69 |ive.. |scheduli|
|00004340| 6e 67 20 61 70 70 6c 69 | 65 73 20 74 6f 20 74 61 |ng appli|es to ta|
|00004350| 73 6b 73 20 77 69 74 68 | 20 64 69 66 66 65 72 65 |sks with| differe|
|00004360| 6e 74 20 6c 65 76 65 6c | 73 20 6f 66 20 70 72 69 |nt level|s of pri|
|00004370| 6f 72 69 74 79 29 2e 0d | 0a 0d 0a 20 20 20 49 66 |ority)..|... If|
|00004380| 20 74 68 65 20 74 61 73 | 6b 20 69 6e 20 71 75 65 | the tas|k in que|
|00004390| 73 74 69 6f 6e 20 69 73 | 20 67 65 74 74 69 6e 67 |stion is| getting|
|000043a0| 20 73 74 61 72 76 65 64 | 2c 20 69 74 27 73 20 61 | starved|, it's a|
|000043b0| 20 70 72 6f 67 72 61 6d | 6d 65 72 20 70 72 6f 62 | program|mer prob|
|000043c0| 6c 65 6d 2c 0d 0a 20 20 | 20 6e 6f 74 20 61 6e 20 |lem,.. | not an |
|000043d0| 41 64 61 20 70 72 6f 62 | 6c 65 6d 2e 20 54 68 65 |Ada prob|lem. The|
|000043e0| 20 70 72 6f 67 72 61 6d | 6d 65 72 20 68 61 73 20 | program|mer has |
|000043f0| 74 6f 20 75 73 65 20 61 | 6e 20 41 64 61 20 63 6f |to use a|n Ada co|
|00004400| 6d 70 69 6c 65 72 20 74 | 68 61 74 0d 0a 20 20 20 |mpiler t|hat.. |
|00004410| 73 75 70 70 6f 72 74 73 | 20 70 72 61 67 6d 61 20 |supports| pragma |
|00004420| 54 69 6d 65 5f 53 6c 69 | 63 65 2c 20 6f 72 20 64 |Time_Sli|ce, or d|
|00004430| 6f 20 74 68 65 20 73 63 | 68 65 64 75 6c 69 6e 67 |o the sc|heduling|
|00004440| 20 68 69 6d 73 65 6c 66 | 20 28 62 79 20 63 68 61 | himself| (by cha|
|00004450| 6e 67 69 6e 67 0d 0a 20 | 20 20 74 68 65 20 69 6d |nging.. | the im|
|00004460| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 6f 66 20 |plementa|tion of |
|00004470| 68 69 73 20 41 64 61 20 | 70 72 6f 67 72 61 6d 20 |his Ada |program |
|00004480| 74 6f 20 65 6e 73 75 72 | 65 20 74 68 61 74 20 6e |to ensur|e that n|
|00004490| 6f 20 74 61 73 6b 20 73 | 74 61 72 76 65 73 0d 0a |o task s|tarves..|
|000044a0| 20 20 20 61 6e 6f 74 68 | 65 72 29 2e 0d 0a 0d 0a | anoth|er).....|
|000044b0| 20 20 20 4f 6e 65 20 73 | 6f 6c 75 74 69 6f 6e 20 | One s|olution |
|000044c0| 69 73 20 74 6f 20 65 78 | 70 6c 69 63 69 74 6c 79 |is to ex|plicitly|
|000044d0| 20 70 75 74 20 74 68 65 | 20 6d 61 69 6e 20 74 61 | put the| main ta|
|000044e0| 73 6b 20 74 6f 20 73 6c | 65 65 70 20 77 69 74 68 |sk to sl|eep with|
|000044f0| 69 6e 20 61 20 6c 6f 6f | 70 0d 0a 20 20 20 63 6f |in a loo|p.. co|
|00004500| 6e 73 74 72 75 63 74 20 | 69 6e 20 6f 72 64 65 72 |nstruct |in order|
|00004510| 20 74 6f 20 61 76 6f 69 | 64 20 73 74 61 72 76 61 | to avoi|d starva|
|00004520| 74 69 6f 6e 20 6f 66 20 | 74 68 65 20 6f 74 68 65 |tion of |the othe|
|00004530| 72 20 74 61 73 6b 28 73 | 29 2c 20 61 73 20 69 6e |r task(s|), as in|
|00004540| 3a 0d 0a 0d 0a 20 20 20 | 20 20 70 72 6f 63 65 64 |:.... | proced|
|00004550| 75 72 65 20 4d 61 69 6e | 20 69 73 0d 0a 20 20 20 |ure Main| is.. |
|00004560| 20 20 20 20 74 61 73 6b | 20 54 65 73 74 3b 0d 0a | task| Test;..|
|00004570| 20 20 20 20 20 20 20 74 | 61 73 6b 20 62 6f 64 79 | t|ask body|
|00004580| 20 54 65 73 74 20 69 73 | 0d 0a 20 20 20 20 20 20 | Test is|.. |
|00004590| 20 62 65 67 69 6e 0d 0a | 20 20 20 20 20 20 20 20 | begin..| |
|000045a0| 20 6c 6f 6f 70 0d 0a 20 | 20 20 20 20 20 20 20 20 | loop.. | |
|000045b0| 20 20 64 65 6c 61 79 20 | 31 2e 30 3b 0d 0a 20 20 | delay |1.0;.. |
|000045c0| 20 20 20 20 20 20 20 20 | 20 54 65 78 74 5f 49 4f | | Text_IO|
|000045d0| 2e 50 75 74 5f 4c 69 6e | 65 20 28 22 54 65 73 74 |.Put_Lin|e ("Test|
|000045e0| 22 29 3b 0d 0a 20 20 20 | 20 20 20 20 20 20 65 6e |");.. | en|
|000045f0| 64 20 6c 6f 6f 70 3b 0d | 0a 20 20 20 20 20 20 20 |d loop;.|. |
|00004600| 65 6e 64 20 54 65 73 74 | 3b 0d 0a 20 20 20 20 20 |end Test|;.. |
|00004610| 62 65 67 69 6e 0d 0a 20 | 20 20 20 20 20 20 6c 6f |begin.. | lo|
|00004620| 6f 70 0d 0a 20 20 20 20 | 20 20 20 20 20 64 65 6c |op.. | del|
|00004630| 61 79 20 32 30 2e 30 3b | 0d 0a 20 20 20 20 20 20 |ay 20.0;|.. |
|00004640| 20 20 20 54 65 78 74 5f | 49 4f 2e 50 75 74 5f 4c | Text_|IO.Put_L|
|00004650| 69 6e 65 20 28 22 53 6c | 65 65 70 69 6e 67 20 74 |ine ("Sl|eeping t|
|00004660| 68 65 6e 20 77 72 69 74 | 69 6e 67 22 29 3b 0d 0a |hen writ|ing");..|
|00004670| 20 20 20 20 20 20 20 65 | 6e 64 20 6c 6f 6f 70 3b | e|nd loop;|
|00004680| 0d 0a 20 20 20 20 20 65 | 6e 64 20 4d 61 69 6e 3b |.. e|nd Main;|
|00004690| 0d 0a 0d 0a 0d 0a 33 2e | 37 3a 20 48 6f 77 20 64 |......3.|7: How d|
|000046a0| 6f 20 49 20 69 6e 63 72 | 65 61 73 65 20 74 68 65 |o I incr|ease the|
|000046b0| 20 73 74 61 63 6b 20 73 | 69 7a 65 20 66 6f 72 20 | stack s|ize for |
|000046c0| 61 20 74 61 73 6b 3f 0d | 0a 0d 0a 20 20 20 44 65 |a task?.|... De|
|000046d0| 66 69 6e 65 20 74 68 65 | 20 74 61 73 6b 20 61 73 |fine the| task as|
|000046e0| 20 61 20 22 74 61 73 6b | 20 74 79 70 65 22 20 61 | a "task| type" a|
|000046f0| 6e 64 20 74 68 65 6e 20 | 75 73 65 20 61 20 70 72 |nd then |use a pr|
|00004700| 61 67 6d 61 20 72 65 70 | 72 65 73 65 6e 74 61 74 |agma rep|resentat|
|00004710| 69 6f 6e 0d 0a 20 20 20 | 63 6c 61 75 73 65 2e 0d |ion.. |clause..|
|00004720| 0a 0d 0a 20 20 20 20 20 | 74 61 73 6b 20 74 79 70 |... |task typ|
|00004730| 65 20 41 5f 54 61 73 6b | 5f 54 79 70 65 3b 0d 0a |e A_Task|_Type;..|
|00004740| 20 20 20 20 20 66 6f 72 | 20 41 5f 54 61 73 6b 5f | for| A_Task_|
|00004750| 54 79 70 65 27 53 54 4f | 52 41 47 45 5f 53 49 5a |Type'STO|RAGE_SIZ|
|00004760| 45 20 75 73 65 20 31 30 | 5f 30 30 30 3b 0d 0a 20 |E use 10|_000;.. |
|00004770| 20 20 20 20 2d 2d 20 31 | 30 4b 20 62 79 74 65 73 | -- 1|0K bytes|
|00004780| 20 61 6c 6c 6f 63 61 74 | 65 64 20 74 6f 20 69 6e | allocat|ed to in|
|00004790| 73 74 61 6e 63 65 73 20 | 6f 66 20 41 5f 54 61 73 |stances |of A_Tas|
|000047a0| 6b 5f 54 79 70 65 0d 0a | 20 20 20 20 20 41 5f 54 |k_Type..| A_T|
|000047b0| 61 73 6b 20 3a 20 41 5f | 54 61 73 6b 5f 54 79 70 |ask : A_|Task_Typ|
|000047c0| 65 3b 0d 0a 0d 0a 0d 0a | 33 2e 38 3a 20 57 68 61 |e;......|3.8: Wha|
|000047d0| 74 27 73 20 74 68 65 20 | 64 69 66 66 65 72 65 6e |t's the |differen|
|000047e0| 63 65 20 62 65 74 77 65 | 65 6e 20 61 20 74 79 70 |ce betwe|en a typ|
|000047f0| 65 20 63 6f 6e 76 65 72 | 73 69 6f 6e 20 61 6e 64 |e conver|sion and|
|00004800| 20 61 20 71 75 61 6c 69 | 66 69 65 72 3f 0d 0a 0d | a quali|fier?...|
|00004810| 0a 20 20 20 55 73 65 20 | 61 20 71 75 61 6c 69 66 |. Use |a qualif|
|00004820| 69 65 72 20 28 74 69 63 | 6b 29 20 74 6f 20 74 65 |ier (tic|k) to te|
|00004830| 6c 6c 20 74 68 65 20 63 | 6f 6d 70 69 6c 65 72 20 |ll the c|ompiler |
|00004840| 77 68 61 74 20 74 79 70 | 65 20 69 74 20 63 61 6e |what typ|e it can|
|00004850| 20 65 78 70 65 63 74 3b | 0d 0a 20 20 20 74 68 69 | expect;|.. thi|
|00004860| 73 20 69 73 20 73 74 72 | 69 63 74 6c 79 20 61 20 |s is str|ictly a |
|00004870| 63 6f 6d 70 69 6c 65 2d | 74 69 6d 65 20 69 73 73 |compile-|time iss|
|00004880| 75 65 3a 20 61 20 71 75 | 61 6c 69 66 69 65 72 20 |ue: a qu|alifier |
|00004890| 22 68 69 6e 74 73 22 20 | 74 68 65 20 74 79 70 65 |"hints" |the type|
|000048a0| 2c 0d 0a 20 20 20 75 73 | 75 61 6c 6c 79 20 74 6f |,.. us|ually to|
|000048b0| 20 72 65 6d 6f 76 65 20 | 61 6e 20 61 6d 62 69 67 | remove |an ambig|
|000048c0| 75 69 74 79 2e 20 55 73 | 65 20 61 20 63 6f 6e 76 |uity. Us|e a conv|
|000048d0| 65 72 73 69 6f 6e 20 74 | 6f 20 74 65 6c 6c 20 74 |ersion t|o tell t|
|000048e0| 68 65 20 63 6f 6d 70 69 | 6c 65 72 0d 0a 20 20 20 |he compi|ler.. |
|000048f0| 74 6f 20 63 6f 6e 76 65 | 72 74 20 61 6e 20 65 78 |to conve|rt an ex|
|00004900| 70 72 65 73 73 69 6f 6e | 20 66 72 6f 6d 20 6f 6e |pression| from on|
|00004910| 65 20 74 79 70 65 20 74 | 6f 20 61 6e 6f 74 68 65 |e type t|o anothe|
|00004920| 72 20 28 75 73 75 61 6c | 6c 79 20 77 69 74 68 69 |r (usual|ly withi|
|00004930| 6e 20 6f 6e 65 0d 0a 20 | 20 20 64 65 72 69 76 61 |n one.. | deriva|
|00004940| 74 69 6f 6e 20 68 69 65 | 72 61 72 63 68 79 29 3b |tion hie|rarchy);|
|00004950| 20 74 68 69 73 20 6f 70 | 65 72 61 74 69 6f 6e 20 | this op|eration |
|00004960| 6d 61 79 20 72 65 71 75 | 69 72 65 20 61 20 63 68 |may requ|ire a ch|
|00004970| 61 6e 67 65 20 6f 66 0d | 0a 20 20 20 72 65 70 72 |ange of.|. repr|
|00004980| 65 73 65 6e 74 61 74 69 | 6f 6e 20 61 74 20 72 75 |esentati|on at ru|
|00004990| 6e 2d 74 69 6d 65 20 28 | 65 2e 67 2e 20 69 6e 20 |n-time (|e.g. in |
|000049a0| 63 61 73 65 20 6f 66 20 | 61 20 72 65 70 72 65 73 |case of |a repres|
|000049b0| 65 6e 74 61 74 69 6f 6e | 20 63 6c 61 75 73 65 0d |entation| clause.|
|000049c0| 0a 20 20 20 61 70 70 6c | 79 69 6e 67 20 65 78 63 |. appl|ying exc|
|000049d0| 6c 75 73 69 76 65 6c 79 | 20 74 6f 20 74 68 65 20 |lusively| to the |
|000049e0| 73 6f 75 72 63 65 20 74 | 79 70 65 29 2e 0d 0a 0d |source t|ype)....|
|000049f0| 0a 20 20 20 20 20 41 20 | 3a 20 49 6e 74 65 67 65 |. A |: Intege|
|00004a00| 72 20 3a 3d 20 49 6e 74 | 65 67 65 72 27 28 31 29 |r := Int|eger'(1)|
|00004a10| 3b 20 20 2d 2d 20 74 68 | 69 73 20 69 73 20 61 20 |; -- th|is is a |
|00004a20| 71 75 61 6c 69 66 69 65 | 72 3a 20 73 61 6d 65 20 |qualifie|r: same |
|00004a30| 61 73 20 22 3a 3d 20 31 | 3b 22 0d 0a 20 20 20 20 |as ":= 1|;".. |
|00004a40| 20 42 20 3a 20 49 6e 74 | 65 67 65 72 20 3a 3d 20 | B : Int|eger := |
|00004a50| 49 6e 74 65 67 65 72 20 | 28 31 29 3b 20 20 2d 2d |Integer |(1); --|
|00004a60| 20 74 68 69 73 20 69 73 | 20 61 20 63 6f 6e 76 65 | this is| a conve|
|00004a70| 72 73 69 6f 6e 0d 0a 0d | 0a 0d 0a 33 2e 39 3a 20 |rsion...|...3.9: |
|00004a80| 48 6f 77 20 64 6f 20 49 | 20 61 76 6f 69 64 20 74 |How do I| avoid t|
|00004a90| 68 65 20 70 6f 74 65 6e | 74 69 61 6c 20 73 70 61 |he poten|tial spa|
|00004aa0| 63 65 20 69 6e 20 66 72 | 6f 6e 74 20 6f 66 20 49 |ce in fr|ont of I|
|00004ab0| 6e 74 65 67 65 72 27 49 | 6d 61 67 65 3f 0d 0a 0d |nteger'I|mage?...|
|00004ac0| 0a 20 20 20 55 73 65 20 | 74 68 65 20 66 75 6e 63 |. Use |the func|
|00004ad0| 74 69 6f 6e 20 54 72 69 | 6d 20 66 72 6f 6d 20 70 |tion Tri|m from p|
|00004ae0| 61 63 6b 61 67 65 20 41 | 64 61 2e 53 74 72 69 6e |ackage A|da.Strin|
|00004af0| 67 73 2e 46 69 78 65 64 | 20 28 79 6f 75 20 63 61 |gs.Fixed| (you ca|
|00004b00| 6e 0d 0a 20 20 20 61 63 | 74 75 61 6c 6c 79 20 74 |n.. ac|tually t|
|00004b10| 72 69 6d 20 73 74 72 69 | 6e 67 73 20 69 6e 20 6d |rim stri|ngs in m|
|00004b20| 61 6e 79 20 6f 74 68 65 | 72 20 75 73 65 66 75 6c |any othe|r useful|
|00004b30| 20 77 61 79 73 29 3a 0d | 0a 0d 0a 20 20 20 20 20 | ways):.|... |
|00004b40| 66 75 6e 63 74 69 6f 6e | 20 4d 79 5f 49 6d 61 67 |function| My_Imag|
|00004b50| 65 20 28 49 20 3a 20 49 | 6e 74 65 67 65 72 29 0d |e (I : I|nteger).|
|00004b60| 0a 20 20 20 20 20 20 20 | 72 65 74 75 72 6e 20 53 |. |return S|
|00004b70| 74 72 69 6e 67 20 69 73 | 0d 0a 20 20 20 20 20 62 |tring is|.. b|
|00004b80| 65 67 69 6e 20 2d 2d 20 | 4d 79 5f 49 6d 61 67 65 |egin -- |My_Image|
|00004b90| 0d 0a 20 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 |.. | return |
|00004ba0| 41 64 61 2e 53 74 72 69 | 6e 67 73 2e 46 69 78 65 |Ada.Stri|ngs.Fixe|
|00004bb0| 64 2e 54 72 69 6d 20 28 | 49 6e 74 65 67 65 72 27 |d.Trim (|Integer'|
|00004bc0| 49 6d 61 67 65 20 28 49 | 29 2c 20 41 64 61 2e 53 |Image (I|), Ada.S|
|00004bd0| 74 72 69 6e 67 73 2e 4c | 65 66 74 29 3b 0d 0a 20 |trings.L|eft);.. |
|00004be0| 20 20 20 20 65 6e 64 20 | 4d 79 5f 49 6d 61 67 65 | end |My_Image|
|00004bf0| 3b 0d 0a 0d 0a 20 20 20 | 20 20 2e 2e 2e 20 4d 79 |;.... | ... My|
|00004c00| 5f 49 6d 61 67 65 20 28 | 31 32 29 20 3d 20 22 31 |_Image (|12) = "1|
|00004c10| 32 22 20 2e 2e 2e 0d 0a | 0d 0a 0d 0a 20 20 20 49 |2" .....|.... I|
|00004c20| 6e 20 41 64 61 20 38 33 | 2c 20 63 6f 64 65 20 61 |n Ada 83|, code a|
|00004c30| 20 66 75 6e 63 74 69 6f | 6e 20 74 68 61 74 20 61 | functio|n that a|
|00004c40| 63 63 65 70 74 73 20 61 | 20 73 74 72 69 6e 67 20 |ccepts a| string |
|00004c50| 61 6e 64 20 73 74 72 69 | 70 73 20 74 68 65 0d 0a |and stri|ps the..|
|00004c60| 20 20 20 6c 65 61 64 69 | 6e 67 20 62 6c 61 6e 6b | leadi|ng blank|
|00004c70| 3a 0d 0a 0d 0a 20 20 20 | 20 20 66 75 6e 63 74 69 |:.... | functi|
|00004c80| 6f 6e 20 53 74 72 69 70 | 5f 4c 65 61 64 69 6e 67 |on Strip|_Leading|
|00004c90| 5f 42 6c 61 6e 6b 20 28 | 53 74 72 20 3a 20 53 74 |_Blank (|Str : St|
|00004ca0| 72 69 6e 67 29 0d 0a 20 | 20 20 20 20 20 20 72 65 |ring).. | re|
|00004cb0| 74 75 72 6e 20 53 74 72 | 69 6e 67 20 69 73 0d 0a |turn Str|ing is..|
|00004cc0| 20 20 20 20 20 62 65 67 | 69 6e 20 2d 2d 20 53 74 | beg|in -- St|
|00004cd0| 72 69 70 5f 4c 65 61 64 | 69 6e 67 5f 42 6c 61 6e |rip_Lead|ing_Blan|
|00004ce0| 6b 0d 0a 20 20 20 20 20 | 20 20 69 66 20 53 74 72 |k.. | if Str|
|00004cf0| 20 28 53 74 72 27 46 69 | 72 73 74 29 20 3d 20 27 | (Str'Fi|rst) = '|
|00004d00| 20 27 20 74 68 65 6e 0d | 0a 20 20 20 20 20 20 20 | ' then.|. |
|00004d10| 20 20 72 65 74 75 72 6e | 20 53 74 72 20 28 31 2b | return| Str (1+|
|00004d20| 53 74 72 27 46 69 72 73 | 74 20 2e 2e 20 53 74 72 |Str'Firs|t .. Str|
|00004d30| 27 4c 61 73 74 29 3b 0d | 0a 20 20 20 20 20 20 20 |'Last);.|. |
|00004d40| 65 6c 73 65 0d 0a 20 20 | 20 20 20 20 20 20 20 72 |else.. | r|
|00004d50| 65 74 75 72 6e 20 53 74 | 72 3b 0d 0a 20 20 20 20 |eturn St|r;.. |
|00004d60| 20 20 20 65 6e 64 20 69 | 66 3b 0d 0a 20 20 20 20 | end i|f;.. |
|00004d70| 20 65 6e 64 20 53 74 72 | 69 70 5f 4c 65 61 64 69 | end Str|ip_Leadi|
|00004d80| 6e 67 5f 42 6c 61 6e 6b | 3b 0d 0a 0d 0a 20 20 20 |ng_Blank|;.... |
|00004d90| 20 20 2e 2e 2e 0d 0a 0d | 0a 20 20 20 20 20 66 75 | ......|. fu|
|00004da0| 6e 63 74 69 6f 6e 20 4d | 79 5f 49 6d 61 67 65 20 |nction M|y_Image |
|00004db0| 28 49 20 3a 20 49 6e 74 | 65 67 65 72 29 0d 0a 20 |(I : Int|eger).. |
|00004dc0| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 53 74 72 | re|turn Str|
|00004dd0| 69 6e 67 20 69 73 0d 0a | 20 20 20 20 20 62 65 67 |ing is..| beg|
|00004de0| 69 6e 20 2d 2d 20 4d 79 | 5f 49 6d 61 67 65 0d 0a |in -- My|_Image..|
|00004df0| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 53 74 | r|eturn St|
|00004e00| 72 69 70 5f 4c 65 61 64 | 69 6e 67 5f 42 6c 61 6e |rip_Lead|ing_Blan|
|00004e10| 6b 20 28 49 6e 74 65 67 | 65 72 27 49 6d 61 67 65 |k (Integ|er'Image|
|00004e20| 20 28 49 29 29 3b 0d 0a | 20 20 20 20 20 65 6e 64 | (I));..| end|
|00004e30| 20 4d 79 5f 49 6d 61 67 | 65 3b 0d 0a 0d 0a 20 20 | My_Imag|e;.... |
|00004e40| 20 20 20 2e 2e 2e 20 4d | 79 5f 49 6d 61 67 65 20 | ... M|y_Image |
|00004e50| 28 31 32 29 20 3d 20 22 | 31 32 22 20 2e 2e 2e 0d |(12) = "|12" ....|
|00004e60| 0a 0d 0a 0d 0a 33 2e 31 | 30 3a 20 57 68 79 20 69 |.....3.1|0: Why i|
|00004e70| 73 20 61 6e 20 65 78 63 | 65 70 74 69 6f 6e 20 72 |s an exc|eption r|
|00004e80| 61 69 73 65 64 20 77 68 | 65 6e 20 67 69 76 69 6e |aised wh|en givin|
|00004e90| 67 20 61 20 64 65 66 61 | 75 6c 74 20 64 69 73 63 |g a defa|ult disc|
|00004ea0| 72 69 6d 69 6e 61 6e 74 | 3f 0d 0a 0d 0a 20 20 20 |riminant|?.... |
|00004eb0| 4c 65 74 27 73 20 61 73 | 73 75 6d 65 20 79 6f 75 |Let's as|sume you|
|00004ec0| 20 77 6f 75 6c 64 20 6c | 69 6b 65 20 74 6f 20 6d | would l|ike to m|
|00004ed0| 6f 64 65 6c 20 76 61 72 | 79 69 6e 67 2d 6c 65 6e |odel var|ying-len|
|00004ee0| 67 74 68 20 73 74 72 69 | 6e 67 73 3a 0d 0a 0d 0a |gth stri|ngs:....|
|00004ef0| 20 20 20 20 20 74 79 70 | 65 20 56 5f 53 74 72 69 | typ|e V_Stri|
|00004f00| 6e 67 20 28 53 69 7a 65 | 20 3a 20 4e 61 74 75 72 |ng (Size| : Natur|
|00004f10| 61 6c 20 3a 3d 20 30 29 | 20 69 73 0d 0a 20 20 20 |al := 0)| is.. |
|00004f20| 20 20 20 20 72 65 63 6f | 72 64 0d 0a 20 20 20 20 | reco|rd.. |
|00004f30| 20 20 20 20 20 53 20 3a | 20 53 74 72 69 6e 67 20 | S :| String |
|00004f40| 28 31 20 2e 2e 20 53 69 | 7a 65 29 3b 0d 0a 20 20 |(1 .. Si|ze);.. |
|00004f50| 20 20 20 20 20 65 6e 64 | 20 72 65 63 6f 72 64 3b | end| record;|
|00004f60| 0d 0a 0d 0a 0d 0a 20 20 | 20 28 66 72 6f 6d 20 52 |...... | (from R|
|00004f70| 6f 62 65 72 74 20 44 65 | 77 61 72 29 0d 0a 0d 0a |obert De|war)....|
|00004f80| 20 20 20 57 68 65 6e 20 | 79 6f 75 20 67 69 76 65 | When |you give|
|00004f90| 20 61 20 64 65 66 61 75 | 6c 74 20 64 69 73 63 72 | a defau|lt discr|
|00004fa0| 69 6d 69 6e 61 6e 74 2c | 20 74 68 65 6e 20 6f 6e |iminant,| then on|
|00004fb0| 65 20 6d 65 74 68 6f 64 | 20 28 49 20 61 63 74 75 |e method| (I actu|
|00004fc0| 61 6c 6c 79 0d 0a 20 20 | 20 74 68 69 6e 6b 20 69 |ally.. | think i|
|00004fd0| 74 20 69 73 20 74 68 65 | 20 70 72 65 66 65 72 72 |t is the| preferr|
|00004fe0| 65 64 20 6d 65 74 68 6f | 64 29 20 6f 66 20 69 6d |ed metho|d) of im|
|00004ff0| 70 6c 65 6d 65 6e 74 61 | 74 69 6f 6e 20 69 73 20 |plementa|tion is |
|00005000| 74 6f 20 61 6c 6c 6f 63 | 61 74 65 20 74 68 65 0d |to alloc|ate the.|
|00005010| 0a 20 20 20 6d 61 78 69 | 6d 75 6d 20 70 6f 73 73 |. maxi|mum poss|
|00005020| 69 62 6c 65 20 6c 65 6e | 67 74 68 2e 20 53 69 6e |ible len|gth. Sin|
|00005030| 63 65 20 79 6f 75 72 20 | 64 69 73 63 72 69 6d 69 |ce your |discrimi|
|00005040| 6e 61 6e 74 20 69 73 20 | 6f 66 20 74 79 70 65 20 |nant is |of type |
|00005050| 4e 61 74 75 72 61 6c 2c | 0d 0a 20 20 20 74 68 69 |Natural,|.. thi|
|00005060| 73 20 63 6c 65 61 72 6c | 79 20 77 6f 6e 27 74 20 |s clearl|y won't |
|00005070| 77 6f 72 6b 21 0d 0a 0d | 0a 20 20 20 47 4e 41 54 |work!...|. GNAT|
|00005080| 20 6d 61 79 20 63 6f 6d | 70 69 6c 65 20 69 74 2c | may com|pile it,|
|00005090| 20 62 75 74 20 69 74 20 | 77 6f 6e 27 74 20 72 75 | but it |won't ru|
|000050a0| 6e 20 69 74 2c 20 61 6e | 64 20 69 6e 64 65 65 64 |n it, an|d indeed|
|000050b0| 20 49 20 63 6f 6e 73 69 | 64 65 72 20 69 74 20 61 | I consi|der it a|
|000050c0| 0d 0a 20 20 20 47 4e 41 | 54 20 62 75 67 20 28 6f |.. GNA|T bug (o|
|000050d0| 6e 20 74 68 65 20 74 6f | 64 6f 20 6c 69 73 74 29 |n the to|do list)|
|000050e0| 20 74 68 61 74 20 6e 6f | 20 77 61 72 6e 69 6e 67 | that no| warning|
|000050f0| 20 69 73 20 69 73 73 75 | 65 64 20 61 74 20 63 6f | is issu|ed at co|
|00005100| 6d 70 69 6c 65 20 74 69 | 6d 65 0d 0a 20 20 20 66 |mpile ti|me.. f|
|00005110| 6f 72 20 74 68 69 73 20 | 6d 69 73 75 73 65 2e 0d |or this |misuse..|
|00005120| 0a 0d 0a 20 20 20 53 6f | 6d 65 20 63 6f 6d 70 69 |... So|me compi|
|00005130| 6c 65 72 73 2c 20 6e 6f | 74 61 62 6c 79 20 41 6c |lers, no|tably Al|
|00005140| 73 79 73 20 61 6e 64 20 | 52 52 2c 20 68 61 76 65 |sys and |RR, have|
|00005150| 20 61 74 20 6c 65 61 73 | 74 20 70 61 72 74 69 61 | at leas|t partia|
|00005160| 6c 6c 79 20 22 73 6f 6c | 76 65 64 22 0d 0a 20 20 |lly "sol|ved".. |
|00005170| 20 74 68 69 73 20 70 72 | 6f 62 6c 65 6d 20 62 79 | this pr|oblem by|
|00005180| 20 69 6e 74 72 6f 64 75 | 63 69 6e 67 20 68 69 64 | introdu|cing hid|
|00005190| 64 65 6e 20 70 6f 69 6e | 74 65 72 73 2c 20 62 75 |den poin|ters, bu|
|000051a0| 74 20 74 68 69 73 20 74 | 6f 20 6d 65 20 69 73 20 |t this t|o me is |
|000051b0| 61 6e 0d 0a 20 20 20 75 | 6e 64 65 73 69 72 61 62 |an.. u|ndesirab|
|000051c0| 6c 65 20 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |le imple|mentatio|
|000051d0| 6e 20 63 68 6f 69 63 65 | 2e 0d 0a 0d 0a 20 20 20 |n choice|..... |
|000051e0| 46 69 72 73 74 2c 20 69 | 74 20 6d 65 61 6e 73 20 |First, i|t means |
|000051f0| 74 68 65 72 65 20 69 73 | 20 68 69 64 64 65 6e 20 |there is| hidden |
|00005200| 68 65 61 70 20 61 63 74 | 69 76 69 74 79 2c 20 77 |heap act|ivity, w|
|00005210| 68 69 63 68 20 73 65 65 | 6d 73 0d 0a 20 20 20 75 |hich see|ms.. u|
|00005220| 6e 64 65 73 69 72 61 62 | 6c 65 2e 20 49 6e 20 61 |ndesirab|le. In a|
|00005230| 20 6c 61 6e 67 75 61 67 | 65 20 77 68 65 72 65 20 | languag|e where |
|00005240| 70 6f 69 6e 74 65 72 73 | 20 61 72 65 20 65 78 70 |pointers| are exp|
|00005250| 6c 69 63 69 74 2c 20 69 | 74 20 69 73 0d 0a 20 20 |licit, i|t is.. |
|00005260| 20 67 65 6e 65 72 61 6c | 6c 79 20 61 20 67 6f 6f | general|ly a goo|
|00005270| 64 20 69 64 65 61 20 69 | 66 20 61 6c 6c 6f 63 61 |d idea i|f alloca|
|00005280| 74 69 6f 6e 20 69 73 20 | 61 6c 73 6f 20 65 78 70 |tion is |also exp|
|00005290| 6c 69 63 69 74 2c 20 61 | 6e 64 20 63 65 72 74 61 |licit, a|nd certa|
|000052a0| 69 6e 6c 79 0d 0a 20 20 | 20 66 6f 72 20 72 65 61 |inly.. | for rea|
|000052b0| 6c 2d 74 69 6d 65 20 77 | 6f 72 6b 2c 20 68 69 64 |l-time w|ork, hid|
|000052c0| 64 65 6e 20 61 6e 79 74 | 68 69 6e 67 20 69 73 20 |den anyt|hing is |
|000052d0| 77 6f 72 72 69 73 6f 6d | 65 2e 0d 0a 0d 0a 20 20 |worrisom|e..... |
|000052e0| 20 53 65 63 6f 6e 64 2c | 20 69 74 20 69 73 20 6e | Second,| it is n|
|000052f0| 6f 74 20 65 61 73 79 20 | 74 6f 20 64 6f 20 75 6e |ot easy |to do un|
|00005300| 69 66 6f 72 6d 6c 79 2e | 20 41 6c 73 79 73 20 65 |iformly.| Alsys e|
|00005310| 6e 64 73 20 75 70 20 69 | 6e 74 72 6f 64 75 63 69 |nds up i|ntroduci|
|00005320| 6e 67 0d 0a 20 20 20 61 | 72 62 69 74 72 61 72 79 |ng.. a|rbitrary|
|00005330| 20 72 65 73 74 72 69 63 | 74 69 6f 6e 73 20 6f 6e | restric|tions on|
|00005340| 20 74 68 65 20 63 6f 6d | 70 6f 73 69 74 69 6f 6e | the com|position|
|00005350| 20 6f 66 20 73 75 63 68 | 20 74 79 70 65 73 20 28 | of such| types (|
|00005360| 74 72 79 20 6d 61 6b 69 | 6e 67 20 61 6e 0d 0a 20 |try maki|ng an.. |
|00005370| 20 20 61 72 72 61 79 20 | 6f 66 20 74 68 65 6d 29 | array |of them)|
|00005380| 2c 20 61 6e 64 20 52 52 | 20 69 6e 74 72 6f 64 75 |, and RR| introdu|
|00005390| 63 65 73 20 6e 6f 6e 2d | 63 6f 6e 74 69 67 75 6f |ces non-|contiguo|
|000053a0| 75 73 20 72 65 70 72 65 | 73 65 6e 74 61 74 69 6f |us repre|sentatio|
|000053b0| 6e 73 2c 0d 0a 20 20 20 | 77 68 69 63 68 20 61 72 |ns,.. |which ar|
|000053c0| 65 20 6c 65 67 61 6c 20 | 62 75 74 20 74 72 6f 75 |e legal |but trou|
|000053d0| 62 6c 65 73 6f 6d 65 2e | 0d 0a 0d 0a 20 20 20 54 |blesome.|.... T|
|000053e0| 6f 20 22 73 6f 6c 76 65 | 22 20 74 68 65 20 70 72 |o "solve|" the pr|
|000053f0| 6f 62 6c 65 6d 20 79 6f | 75 72 73 65 6c 66 2c 20 |oblem yo|urself, |
|00005400| 6a 75 73 74 20 64 65 63 | 6c 61 72 65 20 61 20 72 |just dec|lare a r|
|00005410| 65 61 73 6f 6e 61 62 6c | 65 20 6d 61 78 69 6d 75 |easonabl|e maximu|
|00005420| 6d 0d 0a 20 20 20 6c 65 | 6e 67 74 68 2c 20 61 6e |m.. le|ngth, an|
|00005430| 64 20 75 73 65 20 61 20 | 73 75 62 74 79 70 65 20 |d use a |subtype |
|00005440| 72 65 70 72 65 73 65 6e | 74 69 6e 67 20 74 68 69 |represen|ting thi|
|00005450| 73 20 6c 65 6e 67 74 68 | 20 61 73 20 74 68 65 20 |s length| as the |
|00005460| 73 75 62 74 79 70 65 20 | 6f 66 0d 0a 20 20 20 74 |subtype |of.. t|
|00005470| 68 65 20 64 69 73 63 72 | 69 6d 69 6e 61 6e 74 3a |he discr|iminant:|
|00005480| 0d 0a 0d 0a 20 20 20 20 | 20 4d 61 78 5f 4c 65 6e |.... | Max_Len|
|00005490| 67 74 68 20 3a 20 63 6f | 6e 73 74 61 6e 74 20 3a |gth : co|nstant :|
|000054a0| 3d 20 32 30 30 3b 0d 0a | 0d 0a 20 20 20 20 20 73 |= 200;..|.. s|
|000054b0| 75 62 74 79 70 65 20 49 | 6e 64 65 78 20 69 73 0d |ubtype I|ndex is.|
|000054c0| 0a 20 20 20 20 20 20 20 | 4e 61 74 75 72 61 6c 20 |. |Natural |
|000054d0| 72 61 6e 67 65 20 30 20 | 2e 2e 20 4d 61 78 5f 4c |range 0 |.. Max_L|
|000054e0| 65 6e 67 74 68 3b 0d 0a | 0d 0a 20 20 20 20 20 74 |ength;..|.. t|
|000054f0| 79 70 65 20 56 5f 53 74 | 72 69 6e 67 20 28 53 69 |ype V_St|ring (Si|
|00005500| 7a 65 20 3a 20 49 6e 64 | 65 78 20 3a 3d 20 30 29 |ze : Ind|ex := 0)|
|00005510| 20 69 73 0d 0a 20 20 20 | 20 20 20 20 72 65 63 6f | is.. | reco|
|00005520| 72 64 0d 0a 20 20 20 20 | 20 20 20 20 20 53 20 3a |rd.. | S :|
|00005530| 20 53 74 72 69 6e 67 20 | 28 31 20 2e 2e 20 53 69 | String |(1 .. Si|
|00005540| 7a 65 29 3b 0d 0a 20 20 | 20 20 20 20 20 65 6e 64 |ze);.. | end|
|00005550| 20 72 65 63 6f 72 64 3b | 0d 0a 0d 0a 0d 0a 33 2e | record;|......3.|
|00005560| 31 31 3a 20 57 68 65 6e | 20 49 20 77 61 6e 74 20 |11: When| I want |
|00005570| 61 6e 20 49 6e 74 65 67 | 65 72 20 74 79 70 65 2c |an Integ|er type,|
|00005580| 20 77 68 61 74 27 73 20 | 77 72 6f 6e 67 20 77 69 | what's |wrong wi|
|00005590| 74 68 20 6a 75 73 74 20 | 75 73 69 6e 67 20 74 68 |th just |using th|
|000055a0| 65 20 70 72 65 64 65 66 | 69 6e 65 64 0d 0a 74 79 |e predef|ined..ty|
|000055b0| 70 65 20 49 6e 74 65 67 | 65 72 20 6f 72 20 4c 6f |pe Integ|er or Lo|
|000055c0| 6e 67 5f 49 6e 74 65 67 | 65 72 3f 20 57 68 79 20 |ng_Integ|er? Why |
|000055d0| 77 6f 75 6c 64 20 49 20 | 65 76 65 72 20 77 61 6e |would I |ever wan|
|000055e0| 74 20 74 6f 20 64 65 63 | 6c 61 72 65 20 6e 65 77 |t to dec|lare new|
|000055f0| 20 49 6e 74 65 67 65 72 | 0d 0a 74 79 70 65 73 3f | Integer|..types?|
|00005600| 0d 0a 0d 0a 20 20 20 49 | 66 20 79 6f 75 20 64 65 |.... I|f you de|
|00005610| 63 6c 61 72 65 20 32 20 | 64 69 73 74 69 6e 63 74 |clare 2 |distinct|
|00005620| 20 69 6e 74 65 67 65 72 | 20 74 79 70 65 73 2c 20 | integer| types, |
|00005630| 66 6f 72 20 65 78 61 6d | 70 6c 65 2c 0d 0a 0d 0a |for exam|ple,....|
|00005640| 20 20 20 20 20 74 79 70 | 65 20 44 61 74 61 5f 49 | typ|e Data_I|
|00005650| 6e 64 65 78 20 20 20 20 | 20 20 20 20 69 73 20 72 |ndex | is r|
|00005660| 61 6e 67 65 20 31 2e 2e | 31 30 30 3b 0d 0a 20 20 |ange 1..|100;.. |
|00005670| 20 20 20 74 79 70 65 20 | 54 69 6d 65 5f 53 65 72 | type |Time_Ser|
|00005680| 69 65 73 5f 49 6e 64 65 | 78 20 69 73 20 72 61 6e |ies_Inde|x is ran|
|00005690| 67 65 20 30 2e 2e 32 2a | 2a 31 35 2d 31 3b 0d 0a |ge 0..2*|*15-1;..|
|000056a0| 0d 0a 0d 0a 20 20 20 74 | 68 65 6e 20 6f 62 6a 65 |.... t|hen obje|
|000056b0| 63 74 73 20 6f 66 20 74 | 79 70 65 20 44 61 74 61 |cts of t|ype Data|
|000056c0| 5f 49 6e 64 65 78 20 63 | 61 6e 27 74 20 62 65 20 |_Index c|an't be |
|000056d0| 61 73 73 69 67 6e 65 64 | 20 28 64 69 72 65 63 74 |assigned| (direct|
|000056e0| 6c 79 29 20 74 6f 0d 0a | 20 20 20 76 61 72 69 61 |ly) to..| varia|
|000056f0| 62 6c 65 73 20 6f 66 20 | 74 79 70 65 20 54 69 6d |bles of |type Tim|
|00005700| 65 5f 53 65 72 69 65 73 | 5f 49 6e 64 65 78 2c 20 |e_Series|_Index, |
|00005710| 61 6e 64 20 76 69 63 65 | 2d 76 65 72 73 61 2e 20 |and vice|-versa. |
|00005720| 4c 69 6b 65 77 69 73 65 | 2c 0d 0a 20 20 20 76 61 |Likewise|,.. va|
|00005730| 72 69 61 62 6c 65 73 20 | 6f 66 20 74 68 65 73 65 |riables |of these|
|00005740| 20 32 20 74 79 70 65 73 | 20 63 61 6e 27 74 20 62 | 2 types| can't b|
|00005750| 65 20 6d 69 78 65 64 20 | 69 6e 20 61 72 69 74 68 |e mixed |in arith|
|00005760| 6d 65 74 69 63 61 6c 20 | 65 78 70 72 65 73 73 69 |metical |expressi|
|00005770| 6f 6e 73 0d 0a 20 20 20 | 28 77 69 74 68 6f 75 74 |ons.. |(without|
|00005780| 20 65 78 70 6c 69 63 69 | 74 20 74 79 70 65 20 63 | explici|t type c|
|00005790| 6f 6e 76 65 72 73 69 6f | 6e 73 29 2e 20 54 68 69 |onversio|ns). Thi|
|000057a0| 73 20 6d 61 79 20 73 65 | 65 6d 20 6c 69 6b 65 20 |s may se|em like |
|000057b0| 61 20 73 6f 75 72 63 65 | 20 6f 66 0d 0a 20 20 20 |a source| of.. |
|000057c0| 65 6e 64 6c 65 73 73 20 | 69 72 72 69 74 61 74 69 |endless |irritati|
|000057d0| 6f 6e 2c 20 62 75 74 20 | 6f 6e 20 74 68 65 20 63 |on, but |on the c|
|000057e0| 6f 6e 74 72 61 72 79 2c | 20 67 6f 6f 64 20 70 72 |ontrary,| good pr|
|000057f0| 6f 67 61 6d 6d 65 72 73 | 20 75 73 65 20 69 74 20 |ogammers| use it |
|00005800| 74 6f 0d 0a 20 20 20 69 | 6d 70 72 6f 76 65 20 74 |to.. i|mprove t|
|00005810| 68 65 20 63 6c 61 72 69 | 74 79 20 6f 66 20 74 68 |he clari|ty of th|
|00005820| 65 69 72 20 63 6f 64 65 | 2c 20 74 6f 20 6d 61 6b |eir code|, to mak|
|00005830| 65 20 69 74 20 6d 6f 72 | 65 20 72 6f 62 75 73 74 |e it mor|e robust|
|00005840| 2c 20 61 6e 64 20 6d 6f | 72 65 0d 0a 20 20 20 70 |, and mo|re.. p|
|00005850| 6f 72 74 61 62 6c 65 2e | 20 54 68 65 20 66 69 72 |ortable.| The fir|
|00005860| 73 74 20 32 20 65 78 61 | 6d 70 6c 65 73 20 64 69 |st 2 exa|mples di|
|00005870| 73 63 75 73 73 20 74 68 | 69 73 2e 20 54 68 65 20 |scuss th|is. The |
|00005880| 74 68 69 72 64 20 65 78 | 61 6d 70 6c 65 0d 0a 20 |third ex|ample.. |
|00005890| 20 20 64 69 73 63 75 73 | 73 65 73 20 74 68 65 20 | discus|ses the |
|000058a0| 64 65 63 6c 61 72 61 74 | 69 6f 6e 20 6f 66 20 6d |declarat|ion of m|
|000058b0| 61 63 68 69 6e 65 2d 70 | 6f 72 74 61 62 6c 65 20 |achine-p|ortable |
|000058c0| 33 32 2d 62 69 74 20 69 | 6e 74 65 67 65 72 73 2e |32-bit i|ntegers.|
|000058d0| 0d 0a 20 20 20 44 65 63 | 6c 61 72 69 6e 67 20 6f |.. Dec|laring o|
|000058e0| 62 6a 65 63 74 73 20 6f | 66 20 74 79 70 65 20 49 |bjects o|f type I|
|000058f0| 6e 74 65 67 65 72 20 63 | 61 6e 20 62 65 20 68 69 |nteger c|an be hi|
|00005900| 67 68 6c 79 20 6e 6f 6e | 2d 70 6f 72 74 61 62 6c |ghly non|-portabl|
|00005910| 65 2c 20 61 6e 64 20 6f | 66 0d 0a 20 20 20 63 6f |e, and o|f.. co|
|00005920| 75 72 73 65 20 74 79 70 | 65 20 4c 6f 6e 67 5f 49 |urse typ|e Long_I|
|00005930| 6e 74 65 67 65 72 20 6d | 61 79 20 6e 6f 74 20 65 |nteger m|ay not e|
|00005940| 78 69 73 74 20 6f 6e 20 | 73 6f 6d 65 20 63 6f 6d |xist on |some com|
|00005950| 70 69 6c 65 72 73 2e 0d | 0a 0d 0a 20 20 20 20 45 |pilers..|... E|
|00005960| 78 61 6d 70 6c 65 20 31 | 2e 0d 0a 0d 0a 20 20 20 |xample 1|..... |
|00005970| 53 75 70 70 6f 73 65 20 | 79 6f 75 20 64 65 63 6c |Suppose |you decl|
|00005980| 61 72 65 20 61 72 72 61 | 79 73 20 75 73 69 6e 67 |are arra|ys using|
|00005990| 20 74 68 65 20 61 62 6f | 76 65 20 69 6e 64 69 63 | the abo|ve indic|
|000059a0| 65 73 3a 0d 0a 0d 0a 20 | 20 20 20 20 74 79 70 65 |es:.... | type|
|000059b0| 20 54 69 6d 65 5f 53 65 | 72 69 65 73 20 69 73 20 | Time_Se|ries is |
|000059c0| 61 72 72 61 79 20 28 54 | 69 6d 65 5f 53 65 72 69 |array (T|ime_Seri|
|000059d0| 65 73 5f 49 6e 64 65 78 | 29 20 6f 66 20 46 6c 6f |es_Index|) of Flo|
|000059e0| 61 74 3b 0d 0a 20 20 20 | 20 20 74 79 70 65 20 59 |at;.. | type Y|
|000059f0| 5f 41 78 69 73 5f 44 61 | 74 61 20 69 73 20 61 72 |_Axis_Da|ta is ar|
|00005a00| 72 61 79 20 28 44 61 74 | 61 5f 49 6e 64 65 78 29 |ray (Dat|a_Index)|
|00005a10| 20 20 20 20 20 20 20 20 | 6f 66 20 46 6c 6f 61 74 | |of Float|
|00005a20| 3b 0d 0a 0d 0a 20 20 20 | 20 20 4d 65 61 73 75 72 |;.... | Measur|
|00005a30| 65 6d 65 6e 74 20 3a 20 | 54 69 6d 65 5f 53 65 72 |ement : |Time_Ser|
|00005a40| 69 65 73 3b 0d 0a 0d 0a | 0d 0a 20 20 20 4e 6f 77 |ies;....|.. Now|
|00005a50| 20 69 66 20 79 6f 75 20 | 6d 69 73 74 61 6b 65 6e | if you |mistaken|
|00005a60| 6c 79 20 74 72 79 20 74 | 6f 20 69 74 65 72 61 74 |ly try t|o iterat|
|00005a70| 65 20 6f 76 65 72 20 6f | 6e 65 20 61 72 72 61 79 |e over o|ne array|
|00005a80| 20 77 69 74 68 20 74 68 | 65 20 69 6e 64 65 78 20 | with th|e index |
|00005a90| 6f 66 0d 0a 20 20 20 74 | 68 65 20 6f 74 68 65 72 |of.. t|he other|
|00005aa0| 2c 20 74 68 65 20 63 6f | 6d 70 69 6c 65 72 20 63 |, the co|mpiler c|
|00005ab0| 61 6e 20 63 61 74 63 68 | 20 74 68 65 20 65 72 72 |an catch| the err|
|00005ac0| 6f 72 20 61 74 20 63 6f | 6d 70 69 6c 65 20 74 69 |or at co|mpile ti|
|00005ad0| 6d 65 3a 0d 0a 0d 0a 20 | 20 20 20 20 66 6f 72 20 |me:.... | for |
|00005ae0| 49 20 69 6e 20 44 61 74 | 61 5f 49 6e 64 65 78 20 |I in Dat|a_Index |
|00005af0| 6c 6f 6f 70 0d 0a 20 20 | 20 20 20 20 20 20 53 75 |loop.. | Su|
|00005b00| 6d 20 3a 3d 20 53 75 6d | 20 2b 20 4d 65 61 73 75 |m := Sum| + Measu|
|00005b10| 72 65 6d 65 6e 74 28 49 | 29 3b 20 20 2d 2d 20 63 |rement(I|); -- c|
|00005b20| 6f 6d 70 69 6c 61 74 69 | 6f 6e 20 65 72 72 6f 72 |ompilati|on error|
|00005b30| 0d 0a 20 20 20 20 20 65 | 6e 64 20 6c 6f 6f 70 3b |.. e|nd loop;|
|00005b40| 0d 0a 0d 0a 0d 0a 20 20 | 20 20 45 78 61 6d 70 6c |...... | Exampl|
|00005b50| 65 20 32 2e 0d 0a 0d 0a | 20 20 20 54 68 69 73 20 |e 2.....| This |
|00005b60| 69 73 20 6c 69 66 74 65 | 64 20 66 72 6f 6d 20 54 |is lifte|d from T|
|00005b70| 75 63 6b 65 72 20 54 61 | 66 74 27 73 20 62 72 69 |ucker Ta|ft's bri|
|00005b80| 65 66 20 69 6e 74 72 6f | 64 75 63 74 69 6f 6e 20 |ef intro|duction |
|00005b90| 74 6f 20 41 64 61 20 39 | 35 20 69 6e 20 74 68 65 |to Ada 9|5 in the|
|00005ba0| 0d 0a 20 20 20 63 6f 6e | 74 72 69 62 75 74 65 64 |.. con|tributed|
|00005bb0| 20 70 61 70 65 72 73 20 | 73 65 63 74 69 6f 6e 20 | papers |section |
|00005bc0| 6f 66 20 74 68 65 20 41 | 64 61 20 57 6f 72 6c 64 |of the A|da World|
|00005bd0| 20 57 69 64 65 20 57 65 | 62 20 68 6f 6d 65 70 61 | Wide We|b homepa|
|00005be0| 67 65 2e 20 48 65 72 65 | 0d 0a 20 20 20 54 75 63 |ge. Here|.. Tuc|
|00005bf0| 6b 65 72 20 75 73 65 73 | 20 74 68 65 20 41 64 61 |ker uses| the Ada|
|00005c00| 20 39 35 20 75 6e 73 69 | 67 6e 65 64 20 69 6e 74 | 95 unsi|gned int|
|00005c10| 65 67 65 72 73 2c 20 63 | 61 6c 6c 65 64 20 6d 6f |egers, c|alled mo|
|00005c20| 64 75 6c 61 72 20 74 79 | 70 65 73 2c 20 69 6e 20 |dular ty|pes, in |
|00005c30| 74 68 65 0d 0a 20 20 20 | 69 6d 70 6c 65 6d 65 6e |the.. |implemen|
|00005c40| 74 61 74 69 6f 6e 20 6f | 66 20 61 20 70 72 6f 74 |tation o|f a prot|
|00005c50| 65 63 74 65 64 20 74 79 | 70 65 2c 20 77 68 69 63 |ected ty|pe, whic|
|00005c60| 68 20 64 65 66 69 6e 65 | 73 20 61 20 64 69 73 6b |h define|s a disk|
|00005c70| 20 63 6f 6e 74 72 6f 6c | 20 75 6e 69 74 2e 0d 0a | control| unit...|
|00005c80| 20 20 20 4d 6f 64 75 6c | 61 72 20 74 79 70 65 73 | Modul|ar types|
|00005c90| 20 61 72 65 20 69 6e 74 | 65 67 65 72 20 74 79 70 | are int|eger typ|
|00005ca0| 65 73 20 77 69 74 68 20 | 22 61 6e 64 22 2c 20 22 |es with |"and", "|
|00005cb0| 6f 72 22 20 61 6e 64 20 | 22 78 6f 72 22 20 64 65 |or" and |"xor" de|
|00005cc0| 66 69 6e 65 64 2c 20 73 | 6f 0d 0a 20 20 20 73 79 |fined, s|o.. sy|
|00005cd0| 73 74 65 6d 73 20 70 72 | 6f 67 72 61 6d 6d 65 72 |stems pr|ogrammer|
|00005ce0| 73 20 61 72 65 20 6c 69 | 6b 65 6c 79 20 74 6f 20 |s are li|kely to |
|00005cf0| 75 73 65 20 74 68 65 6d | 20 61 73 20 62 69 74 20 |use them| as bit |
|00005d00| 6d 61 73 6b 73 2e 20 4a | 75 73 74 20 61 73 20 74 |masks. J|ust as t|
|00005d10| 68 65 0d 0a 20 20 20 61 | 72 72 61 79 20 69 6e 64 |he.. a|rray ind|
|00005d20| 69 63 65 73 20 6f 66 20 | 74 68 65 20 32 20 61 72 |ices of |the 2 ar|
|00005d30| 72 61 79 73 20 64 65 66 | 69 6e 65 64 20 61 62 6f |rays def|ined abo|
|00005d40| 76 65 20 61 72 65 20 6e | 65 76 65 72 20 6d 65 61 |ve are n|ever mea|
|00005d50| 6e 74 20 74 6f 20 62 65 | 0d 0a 20 20 20 6d 69 78 |nt to be|.. mix|
|00005d60| 65 64 2c 20 74 68 65 20 | 6d 6f 64 75 6c 61 72 20 |ed, the |modular |
|00005d70| 69 6e 74 65 67 65 72 20 | 74 79 70 65 73 20 75 73 |integer |types us|
|00005d80| 65 64 20 74 6f 20 69 6d | 70 6c 65 6d 65 6e 74 20 |ed to im|plement |
|00005d90| 74 68 65 20 64 69 73 6b | 20 63 6f 6e 74 72 6f 6c |the disk| control|
|00005da0| 0d 0a 20 20 20 75 6e 69 | 74 20 61 72 65 20 6e 65 |.. uni|t are ne|
|00005db0| 76 65 72 20 6d 65 61 6e | 74 20 74 6f 20 62 65 20 |ver mean|t to be |
|00005dc0| 6d 69 78 65 64 2e 20 54 | 6f 20 6d 61 6b 65 20 73 |mixed. T|o make s|
|00005dd0| 75 72 65 20 74 68 65 20 | 63 6f 6d 70 69 6c 65 72 |ure the |compiler|
|00005de0| 20 65 6e 66 6f 72 63 65 | 73 0d 0a 20 20 20 74 68 | enforce|s.. th|
|00005df0| 69 73 2c 20 74 68 65 79 | 20 61 72 65 20 64 65 63 |is, they| are dec|
|00005e00| 6c 61 72 65 64 20 61 73 | 20 64 69 73 74 69 6e 63 |lared as| distinc|
|00005e10| 74 20 74 79 70 65 73 3a | 0d 0a 0d 0a 20 20 20 20 |t types:|.... |
|00005e20| 20 74 79 70 65 20 46 6c | 61 67 73 20 20 20 69 73 | type Fl|ags is|
|00005e30| 20 6d 6f 64 20 32 2a 2a | 34 3b 20 20 2d 2d 20 61 | mod 2**|4; -- a|
|00005e40| 20 34 2d 62 69 74 20 66 | 6c 61 67 73 20 66 69 65 | 4-bit f|lags fie|
|00005e50| 6c 64 0d 0a 20 20 20 20 | 20 74 79 70 65 20 43 6f |ld.. | type Co|
|00005e60| 6e 74 72 6f 6c 20 69 73 | 20 6d 6f 64 20 32 2a 2a |ntrol is| mod 2**|
|00005e70| 34 3b 20 20 2d 2d 20 41 | 20 34 2d 62 69 74 20 63 |4; -- A| 4-bit c|
|00005e80| 6f 6e 74 72 6f 6c 20 66 | 69 65 6c 64 0d 0a 0d 0a |ontrol f|ield....|
|00005e90| 20 20 20 20 20 53 74 61 | 74 75 73 5f 4d 61 73 6b | Sta|tus_Mask|
|00005ea0| 20 20 3a 20 63 6f 6e 73 | 74 61 6e 74 20 46 6c 61 | : cons|tant Fla|
|00005eb0| 67 73 20 3a 3d 20 32 23 | 31 30 30 31 23 3b 20 20 |gs := 2#|1001#; |
|00005ec0| 20 2d 2d 20 53 65 74 20 | 66 69 72 73 74 20 61 6e | -- Set |first an|
|00005ed0| 64 20 6c 61 73 74 20 62 | 69 74 73 2e 0d 0a 20 20 |d last b|its... |
|00005ee0| 20 20 20 53 74 61 74 75 | 73 5f 52 65 61 64 79 20 | Statu|s_Ready |
|00005ef0| 3a 20 63 6f 6e 73 74 61 | 6e 74 20 46 6c 61 67 73 |: consta|nt Flags|
|00005f00| 20 3a 3d 20 32 23 31 30 | 30 30 23 3b 20 20 20 2d | := 2#10|00#; -|
|00005f10| 2d 20 53 74 61 74 75 73 | 20 3d 20 52 65 61 64 79 |- Status| = Ready|
|00005f20| 0d 0a 0d 0a 20 20 20 20 | 20 53 74 61 72 74 5f 58 |.... | Start_X|
|00005f30| 66 72 20 20 20 20 3a 20 | 63 6f 6e 73 74 61 6e 74 |fr : |constant|
|00005f40| 20 43 6f 6e 74 72 6f 6c | 20 3a 3d 20 32 23 30 30 | Control| := 2#00|
|00005f50| 30 31 23 3b 20 2d 2d 20 | 49 6e 69 74 69 61 74 65 |01#; -- |Initiate|
|00005f60| 20 78 66 72 20 63 6f 6d | 6d 61 6e 64 0d 0a 0d 0a | xfr com|mand....|
|00005f70| 0d 0a 20 20 20 4e 6f 77 | 20 69 66 20 73 6f 6d 65 |.. Now| if some|
|00005f80| 6f 6e 65 20 61 74 74 65 | 6d 70 74 73 20 74 6f 20 |one atte|mpts to |
|00005f90| 61 70 70 6c 79 20 61 20 | 46 6c 61 67 20 76 61 72 |apply a |Flag var|
|00005fa0| 69 61 62 6c 65 20 77 68 | 65 72 65 20 61 20 43 6f |iable wh|ere a Co|
|00005fb0| 6e 74 72 6f 6c 0d 0a 20 | 20 20 76 61 72 69 61 62 |ntrol.. | variab|
|00005fc0| 6c 65 20 73 68 6f 75 6c | 64 20 62 65 20 75 73 65 |le shoul|d be use|
|00005fd0| 64 20 28 6f 72 20 76 69 | 63 65 2d 76 65 72 73 61 |d (or vi|ce-versa|
|00005fe0| 29 20 74 68 65 20 63 6f | 6d 70 69 6c 65 72 20 77 |) the co|mpiler w|
|00005ff0| 69 6c 6c 20 63 61 74 63 | 68 20 74 68 65 0d 0a 20 |ill catc|h the.. |
|00006000| 20 20 65 72 72 6f 72 2e | 20 54 68 69 73 20 69 73 | error.| This is|
|00006010| 20 65 73 70 65 63 69 61 | 6c 6c 79 20 69 6d 70 6f | especia|lly impo|
|00006020| 72 74 61 6e 74 20 77 68 | 65 6e 20 74 68 65 20 63 |rtant wh|en the c|
|00006030| 6f 64 65 20 69 73 20 6d | 61 69 6e 74 61 69 6e 65 |ode is m|aintaine|
|00006040| 64 20 62 79 0d 0a 20 20 | 20 70 72 6f 67 72 61 6d |d by.. | program|
|00006050| 6d 65 72 73 20 77 68 6f | 20 64 69 64 20 6e 6f 74 |mers who| did not|
|00006060| 20 77 72 69 74 65 20 69 | 74 2e 0d 0a 0d 0a 20 20 | write i|t..... |
|00006070| 20 20 52 65 6d 61 72 6b | 73 20 6f 6e 20 45 78 61 | Remark|s on Exa|
|00006080| 6d 70 6c 65 73 20 31 20 | 61 6e 64 20 32 2e 0d 0a |mples 1 |and 2...|
|00006090| 0d 0a 20 20 20 31 2e 20 | 4e 6f 74 69 63 65 20 74 |.. 1. |Notice t|
|000060a0| 68 61 74 20 69 6e 20 62 | 6f 74 68 20 65 78 61 6d |hat in b|oth exam|
|000060b0| 70 6c 65 73 20 74 68 65 | 20 70 72 6f 67 72 61 6d |ples the| program|
|000060c0| 6d 65 72 20 77 61 73 20 | 61 62 6c 65 20 74 6f 20 |mer was |able to |
|000060d0| 73 74 61 74 65 20 68 69 | 73 0d 0a 20 20 20 69 6e |state hi|s.. in|
|000060e0| 74 65 6e 74 69 6f 6e 73 | 20 72 61 74 68 65 72 20 |tentions| rather |
|000060f0| 66 6f 72 63 65 66 75 6c | 6c 79 20 69 6e 20 74 68 |forceful|ly in th|
|00006100| 65 20 63 6f 64 65 20 2d | 20 69 6e 74 65 6e 74 69 |e code -| intenti|
|00006110| 6f 6e 73 20 74 68 61 74 | 20 6f 74 68 65 72 77 69 |ons that| otherwi|
|00006120| 73 65 0d 0a 20 20 20 6d | 69 67 68 74 20 68 61 76 |se.. m|ight hav|
|00006130| 65 20 62 65 65 6e 20 65 | 78 70 72 65 73 73 65 64 |e been e|xpressed|
|00006140| 20 6d 75 63 68 20 6c 65 | 73 73 20 66 6f 72 63 65 | much le|ss force|
|00006150| 66 75 6c 6c 79 20 69 6e | 20 63 6f 6d 6d 65 6e 74 |fully in| comment|
|00006160| 20 73 74 61 74 65 6d 65 | 6e 74 73 2e 0d 0a 20 20 | stateme|nts... |
|00006170| 20 42 65 63 61 75 73 65 | 20 6f 66 20 41 64 61 27 | Because| of Ada'|
|00006180| 73 20 73 74 72 6f 6e 67 | 20 74 79 70 69 6e 67 20 |s strong| typing |
|00006190| 6d 6f 64 65 6c 2c 20 74 | 68 65 20 63 6f 6d 70 69 |model, t|he compi|
|000061a0| 6c 65 72 20 77 61 73 20 | 61 62 6c 65 20 74 6f 20 |ler was |able to |
|000061b0| 63 61 74 63 68 0d 0a 20 | 20 20 65 72 72 6f 72 73 |catch.. | errors|
|000061c0| 20 61 74 20 63 6f 6d 70 | 69 6c 65 2d 74 69 6d 65 | at comp|ile-time|
|000061d0| 20 77 68 65 6e 20 74 68 | 65 20 70 72 6f 67 72 61 | when th|e progra|
|000061e0| 6d 6d 65 72 27 73 20 69 | 6e 74 65 6e 74 69 6f 6e |mmer's i|ntention|
|000061f0| 73 20 77 65 72 65 20 76 | 69 6f 6c 61 74 65 64 2e |s were v|iolated.|
|00006200| 0d 0a 0d 0a 0d 0a 20 20 | 20 32 2e 20 4e 6f 74 69 |...... | 2. Noti|
|00006210| 63 65 20 61 6c 73 6f 20 | 74 68 61 74 20 74 68 65 |ce also |that the|
|00006220| 20 49 6e 74 65 67 65 72 | 20 64 65 63 6c 61 72 61 | Integer| declara|
|00006230| 74 69 6f 6e 73 20 69 6e | 20 74 68 65 20 32 20 65 |tions in| the 2 e|
|00006240| 78 61 6d 70 6c 65 73 20 | 61 72 65 0d 0a 20 20 20 |xamples |are.. |
|00006250| 6d 61 63 68 69 6e 65 20 | 70 6f 72 74 61 62 6c 65 |machine |portable|
|00006260| 2c 20 75 6e 6c 69 6b 65 | 20 49 6e 74 65 67 65 72 |, unlike| Integer|
|00006270| 20 61 6e 64 20 4c 6f 6e | 67 5f 49 6e 74 65 67 65 | and Lon|g_Intege|
|00006280| 72 2e 20 41 20 63 6f 6d | 70 69 6c 65 72 20 77 69 |r. A com|piler wi|
|00006290| 6c 6c 0d 0a 20 20 20 74 | 79 70 69 63 61 6c 6c 79 |ll.. t|ypically|
|000062a0| 20 6d 61 70 20 74 68 65 | 73 65 20 69 6e 74 65 67 | map the|se integ|
|000062b0| 65 72 20 74 79 70 65 73 | 20 6f 6e 74 6f 20 74 68 |er types| onto th|
|000062c0| 65 20 6d 6f 73 74 20 65 | 66 66 69 63 69 65 6e 74 |e most e|fficient|
|000062d0| 20 62 61 73 65 20 74 79 | 70 65 0d 0a 20 20 20 74 | base ty|pe.. t|
|000062e0| 68 61 74 20 69 73 20 61 | 76 61 69 6c 61 62 6c 65 |hat is a|vailable|
|000062f0| 20 6f 6e 20 74 68 65 20 | 74 61 72 67 65 74 20 6d | on the |target m|
|00006300| 61 63 68 69 6e 65 2e 0d | 0a 0d 0a 20 20 20 20 45 |achine..|... E|
|00006310| 78 61 6d 70 6c 65 20 33 | 2e 0d 0a 0d 0a 20 20 20 |xample 3|..... |
|00006320| 41 6c 74 68 6f 75 67 68 | 20 74 68 65 20 65 78 61 |Although| the exa|
|00006330| 6d 70 6c 65 73 20 67 69 | 76 65 6e 20 61 62 6f 76 |mples gi|ven abov|
|00006340| 65 20 61 72 65 20 67 6f | 6f 64 20 6f 6e 65 73 2c |e are go|od ones,|
|00006350| 20 69 74 20 69 73 20 6e | 6f 74 20 6e 65 63 65 73 | it is n|ot neces|
|00006360| 73 61 72 69 6c 79 0d 0a | 20 20 20 61 20 63 6f 6d |sarily..| a com|
|00006370| 6d 6f 6e 20 70 72 61 63 | 74 69 63 65 20 74 6f 20 |mon prac|tice to |
|00006380| 64 65 66 69 6e 65 20 61 | 20 6c 61 72 67 65 20 6e |define a| large n|
|00006390| 75 6d 62 65 72 20 6f 66 | 20 64 69 73 74 69 6e 63 |umber of| distinc|
|000063a0| 74 20 69 6e 74 65 67 65 | 72 20 74 79 70 65 73 2e |t intege|r types.|
|000063b0| 0d 0a 20 20 20 49 6e 20 | 6d 61 6e 79 20 63 61 73 |.. In |many cas|
|000063c0| 65 73 20 69 74 20 69 73 | 20 61 70 70 72 6f 70 72 |es it is| appropr|
|000063d0| 69 61 74 65 20 74 6f 20 | 75 73 65 20 28 73 61 79 |iate to |use (say|
|000063e0| 29 20 61 20 33 32 2d 62 | 69 74 20 69 6e 74 65 67 |) a 32-b|it integ|
|000063f0| 65 72 20 28 6f 72 20 61 | 0d 0a 20 20 20 73 6d 61 |er (or a|.. sma|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.