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 |
99%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news, ISO-8859 text
| default
| |
100%
| TrID
| PrintFox/Pagefox bitmap (640x800)
| default (weak)
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
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 73 70 6f | 6f 6c 2e 6d 75 2e 65 64 |.edu!spo|ol.mu.ed|
|00000040| 75 21 75 73 65 6e 65 74 | 2e 65 65 6c 2e 75 66 6c |u!usenet|.eel.ufl|
|00000050| 2e 65 64 75 21 62 6f 66 | 68 2e 64 6f 74 21 75 73 |.edu!bof|h.dot!us|
|00000060| 65 6e 65 74 2e 63 69 73 | 2e 75 66 6c 2e 65 64 75 |enet.cis|.ufl.edu|
|00000070| 21 70 75 72 64 75 65 21 | 6c 65 72 63 2e 6e 61 73 |!purdue!|lerc.nas|
|00000080| 61 2e 67 6f 76 21 6d 61 | 67 6e 75 73 2e 61 63 73 |a.gov!ma|gnus.acs|
|00000090| 2e 6f 68 69 6f 2d 73 74 | 61 74 65 2e 65 64 75 21 |.ohio-st|ate.edu!|
|000000a0| 6d 61 74 68 2e 6f 68 69 | 6f 2d 73 74 61 74 65 2e |math.ohi|o-state.|
|000000b0| 65 64 75 21 68 6f 77 6c | 61 6e 64 2e 72 65 73 74 |edu!howl|and.rest|
|000000c0| 6f 6e 2e 61 6e 73 2e 6e | 65 74 21 73 75 72 66 6e |on.ans.n|et!surfn|
|000000d0| 65 74 2e 6e 6c 21 73 77 | 73 62 65 36 2e 73 77 69 |et.nl!sw|sbe6.swi|
|000000e0| 74 63 68 2e 63 68 21 73 | 77 69 64 69 72 2e 73 77 |tch.ch!s|widir.sw|
|000000f0| 69 74 63 68 2e 63 68 21 | 65 70 66 6c 6e 65 77 73 |itch.ch!|epflnews|
|00000100| 21 64 69 6e 65 77 73 2e | 65 70 66 6c 2e 63 68 21 |!dinews.|epfl.ch!|
|00000110| 4d 61 67 6e 75 73 2e 4b | 65 6d 70 65 0a 46 72 6f |Magnus.K|empe.Fro|
|00000120| 6d 3a 20 4d 61 67 6e 75 | 73 2e 4b 65 6d 70 65 40 |m: Magnu|s.Kempe@|
|00000130| 64 69 2e 65 70 66 6c 2e | 63 68 20 28 4d 61 67 6e |di.epfl.|ch (Magn|
|00000140| 75 73 20 4b 65 6d 70 65 | 29 0a 4e 65 77 73 67 72 |us Kempe|).Newsgr|
|00000150| 6f 75 70 73 3a 20 63 6f | 6d 70 2e 6c 61 6e 67 2e |oups: co|mp.lang.|
|00000160| 61 64 61 2c 63 6f 6d 70 | 2e 61 6e 73 77 65 72 73 |ada,comp|.answers|
|00000170| 2c 6e 65 77 73 2e 61 6e | 73 77 65 72 73 0a 53 75 |,news.an|swers.Su|
|00000180| 62 6a 65 63 74 3a 20 41 | 64 61 20 46 41 51 3a 20 |bject: A|da FAQ: |
|00000190| 50 72 6f 67 72 61 6d 6d | 69 6e 67 20 77 69 74 68 |Programm|ing with|
|000001a0| 20 41 64 61 20 28 70 61 | 72 74 20 31 20 6f 66 20 | Ada (pa|rt 1 of |
|000001b0| 34 29 0a 46 6f 6c 6c 6f | 77 75 70 2d 54 6f 3a 20 |4).Follo|wup-To: |
|000001c0| 70 6f 73 74 65 72 0a 44 | 61 74 65 3a 20 33 30 20 |poster.D|ate: 30 |
|000001d0| 4d 61 79 20 31 39 39 36 | 20 31 37 3a 30 38 3a 30 |May 1996| 17:08:0|
|000001e0| 32 20 47 4d 54 0a 4f 72 | 67 61 6e 69 7a 61 74 69 |2 GMT.Or|ganizati|
|000001f0| 6f 6e 3a 20 4e 6f 6e 65 | 0a 4c 69 6e 65 73 3a 20 |on: None|.Lines: |
|00000200| 38 31 36 0a 53 65 6e 64 | 65 72 3a 20 6d 61 67 6e |816.Send|er: magn|
|00000210| 75 73 40 6c 67 6c 73 75 | 6e 34 2e 65 70 66 6c 2e |us@lglsu|n4.epfl.|
|00000220| 63 68 20 28 4d 61 67 6e | 75 73 20 4b 65 6d 70 65 |ch (Magn|us Kempe|
|00000230| 29 0a 41 70 70 72 6f 76 | 65 64 3a 20 6e 65 77 73 |).Approv|ed: news|
|00000240| 2d 61 6e 73 77 65 72 73 | 2d 72 65 71 75 65 73 74 |-answers|-request|
|00000250| 40 4d 49 54 2e 45 44 55 | 0a 44 69 73 74 72 69 62 |@MIT.EDU|.Distrib|
|00000260| 75 74 69 6f 6e 3a 20 77 | 6f 72 6c 64 0a 4d 65 73 |ution: w|orld.Mes|
|00000270| 73 61 67 65 2d 49 44 3a | 20 3c 34 6f 6b 6b 6c 69 |sage-ID:| <4okkli|
|00000280| 24 69 64 74 40 64 69 73 | 75 6e 6d 73 2e 65 70 66 |$idt@dis|unms.epf|
|00000290| 6c 2e 63 68 3e 0a 52 65 | 70 6c 79 2d 54 6f 3a 20 |l.ch>.Re|ply-To: |
|000002a0| 4d 61 67 6e 75 73 2e 4b | 65 6d 70 65 40 64 69 2e |Magnus.K|empe@di.|
|000002b0| 65 70 66 6c 2e 63 68 20 | 28 4d 61 67 6e 75 73 20 |epfl.ch |(Magnus |
|000002c0| 4b 65 6d 70 65 29 0a 4e | 4e 54 50 2d 50 6f 73 74 |Kempe).N|NTP-Post|
|000002d0| 69 6e 67 2d 48 6f 73 74 | 3a 20 6c 67 6c 73 75 6e |ing-Host|: lglsun|
|000002e0| 34 2e 65 70 66 6c 2e 63 | 68 0a 4d 69 6d 65 2d 56 |4.epfl.c|h.Mime-V|
|000002f0| 65 72 73 69 6f 6e 3a 20 | 31 2e 30 0a 43 6f 6e 74 |ersion: |1.0.Cont|
|00000300| 65 6e 74 2d 54 79 70 65 | 3a 20 74 65 78 74 2f 70 |ent-Type|: text/p|
|00000310| 6c 61 69 6e 3b 20 63 68 | 61 72 73 65 74 3d 69 73 |lain; ch|arset=is|
|00000320| 6f 2d 38 38 35 39 2d 31 | 0a 43 6f 6e 74 65 6e 74 |o-8859-1|.Content|
|00000330| 2d 54 72 61 6e 73 66 65 | 72 2d 45 6e 63 6f 64 69 |-Transfe|r-Encodi|
|00000340| 6e 67 3a 20 38 62 69 74 | 0a 53 75 6d 6d 61 72 79 |ng: 8bit|.Summary|
|00000350| 3a 20 41 64 61 20 50 72 | 6f 67 72 61 6d 6d 65 72 |: Ada Pr|ogrammer|
|00000360| 27 73 20 46 72 65 71 75 | 65 6e 74 6c 79 20 41 73 |'s Frequ|ently As|
|00000370| 6b 65 64 20 51 75 65 73 | 74 69 6f 6e 73 20 28 61 |ked Ques|tions (a|
|00000380| 6e 64 20 61 6e 73 77 65 | 72 73 29 2c 0a 20 20 20 |nd answe|rs),. |
|00000390| 20 20 20 20 20 20 20 20 | 70 61 72 74 20 31 20 6f | |part 1 o|
|000003a0| 66 20 34 2e 0a 20 20 20 | 20 20 20 20 20 20 50 6c |f 4.. | Pl|
|000003b0| 65 61 73 65 20 72 65 61 | 64 20 62 65 66 6f 72 65 |ease rea|d before|
|000003c0| 20 70 6f 73 74 69 6e 67 | 2e 0a 4b 65 79 77 6f 72 | posting|..Keywor|
|000003d0| 64 73 3a 20 61 64 76 61 | 6e 63 65 64 20 6c 61 6e |ds: adva|nced lan|
|000003e0| 67 75 61 67 65 2c 20 61 | 72 74 69 66 69 63 69 61 |guage, a|rtificia|
|000003f0| 6c 20 6c 61 6e 67 75 61 | 67 65 73 2c 20 63 6f 6d |l langua|ges, com|
|00000400| 70 75 74 65 72 20 73 6f | 66 74 77 61 72 65 2c 0a |puter so|ftware,.|
|00000410| 20 20 20 20 20 20 20 20 | 20 20 64 61 74 61 20 70 | | data p|
|00000420| 72 6f 63 65 73 73 69 6e | 67 2c 20 70 72 6f 67 72 |rocessin|g, progr|
|00000430| 61 6d 6d 69 6e 67 20 6c | 61 6e 67 75 61 67 65 73 |amming l|anguages|
|00000440| 2c 20 41 64 61 0a 58 72 | 65 66 3a 20 73 65 6e 61 |, Ada.Xr|ef: sena|
|00000450| 74 6f 72 2d 62 65 64 66 | 65 6c 6c 6f 77 2e 6d 69 |tor-bedf|ellow.mi|
|00000460| 74 2e 65 64 75 20 63 6f | 6d 70 2e 6c 61 6e 67 2e |t.edu co|mp.lang.|
|00000470| 61 64 61 3a 34 35 36 37 | 32 20 63 6f 6d 70 2e 61 |ada:4567|2 comp.a|
|00000480| 6e 73 77 65 72 73 3a 31 | 38 39 39 35 20 6e 65 77 |nswers:1|8995 new|
|00000490| 73 2e 61 6e 73 77 65 72 | 73 3a 37 33 30 37 39 0a |s.answer|s:73079.|
|000004a0| 0a 41 72 63 68 69 76 65 | 2d 6e 61 6d 65 3a 20 63 |.Archive|-name: c|
|000004b0| 6f 6d 70 75 74 65 72 2d | 6c 61 6e 67 2f 41 64 61 |omputer-|lang/Ada|
|000004c0| 2f 70 72 6f 67 72 61 6d | 6d 69 6e 67 2f 70 61 72 |/program|ming/par|
|000004d0| 74 31 0a 43 6f 6d 70 2d | 6c 61 6e 67 2d 61 64 61 |t1.Comp-|lang-ada|
|000004e0| 2d 61 72 63 68 69 76 65 | 2d 6e 61 6d 65 3a 20 70 |-archive|-name: p|
|000004f0| 72 6f 67 72 61 6d 6d 69 | 6e 67 2f 70 61 72 74 31 |rogrammi|ng/part1|
|00000500| 0a 50 6f 73 74 69 6e 67 | 2d 46 72 65 71 75 65 6e |.Posting|-Frequen|
|00000510| 63 79 3a 20 6d 6f 6e 74 | 68 6c 79 0a 4c 61 73 74 |cy: mont|hly.Last|
|00000520| 2d 6d 6f 64 69 66 69 65 | 64 3a 20 32 32 20 4d 61 |-modifie|d: 22 Ma|
|00000530| 79 20 31 39 39 36 0a 4c | 61 73 74 2d 70 6f 73 74 |y 1996.L|ast-post|
|00000540| 65 64 3a 20 32 33 20 41 | 70 72 69 6c 20 31 39 39 |ed: 23 A|pril 199|
|00000550| 36 0a 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |6.. | |
|00000560| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000570| 20 20 41 64 61 20 50 72 | 6f 67 72 61 6d 6d 65 72 | Ada Pr|ogrammer|
|00000580| 27 73 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |'s. | |
|00000590| 20 20 20 20 20 20 20 20 | 20 20 46 72 65 71 75 65 | | Freque|
|000005a0| 6e 74 6c 79 20 41 73 6b | 65 64 20 51 75 65 73 74 |ntly Ask|ed Quest|
|000005b0| 69 6f 6e 73 20 28 46 41 | 51 29 0a 0a 20 20 20 49 |ions (FA|Q).. I|
|000005c0| 4d 50 4f 52 54 41 4e 54 | 20 4e 4f 54 45 3a 20 4e |MPORTANT| NOTE: N|
|000005d0| 6f 20 46 41 51 20 63 61 | 6e 20 73 75 62 73 74 69 |o FAQ ca|n substi|
|000005e0| 74 75 74 65 20 66 6f 72 | 20 72 65 61 6c 20 74 65 |tute for| real te|
|000005f0| 61 63 68 69 6e 67 20 61 | 6e 64 0a 20 20 20 64 6f |aching a|nd. do|
|00000600| 63 75 6d 65 6e 74 61 74 | 69 6f 6e 2e 20 54 68 65 |cumentat|ion. The|
|00000610| 72 65 20 69 73 20 61 6e | 20 61 6e 6e 6f 74 61 74 |re is an| annotat|
|00000620| 65 64 20 6c 69 73 74 20 | 6f 66 20 41 64 61 20 62 |ed list |of Ada b|
|00000630| 6f 6f 6b 73 20 69 6e 20 | 74 68 65 0a 20 20 20 63 |ooks in |the. c|
|00000640| 6f 6d 70 61 6e 69 6f 6e | 20 63 6f 6d 70 2e 6c 61 |ompanion| comp.la|
|00000650| 6e 67 2e 61 64 61 20 46 | 41 51 2e 0a 0a 20 20 20 |ng.ada F|AQ... |
|00000660| 20 52 65 63 65 6e 74 20 | 63 68 61 6e 67 65 73 20 | Recent |changes |
|00000670| 74 6f 20 74 68 69 73 20 | 46 41 51 20 61 72 65 20 |to this |FAQ are |
|00000680| 6c 69 73 74 65 64 20 69 | 6e 20 74 68 65 20 66 69 |listed i|n the fi|
|00000690| 72 73 74 20 73 65 63 74 | 69 6f 6e 20 61 66 74 65 |rst sect|ion afte|
|000006a0| 72 20 74 68 65 20 74 61 | 62 6c 65 0a 20 20 20 20 |r the ta|ble. |
|000006b0| 6f 66 20 63 6f 6e 74 65 | 6e 74 73 2e 20 54 68 69 |of conte|nts. Thi|
|000006c0| 73 20 64 6f 63 75 6d 65 | 6e 74 20 69 73 20 75 6e |s docume|nt is un|
|000006d0| 64 65 72 20 65 78 70 6c | 69 63 69 74 20 63 6f 70 |der expl|icit cop|
|000006e0| 79 72 69 67 68 74 2e 0a | 0a 54 68 69 73 20 69 73 |yright..|.This is|
|000006f0| 20 70 61 72 74 20 31 20 | 6f 66 20 61 20 34 2d 70 | part 1 |of a 4-p|
|00000700| 61 72 74 20 70 6f 73 74 | 69 6e 67 3b 20 70 61 72 |art post|ing; par|
|00000710| 74 20 31 20 63 6f 6e 74 | 61 69 6e 73 20 74 68 65 |t 1 cont|ains the|
|00000720| 20 74 61 62 6c 65 20 6f | 66 20 63 6f 6e 74 65 6e | table o|f conten|
|00000730| 74 73 2e 0a 50 61 72 74 | 20 32 20 62 65 67 69 6e |ts..Part| 2 begin|
|00000740| 73 20 77 69 74 68 20 71 | 75 65 73 74 69 6f 6e 20 |s with q|uestion |
|00000750| 35 2e 0a 50 61 72 74 20 | 33 20 62 65 67 69 6e 73 |5..Part |3 begins|
|00000760| 20 77 69 74 68 20 71 75 | 65 73 74 69 6f 6e 20 36 | with qu|estion 6|
|00000770| 2e 0a 50 61 72 74 20 34 | 20 62 65 67 69 6e 73 20 |..Part 4| begins |
|00000780| 77 69 74 68 20 71 75 65 | 73 74 69 6f 6e 20 39 2e |with que|stion 9.|
|00000790| 0a 54 68 65 79 20 73 68 | 6f 75 6c 64 20 62 65 20 |.They sh|ould be |
|000007a0| 74 68 65 20 6e 65 78 74 | 20 70 6f 73 74 69 6e 67 |the next| posting|
|000007b0| 73 20 69 6e 20 74 68 69 | 73 20 74 68 72 65 61 64 |s in thi|s thread|
|000007c0| 2e 0a 0a 0a 49 6e 74 72 | 6f 64 75 63 74 69 6f 6e |....Intr|oduction|
|000007d0| 0a 0a 20 20 20 41 64 61 | 20 69 73 20 61 6e 20 61 |.. Ada| is an a|
|000007e0| 64 76 61 6e 63 65 64 2c | 20 6d 6f 64 65 72 6e 20 |dvanced,| modern |
|000007f0| 70 72 6f 67 72 61 6d 6d | 69 6e 67 20 6c 61 6e 67 |programm|ing lang|
|00000800| 75 61 67 65 2c 20 64 65 | 73 69 67 6e 65 64 20 61 |uage, de|signed a|
|00000810| 6e 64 0a 20 20 20 73 74 | 61 6e 64 61 72 64 69 7a |nd. st|andardiz|
|00000820| 65 64 20 74 6f 20 73 75 | 70 70 6f 72 74 20 61 6e |ed to su|pport an|
|00000830| 64 20 73 74 72 6f 6e 67 | 6c 79 20 65 6e 63 6f 75 |d strong|ly encou|
|00000840| 72 61 67 65 20 77 69 64 | 65 6c 79 20 72 65 63 6f |rage wid|ely reco|
|00000850| 67 6e 69 7a 65 64 0a 20 | 20 20 73 6f 66 74 77 61 |gnized. | softwa|
|00000860| 72 65 20 65 6e 67 69 6e | 65 65 72 69 6e 67 20 70 |re engin|eering p|
|00000870| 72 69 6e 63 69 70 6c 65 | 73 3a 20 72 65 6c 69 61 |rinciple|s: relia|
|00000880| 62 69 6c 69 74 79 2c 20 | 70 6f 72 74 61 62 69 6c |bility, |portabil|
|00000890| 69 74 79 2c 20 6d 6f 64 | 75 6c 61 72 69 74 79 2c |ity, mod|ularity,|
|000008a0| 0a 20 20 20 72 65 75 73 | 61 62 69 6c 69 74 79 2c |. reus|ability,|
|000008b0| 20 70 72 6f 67 72 61 6d | 6d 69 6e 67 20 61 73 20 | program|ming as |
|000008c0| 61 20 68 75 6d 61 6e 20 | 61 63 74 69 76 69 74 79 |a human |activity|
|000008d0| 2c 20 65 66 66 69 63 69 | 65 6e 63 79 2c 0a 20 20 |, effici|ency,. |
|000008e0| 20 6d 61 69 6e 74 61 69 | 6e 61 62 69 6c 69 74 79 | maintai|nability|
|000008f0| 2c 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 68 69 |, inform|ation hi|
|00000900| 64 69 6e 67 2c 20 61 62 | 73 74 72 61 63 74 20 64 |ding, ab|stract d|
|00000910| 61 74 61 20 74 79 70 65 | 73 2c 20 67 65 6e 65 72 |ata type|s, gener|
|00000920| 69 63 69 74 79 2c 0a 20 | 20 20 63 6f 6e 63 75 72 |icity,. | concur|
|00000930| 72 65 6e 74 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 |rent pro|gramming|
|00000940| 2c 20 6f 62 6a 65 63 74 | 2d 6f 72 69 65 6e 74 65 |, object|-oriente|
|00000950| 64 20 70 72 6f 67 72 61 | 6d 6d 69 6e 67 2c 20 65 |d progra|mming, e|
|00000960| 74 63 2e 0a 0a 20 20 20 | 41 6c 6c 20 76 61 6c 69 |tc... |All vali|
|00000970| 64 61 74 65 64 20 41 64 | 61 20 63 6f 6d 70 69 6c |dated Ad|a compil|
|00000980| 65 72 73 20 28 69 2e 65 | 2e 20 61 20 68 75 67 65 |ers (i.e|. a huge|
|00000990| 20 6d 61 6a 6f 72 69 74 | 79 20 6f 66 20 74 68 65 | majorit|y of the|
|000009a0| 20 63 6f 6d 6d 65 72 63 | 69 61 6c 0a 20 20 20 41 | commerc|ial. A|
|000009b0| 64 61 20 63 6f 6d 70 69 | 6c 65 72 73 29 20 68 61 |da compi|lers) ha|
|000009c0| 76 65 20 70 61 73 73 65 | 64 20 61 20 63 6f 6e 74 |ve passe|d a cont|
|000009d0| 72 6f 6c 6c 65 64 20 76 | 61 6c 69 64 61 74 69 6f |rolled v|alidatio|
|000009e0| 6e 20 70 72 6f 63 65 73 | 73 20 75 73 69 6e 67 20 |n proces|s using |
|000009f0| 61 6e 0a 20 20 20 65 78 | 74 65 6e 73 69 76 65 20 |an. ex|tensive |
|00000a00| 76 61 6c 69 64 61 74 69 | 6f 6e 20 73 75 69 74 65 |validati|on suite|
|00000a10| 2e 20 41 64 61 20 69 73 | 20 6e 6f 74 20 61 20 73 |. Ada is| not a s|
|00000a20| 75 70 65 72 73 65 74 20 | 6f 72 20 65 78 74 65 6e |uperset |or exten|
|00000a30| 73 69 6f 6e 20 6f 66 20 | 61 6e 79 0a 20 20 20 6f |sion of |any. o|
|00000a40| 74 68 65 72 20 6c 61 6e | 67 75 61 67 65 2e 20 41 |ther lan|guage. A|
|00000a50| 64 61 20 64 6f 65 73 20 | 6e 6f 74 20 61 6c 6c 6f |da does |not allo|
|00000a60| 77 20 74 68 65 20 64 61 | 6e 67 65 72 6f 75 73 20 |w the da|ngerous |
|00000a70| 70 72 61 63 74 69 63 65 | 73 20 6f 72 20 65 66 66 |practice|s or eff|
|00000a80| 65 63 74 73 0a 20 20 20 | 6f 66 20 6f 6c 64 20 6c |ects. |of old l|
|00000a90| 61 6e 67 75 61 67 65 73 | 2c 20 61 6c 74 68 6f 75 |anguages|, althou|
|00000aa0| 67 68 20 69 74 20 64 6f | 65 73 20 70 72 6f 76 69 |gh it do|es provi|
|00000ab0| 64 65 20 73 74 61 6e 64 | 61 72 64 69 7a 65 64 20 |de stand|ardized |
|00000ac0| 6d 65 63 68 61 6e 69 73 | 6d 73 20 74 6f 0a 20 20 |mechanis|ms to. |
|00000ad0| 20 69 6e 74 65 72 66 61 | 63 65 20 77 69 74 68 20 | interfa|ce with |
|00000ae0| 6f 74 68 65 72 20 6c 61 | 6e 67 75 61 67 65 73 20 |other la|nguages |
|00000af0| 73 75 63 68 20 61 73 20 | 46 6f 72 74 72 61 6e 2c |such as |Fortran,|
|00000b00| 20 43 6f 62 6f 6c 2c 20 | 61 6e 64 20 43 2e 0a 0a | Cobol, |and C...|
|00000b10| 20 20 20 41 64 61 20 69 | 73 20 72 65 63 6f 67 6e | Ada i|s recogn|
|00000b20| 69 7a 65 64 20 61 73 20 | 61 6e 20 65 78 63 65 6c |ized as |an excel|
|00000b30| 6c 65 6e 74 20 76 65 68 | 69 63 6c 65 20 66 6f 72 |lent veh|icle for|
|00000b40| 20 65 64 75 63 61 74 69 | 6f 6e 20 69 6e 20 70 72 | educati|on in pr|
|00000b50| 6f 67 72 61 6d 6d 69 6e | 67 0a 20 20 20 61 6e 64 |ogrammin|g. and|
|00000b60| 20 73 6f 66 74 77 61 72 | 65 20 65 6e 67 69 6e 65 | softwar|e engine|
|00000b70| 65 72 69 6e 67 2c 20 69 | 6e 63 6c 75 64 69 6e 67 |ering, i|ncluding|
|00000b80| 20 66 6f 72 20 61 20 66 | 69 72 73 74 20 70 72 6f | for a f|irst pro|
|00000b90| 67 72 61 6d 6d 69 6e 67 | 20 63 6f 75 72 73 65 2e |gramming| course.|
|00000ba0| 0a 0a 20 20 20 41 64 61 | 20 69 73 20 64 65 66 69 |.. Ada| is defi|
|00000bb0| 6e 65 64 20 62 79 20 61 | 6e 20 69 6e 74 65 72 6e |ned by a|n intern|
|00000bc0| 61 74 69 6f 6e 61 6c 20 | 73 74 61 6e 64 61 72 64 |ational |standard|
|00000bd0| 20 28 74 68 65 20 6c 61 | 6e 67 75 61 67 65 20 72 | (the la|nguage r|
|00000be0| 65 66 65 72 65 6e 63 65 | 0a 20 20 20 6d 61 6e 75 |eference|. manu|
|00000bf0| 61 6c 2c 20 6f 72 20 4c | 52 4d 29 2c 20 77 68 69 |al, or L|RM), whi|
|00000c00| 63 68 20 68 61 73 20 62 | 65 65 6e 20 72 65 76 69 |ch has b|een revi|
|00000c10| 73 65 64 20 69 6e 20 31 | 39 39 35 2e 20 41 64 61 |sed in 1|995. Ada|
|00000c20| 20 69 73 20 74 61 75 67 | 68 74 20 61 6e 64 0a 20 | is taug|ht and. |
|00000c30| 20 20 75 73 65 64 20 61 | 6c 6c 20 61 72 6f 75 6e | used a|ll aroun|
|00000c40| 64 20 74 68 65 20 77 6f | 72 6c 64 20 28 6e 6f 74 |d the wo|rld (not|
|00000c50| 20 6a 75 73 74 20 69 6e | 20 74 68 65 20 55 53 41 | just in| the USA|
|00000c60| 29 2e 20 41 64 61 20 69 | 73 20 75 73 65 64 20 69 |). Ada i|s used i|
|00000c70| 6e 20 61 20 76 65 72 79 | 0a 20 20 20 77 69 64 65 |n a very|. wide|
|00000c80| 20 72 61 6e 67 65 20 6f | 66 20 61 70 70 6c 69 63 | range o|f applic|
|00000c90| 61 74 69 6f 6e 73 3a 20 | 62 61 6e 6b 69 6e 67 2c |ations: |banking,|
|00000ca0| 20 6d 65 64 69 63 61 6c | 20 64 65 76 69 63 65 73 | medical| devices|
|00000cb0| 2c 0a 20 20 20 74 65 6c | 65 63 6f 6d 6d 75 6e 69 |,. tel|ecommuni|
|00000cc0| 63 61 74 69 6f 6e 73 2c | 20 61 69 72 20 74 72 61 |cations,| air tra|
|00000cd0| 66 66 69 63 20 63 6f 6e | 74 72 6f 6c 2c 20 61 69 |ffic con|trol, ai|
|00000ce0| 72 70 6c 61 6e 65 73 2c | 20 72 61 69 6c 72 6f 61 |rplanes,| railroa|
|00000cf0| 64 0a 20 20 20 73 69 67 | 6e 61 6c 6c 69 6e 67 2c |d. sig|nalling,|
|00000d00| 20 73 61 74 65 6c 6c 69 | 74 65 73 2c 20 72 6f 63 | satelli|tes, roc|
|00000d10| 6b 65 74 73 2c 20 65 74 | 63 2e 0a 0a 20 20 20 54 |kets, et|c... T|
|00000d20| 68 65 20 6c 61 74 65 73 | 74 20 76 65 72 73 69 6f |he lates|t versio|
|00000d30| 6e 20 6f 66 20 74 68 69 | 73 20 46 41 51 20 69 73 |n of thi|s FAQ is|
|00000d40| 20 61 6c 77 61 79 73 20 | 61 63 63 65 73 73 69 62 | always |accessib|
|00000d50| 6c 65 20 74 68 72 6f 75 | 67 68 20 57 57 57 20 61 |le throu|gh WWW a|
|00000d60| 73 0a 20 20 20 68 74 74 | 70 3a 2f 2f 6c 67 6c 77 |s. htt|p://lglw|
|00000d70| 77 77 2e 65 70 66 6c 2e | 63 68 2f 41 64 61 2f 46 |ww.epfl.|ch/Ada/F|
|00000d80| 41 51 2f 70 72 6f 67 72 | 61 6d 6d 69 6e 67 2e 68 |AQ/progr|amming.h|
|00000d90| 74 6d 6c 23 74 69 74 6c | 65 0a 0a 4d 61 69 6e 74 |tml#titl|e..Maint|
|00000da0| 65 6e 61 6e 63 65 0a 0a | 20 20 20 54 68 69 73 20 |enance..| This |
|00000db0| 46 41 51 20 69 73 20 6d | 61 69 6e 74 61 69 6e 65 |FAQ is m|aintaine|
|00000dc0| 64 20 6f 6e 20 61 6e 20 | 69 6e 64 69 76 69 64 75 |d on an |individu|
|00000dd0| 61 6c 20 76 6f 6c 75 6e | 74 65 65 72 20 62 61 73 |al volun|teer bas|
|00000de0| 69 73 2c 20 62 79 20 4d | 61 67 6e 75 73 0a 20 20 |is, by M|agnus. |
|00000df0| 20 4b 65 6d 70 65 20 28 | 4d 61 67 6e 75 73 2e 4b | Kempe (|Magnus.K|
|00000e00| 65 6d 70 65 40 64 69 2e | 65 70 66 6c 2e 63 68 29 |empe@di.|epfl.ch)|
|00000e10| 2e 20 5b 4e 6f 74 65 3a | 20 54 68 69 73 20 69 73 |. [Note:| This is|
|00000e20| 20 64 6f 6e 65 20 61 73 | 20 61 20 68 6f 62 62 79 | done as| a hobby|
|00000e30| 2c 20 6e 6f 74 0a 20 20 | 20 69 6e 20 6d 79 20 63 |, not. | in my c|
|00000e40| 61 70 61 63 69 74 79 20 | 61 73 20 61 6e 20 65 6d |apacity |as an em|
|00000e50| 70 6c 6f 79 65 65 20 61 | 74 20 74 68 65 20 53 77 |ployee a|t the Sw|
|00000e60| 69 73 73 20 46 65 64 65 | 72 61 6c 20 49 6e 73 74 |iss Fede|ral Inst|
|00000e70| 69 74 75 74 65 20 6f 66 | 0a 20 20 20 54 65 63 68 |itute of|. Tech|
|00000e80| 6e 6f 6c 6f 67 79 2e 20 | 2d 2d 4d 4b 5d 0a 0a 20 |nology. |--MK].. |
|00000e90| 20 20 54 68 65 20 63 6f | 64 69 6e 67 20 73 74 79 | The co|ding sty|
|00000ea0| 6c 65 20 75 73 65 64 20 | 69 6e 20 6d 6f 73 74 20 |le used |in most |
|00000eb0| 6f 66 20 74 68 65 20 65 | 78 61 6d 70 6c 65 20 41 |of the e|xample A|
|00000ec0| 64 61 20 63 6f 64 65 20 | 69 73 20 6d 79 20 6f 77 |da code |is my ow|
|00000ed0| 6e 2c 20 61 6e 64 0a 20 | 20 20 79 6f 75 27 6c 6c |n, and. | you'll|
|00000ee0| 20 68 61 76 65 20 74 6f | 20 6c 69 76 65 20 77 69 | have to| live wi|
|00000ef0| 74 68 20 69 74 20 28 79 | 6f 75 20 6d 61 79 20 77 |th it (y|ou may w|
|00000f00| 61 6e 74 20 74 6f 20 61 | 64 6f 70 74 20 69 74 20 |ant to a|dopt it |
|00000f10| 3a 2d 29 2e 0a 0a 0a 20 | 20 20 20 20 5f 5f 5f 5f |:-).... | ____|
|00000f20| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000f30| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000f40| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000f50| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 0a 0a 20 |________|_____.. |
|00000f60| 20 20 4f 70 69 6e 69 6f | 6e 73 20 28 69 66 20 61 | Opinio|ns (if a|
|00000f70| 6e 79 29 20 65 78 70 72 | 65 73 73 65 64 20 61 72 |ny) expr|essed ar|
|00000f80| 65 20 74 68 6f 73 65 20 | 6f 66 20 74 68 65 20 73 |e those |of the s|
|00000f90| 75 62 6d 69 74 74 65 72 | 73 20 61 6e 64 2f 6f 72 |ubmitter|s and/or|
|00000fa0| 0a 20 20 20 6d 61 69 6e | 74 61 69 6e 65 72 2e 0a |. main|tainer..|
|00000fb0| 20 20 20 20 20 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f | ___|________|
|00000fc0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000fd0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000fe0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00000ff0| 5f 5f 5f 5f 5f 5f 0a 0a | 54 61 62 6c 65 20 6f 66 |______..|Table of|
|00001000| 20 43 6f 6e 74 65 6e 74 | 73 3a 0a 0a 20 20 20 20 | Content|s:.. |
|00001010| 20 2a 20 31 3a 20 52 65 | 63 65 6e 74 20 63 68 61 | * 1: Re|cent cha|
|00001020| 6e 67 65 73 20 74 6f 20 | 74 68 69 73 20 46 41 51 |nges to |this FAQ|
|00001030| 0a 0a 20 20 20 20 20 2a | 20 32 3a 20 49 6e 66 6f |.. *| 2: Info|
|00001040| 72 6d 61 74 69 6f 6e 20 | 61 62 6f 75 74 20 74 68 |rmation |about th|
|00001050| 69 73 20 64 6f 63 75 6d | 65 6e 74 0a 0a 20 20 20 |is docum|ent.. |
|00001060| 20 20 2a 20 33 3a 20 45 | 6c 65 6d 65 6e 74 61 72 | * 3: E|lementar|
|00001070| 79 20 51 75 65 73 74 69 | 6f 6e 73 0a 20 20 20 20 |y Questi|ons. |
|00001080| 20 20 20 20 20 20 2b 20 | 33 2e 31 3a 20 48 6f 77 | + |3.1: How|
|00001090| 20 64 6f 20 49 20 6d 61 | 6b 65 20 6f 70 65 72 61 | do I ma|ke opera|
|000010a0| 74 69 6f 6e 73 20 64 69 | 72 65 63 74 6c 79 20 76 |tions di|rectly v|
|000010b0| 69 73 69 62 6c 65 20 77 | 69 74 68 6f 75 74 0a 20 |isible w|ithout. |
|000010c0| 20 20 20 20 20 20 20 20 | 20 20 20 22 75 73 65 22 | | "use"|
|000010d0| 69 6e 67 20 61 20 70 61 | 63 6b 61 67 65 3f 0a 20 |ing a pa|ckage?. |
|000010e0| 20 20 20 20 20 20 20 20 | 20 2b 20 33 2e 32 3a 20 | | + 3.2: |
|000010f0| 48 6f 77 20 64 6f 20 49 | 20 61 73 73 69 67 6e 20 |How do I| assign |
|00001100| 74 6f 20 61 6e 20 61 72 | 72 61 79 20 6f 66 20 6c |to an ar|ray of l|
|00001110| 65 6e 67 74 68 20 31 3f | 0a 20 20 20 20 20 20 20 |ength 1?|. |
|00001120| 20 20 20 2b 20 33 2e 33 | 3a 20 48 6f 77 20 64 6f | + 3.3|: How do|
|00001130| 20 49 20 63 72 65 61 74 | 65 20 61 20 43 2d 73 74 | I creat|e a C-st|
|00001140| 79 6c 65 20 6e 75 6c 2d | 74 65 72 6d 69 6e 61 74 |yle nul-|terminat|
|00001150| 65 64 20 73 74 72 69 6e | 67 3f 0a 20 20 20 20 20 |ed strin|g?. |
|00001160| 20 20 20 20 20 2b 20 33 | 2e 34 3a 20 48 6f 77 20 | + 3|.4: How |
|00001170| 63 61 6e 20 49 20 63 72 | 65 61 74 65 20 61 6e 20 |can I cr|eate an |
|00001180| 61 72 72 61 79 20 6f 66 | 20 73 74 72 69 6e 67 73 |array of| strings|
|00001190| 20 6f 66 20 76 61 72 69 | 6f 75 73 20 6c 65 6e 67 | of vari|ous leng|
|000011a0| 74 68 3f 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |th?. | + |
|000011b0| 33 2e 35 3a 20 49 20 6b | 6e 6f 77 20 61 6e 20 65 |3.5: I k|now an e|
|000011c0| 78 63 65 70 74 69 6f 6e | 20 69 73 20 72 61 69 73 |xception| is rais|
|000011d0| 65 64 2c 20 62 75 74 20 | 6d 79 20 70 72 6f 67 72 |ed, but |my progr|
|000011e0| 61 6d 20 71 75 69 74 73 | 20 77 69 74 68 0a 20 20 |am quits| with. |
|000011f0| 20 20 20 20 20 20 20 20 | 20 20 6e 6f 20 77 61 72 | | no war|
|00001200| 6e 69 6e 67 2e 20 57 68 | 79 3f 0a 20 20 20 20 20 |ning. Wh|y?. |
|00001210| 20 20 20 20 20 2b 20 33 | 2e 36 3a 20 49 20 68 61 | + 3|.6: I ha|
|00001220| 76 65 20 6f 6e 6c 79 20 | 6f 6e 65 20 74 61 73 6b |ve only |one task|
|00001230| 20 69 6e 20 6d 79 20 70 | 72 6f 67 72 61 6d 2c 20 | in my p|rogram, |
|00001240| 62 75 74 20 69 74 20 64 | 6f 65 73 6e 27 74 20 73 |but it d|oesn't s|
|00001250| 65 65 6d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |eem. | |
|00001260| 74 6f 20 72 75 6e 2e 20 | 57 68 79 3f 0a 20 20 20 |to run. |Why?. |
|00001270| 20 20 20 20 20 20 20 2b | 20 33 2e 37 3a 20 48 6f | +| 3.7: Ho|
|00001280| 77 20 64 6f 20 49 20 69 | 6e 63 72 65 61 73 65 20 |w do I i|ncrease |
|00001290| 74 68 65 20 73 74 61 63 | 6b 20 73 69 7a 65 20 66 |the stac|k size f|
|000012a0| 6f 72 20 61 20 74 61 73 | 6b 3f 0a 20 20 20 20 20 |or a tas|k?. |
|000012b0| 20 20 20 20 20 2b 20 33 | 2e 38 3a 20 57 68 61 74 | + 3|.8: What|
|000012c0| 27 73 20 74 68 65 20 64 | 69 66 66 65 72 65 6e 63 |'s the d|ifferenc|
|000012d0| 65 20 62 65 74 77 65 65 | 6e 20 61 20 74 79 70 65 |e betwee|n a type|
|000012e0| 20 63 6f 6e 76 65 72 73 | 69 6f 6e 20 61 6e 64 20 | convers|ion and |
|000012f0| 61 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 71 75 |a. | qu|
|00001300| 61 6c 69 66 69 65 72 3f | 0a 20 20 20 20 20 20 20 |alifier?|. |
|00001310| 20 20 20 2b 20 33 2e 39 | 3a 20 48 6f 77 20 64 6f | + 3.9|: How do|
|00001320| 20 49 20 61 76 6f 69 64 | 20 74 68 65 20 70 6f 74 | I avoid| the pot|
|00001330| 65 6e 74 69 61 6c 20 73 | 70 61 63 65 20 69 6e 20 |ential s|pace in |
|00001340| 66 72 6f 6e 74 20 6f 66 | 0a 20 20 20 20 20 20 20 |front of|. |
|00001350| 20 20 20 20 20 49 6e 74 | 65 67 65 72 27 49 6d 61 | Int|eger'Ima|
|00001360| 67 65 3f 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |ge?. | + |
|00001370| 33 2e 31 30 3a 20 57 68 | 79 20 69 73 20 61 6e 20 |3.10: Wh|y is an |
|00001380| 65 78 63 65 70 74 69 6f | 6e 20 72 61 69 73 65 64 |exceptio|n raised|
|00001390| 20 77 68 65 6e 20 67 69 | 76 69 6e 67 20 61 20 64 | when gi|ving a d|
|000013a0| 65 66 61 75 6c 74 0a 20 | 20 20 20 20 20 20 20 20 |efault. | |
|000013b0| 20 20 20 64 69 73 63 72 | 69 6d 69 6e 61 6e 74 3f | discr|iminant?|
|000013c0| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 33 2e 31 |. | + 3.1|
|000013d0| 31 3a 20 57 68 65 6e 20 | 49 20 77 61 6e 74 20 61 |1: When |I want a|
|000013e0| 6e 20 49 6e 74 65 67 65 | 72 20 74 79 70 65 2c 20 |n Intege|r type, |
|000013f0| 77 68 61 74 27 73 20 77 | 72 6f 6e 67 20 77 69 74 |what's w|rong wit|
|00001400| 68 20 6a 75 73 74 0a 20 | 20 20 20 20 20 20 20 20 |h just. | |
|00001410| 20 20 20 75 73 69 6e 67 | 20 74 68 65 20 70 72 65 | using| the pre|
|00001420| 64 65 66 69 6e 65 64 20 | 74 79 70 65 20 49 6e 74 |defined |type Int|
|00001430| 65 67 65 72 20 6f 72 20 | 4c 6f 6e 67 5f 49 6e 74 |eger or |Long_Int|
|00001440| 65 67 65 72 3f 20 57 68 | 79 20 77 6f 75 6c 64 0a |eger? Wh|y would.|
|00001450| 20 20 20 20 20 20 20 20 | 20 20 20 20 49 20 65 76 | | I ev|
|00001460| 65 72 20 77 61 6e 74 20 | 74 6f 20 64 65 63 6c 61 |er want |to decla|
|00001470| 72 65 20 6e 65 77 20 49 | 6e 74 65 67 65 72 20 74 |re new I|nteger t|
|00001480| 79 70 65 73 3f 0a 20 20 | 20 20 20 20 20 20 20 20 |ypes?. | |
|00001490| 2b 20 33 2e 31 32 3a 20 | 53 69 6e 63 65 20 49 20 |+ 3.12: |Since I |
|000014a0| 63 61 6e 20 61 6c 77 61 | 79 73 20 64 65 63 6c 61 |can alwa|ys decla|
|000014b0| 72 65 20 6d 79 20 6f 77 | 6e 20 70 6f 72 74 61 62 |re my ow|n portab|
|000014c0| 6c 65 20 69 6e 74 65 67 | 65 72 0a 20 20 20 20 20 |le integ|er. |
|000014d0| 20 20 20 20 20 20 20 74 | 79 70 65 73 2c 20 77 68 | t|ypes, wh|
|000014e0| 79 20 77 6f 75 6c 64 20 | 49 20 65 76 65 72 20 77 |y would |I ever w|
|000014f0| 61 6e 74 20 74 6f 20 75 | 73 65 20 74 68 65 20 70 |ant to u|se the p|
|00001500| 72 65 64 65 66 69 6e 65 | 64 20 74 79 70 65 0a 20 |redefine|d type. |
|00001510| 20 20 20 20 20 20 20 20 | 20 20 20 49 6e 74 65 67 | | Integ|
|00001520| 65 72 3f 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |er?. | + |
|00001530| 33 2e 31 33 3a 20 49 20 | 61 6d 20 6c 65 61 72 6e |3.13: I |am learn|
|00001540| 69 6e 67 20 41 64 61 2e | 20 43 61 6e 20 49 20 65 |ing Ada.| Can I e|
|00001550| 78 70 65 72 69 6d 65 6e | 74 20 77 69 74 68 20 61 |xperimen|t with a|
|00001560| 20 67 61 6d 65 0a 20 20 | 20 20 20 20 20 20 20 20 | game. | |
|00001570| 20 20 70 72 6f 67 72 61 | 6d 3f 0a 20 20 20 20 20 | progra|m?. |
|00001580| 20 20 20 20 20 2b 20 33 | 2e 31 34 3a 20 48 6f 77 | + 3|.14: How|
|00001590| 20 63 61 6e 20 49 20 64 | 6f 20 61 20 6e 6f 6e 2d | can I d|o a non-|
|000015a0| 62 6c 6f 63 6b 69 6e 67 | 2c 20 6b 65 79 73 74 72 |blocking|, keystr|
|000015b0| 6f 6b 65 2d 61 74 2d 61 | 2d 74 69 6d 65 20 72 65 |oke-at-a|-time re|
|000015c0| 61 64 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 66 |ad. | f|
|000015d0| 72 6f 6d 20 74 68 65 20 | 74 65 72 6d 69 6e 61 6c |rom the |terminal|
|000015e0| 3f 0a 0a 0a 20 20 20 20 | 20 2a 20 34 3a 20 41 64 |?... | * 4: Ad|
|000015f0| 76 61 6e 74 61 67 65 73 | 20 6f 66 20 41 64 61 0a |vantages| of Ada.|
|00001600| 20 20 20 20 20 20 20 20 | 20 20 2b 20 34 2e 31 3a | | + 4.1:|
|00001610| 20 57 68 79 20 75 73 65 | 20 41 64 61 3f 0a 20 20 | Why use| Ada?. |
|00001620| 20 20 20 20 20 20 20 20 | 2b 20 34 2e 32 3a 20 41 | |+ 4.2: A|
|00001630| 64 61 20 73 65 65 6d 73 | 20 6c 61 72 67 65 20 61 |da seems| large a|
|00001640| 6e 64 20 63 6f 6d 70 6c | 65 78 2c 20 77 68 79 20 |nd compl|ex, why |
|00001650| 69 73 20 69 74 20 74 68 | 69 73 20 77 61 79 3f 0a |is it th|is way?.|
|00001660| 20 20 20 20 20 20 20 20 | 20 20 2b 20 34 2e 33 3a | | + 4.3:|
|00001670| 20 49 73 20 74 68 65 72 | 65 20 61 20 63 6f 6e 74 | Is ther|e a cont|
|00001680| 65 73 74 20 77 69 74 68 | 20 66 61 6d 65 20 61 6e |est with| fame an|
|00001690| 64 20 6d 6f 6e 65 79 20 | 66 6f 72 20 67 6f 6f 64 |d money |for good|
|000016a0| 20 41 64 61 0a 20 20 20 | 20 20 20 20 20 20 20 20 | Ada. | |
|000016b0| 20 70 72 6f 67 72 61 6d | 6d 65 72 73 3f 0a 0a 0a | program|mers?...|
|000016c0| 20 20 20 20 20 2a 20 35 | 3a 20 4f 62 6a 65 63 74 | * 5|: Object|
|000016d0| 2d 4f 72 69 65 6e 74 65 | 64 20 50 72 6f 67 72 61 |-Oriente|d Progra|
|000016e0| 6d 6d 69 6e 67 20 77 69 | 74 68 20 41 64 61 0a 20 |mming wi|th Ada. |
|000016f0| 20 20 20 20 20 20 20 20 | 20 2b 20 35 2e 31 3a 20 | | + 5.1: |
|00001700| 57 68 79 20 64 6f 65 73 | 20 41 64 61 20 68 61 76 |Why does| Ada hav|
|00001710| 65 20 22 74 61 67 67 65 | 64 20 74 79 70 65 73 22 |e "tagge|d types"|
|00001720| 20 69 6e 73 74 65 61 64 | 20 6f 66 20 63 6c 61 73 | instead| of clas|
|00001730| 73 65 73 3f 0a 20 20 20 | 20 20 20 20 20 20 20 2b |ses?. | +|
|00001740| 20 35 2e 32 3a 20 56 61 | 72 69 61 6e 74 20 72 65 | 5.2: Va|riant re|
|00001750| 63 6f 72 64 73 20 73 65 | 65 6d 20 6c 69 6b 65 20 |cords se|em like |
|00001760| 61 20 64 65 61 64 20 66 | 65 61 74 75 72 65 20 6e |a dead f|eature n|
|00001770| 6f 77 2e 20 57 68 65 6e | 0a 20 20 20 20 20 20 20 |ow. When|. |
|00001780| 20 20 20 20 20 73 68 6f | 75 6c 64 20 49 20 75 73 | sho|uld I us|
|00001790| 65 20 74 68 65 6d 20 69 | 6e 73 74 65 61 64 20 6f |e them i|nstead o|
|000017a0| 66 20 74 61 67 67 65 64 | 20 74 79 70 65 73 3f 0a |f tagged| types?.|
|000017b0| 20 20 20 20 20 20 20 20 | 20 20 2b 20 35 2e 33 3a | | + 5.3:|
|000017c0| 20 57 68 61 74 20 69 73 | 20 6d 65 61 6e 74 20 62 | What is| meant b|
|000017d0| 79 20 22 69 6e 74 65 72 | 66 61 63 65 20 69 6e 68 |y "inter|face inh|
|000017e0| 65 72 69 74 61 6e 63 65 | 22 20 61 6e 64 20 68 6f |eritance|" and ho|
|000017f0| 77 20 64 6f 65 73 0a 20 | 20 20 20 20 20 20 20 20 |w does. | |
|00001800| 20 20 20 41 64 61 20 73 | 75 70 70 6f 72 74 20 69 | Ada s|upport i|
|00001810| 74 3f 0a 20 20 20 20 20 | 20 20 20 20 20 2b 20 35 |t?. | + 5|
|00001820| 2e 34 3a 20 48 6f 77 20 | 64 6f 20 79 6f 75 20 64 |.4: How |do you d|
|00001830| 6f 20 6d 75 6c 74 69 70 | 6c 65 20 69 6e 68 65 72 |o multip|le inher|
|00001840| 69 74 61 6e 63 65 20 69 | 6e 20 41 64 61 20 39 58 |itance i|n Ada 9X|
|00001850| 3f 0a 20 20 20 20 20 20 | 20 20 20 20 2b 20 35 2e |?. | + 5.|
|00001860| 35 3a 20 57 68 79 20 61 | 72 65 20 43 6f 6e 74 72 |5: Why a|re Contr|
|00001870| 6f 6c 6c 65 64 20 74 79 | 70 65 73 20 73 6f 2c 20 |olled ty|pes so, |
|00001880| 77 65 6c 6c 2c 20 73 74 | 72 61 6e 67 65 3f 0a 20 |well, st|range?. |
|00001890| 20 20 20 20 20 20 20 20 | 20 2b 20 35 2e 36 3a 20 | | + 5.6: |
|000018a0| 57 68 61 74 20 64 6f 20 | 22 63 6f 76 61 72 69 61 |What do |"covaria|
|000018b0| 6e 63 65 22 20 61 6e 64 | 20 22 63 6f 6e 74 72 61 |nce" and| "contra|
|000018c0| 76 61 72 69 61 6e 63 65 | 22 20 6d 65 61 6e 2c 20 |variance|" mean, |
|000018d0| 61 6e 64 20 64 6f 65 73 | 0a 20 20 20 20 20 20 20 |and does|. |
|000018e0| 20 20 20 20 20 41 64 61 | 20 73 75 70 70 6f 72 74 | Ada| support|
|000018f0| 20 65 69 74 68 65 72 20 | 6f 72 20 62 6f 74 68 3f | either |or both?|
|00001900| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 35 2e 37 |. | + 5.7|
|00001910| 3a 20 57 68 61 74 20 69 | 73 20 6d 65 61 6e 74 20 |: What i|s meant |
|00001920| 62 79 20 75 70 63 61 73 | 74 69 6e 67 2f 65 78 70 |by upcas|ting/exp|
|00001930| 61 6e 64 69 6e 67 20 61 | 6e 64 0a 20 20 20 20 20 |anding a|nd. |
|00001940| 20 20 20 20 20 20 20 64 | 6f 77 6e 63 61 73 74 69 | d|owncasti|
|00001950| 6e 67 2f 6e 61 72 72 6f | 77 69 6e 67 3f 0a 20 20 |ng/narro|wing?. |
|00001960| 20 20 20 20 20 20 20 20 | 2b 20 35 2e 38 3a 20 48 | |+ 5.8: H|
|00001970| 6f 77 20 64 6f 65 73 20 | 41 64 61 20 64 6f 20 22 |ow does |Ada do "|
|00001980| 6e 61 72 72 6f 77 69 6e | 67 22 3f 0a 20 20 20 20 |narrowin|g"?. |
|00001990| 20 20 20 20 20 20 2b 20 | 35 2e 39 3a 20 57 68 61 | + |5.9: Wha|
|000019a0| 74 20 69 73 20 74 68 65 | 20 64 69 66 66 65 72 65 |t is the| differe|
|000019b0| 6e 63 65 20 62 65 74 77 | 65 65 6e 20 61 20 63 6c |nce betw|een a cl|
|000019c0| 61 73 73 2d 77 69 64 65 | 20 61 63 63 65 73 73 20 |ass-wide| access |
|000019d0| 74 79 70 65 0a 20 20 20 | 20 20 20 20 20 20 20 20 |type. | |
|000019e0| 20 61 6e 64 20 61 20 22 | 67 65 6e 65 72 61 6c 22 | and a "|general"|
|000019f0| 20 63 6c 61 73 73 2d 77 | 69 64 65 20 61 63 63 65 | class-w|ide acce|
|00001a00| 73 73 20 74 79 70 65 3f | 0a 0a 0a 20 20 20 20 20 |ss type?|... |
|00001a10| 2a 20 36 3a 20 41 64 61 | 20 4e 75 6d 65 72 69 63 |* 6: Ada| Numeric|
|00001a20| 73 0a 20 20 20 20 20 20 | 20 20 20 20 2b 20 36 2e |s. | + 6.|
|00001a30| 31 3a 20 57 68 65 72 65 | 20 63 61 6e 20 49 20 66 |1: Where| can I f|
|00001a40| 69 6e 64 20 61 6e 6f 6e | 79 6d 6f 75 73 20 66 74 |ind anon|ymous ft|
|00001a50| 70 20 73 69 74 65 73 20 | 66 6f 72 20 41 64 61 20 |p sites |for Ada |
|00001a60| 6d 61 74 68 0a 20 20 20 | 20 20 20 20 20 20 20 20 |math. | |
|00001a70| 20 70 61 63 6b 61 67 65 | 73 3f 20 49 6e 20 70 61 | package|s? In pa|
|00001a80| 72 74 69 63 75 6c 61 72 | 20 77 68 65 72 65 20 61 |rticular| where a|
|00001a90| 72 65 20 74 68 65 20 72 | 61 6e 64 6f 6d 20 6e 75 |re the r|andom nu|
|00001aa0| 6d 62 65 72 0a 20 20 20 | 20 20 20 20 20 20 20 20 |mber. | |
|00001ab0| 20 67 65 6e 65 72 61 74 | 6f 72 73 3f 0a 20 20 20 | generat|ors?. |
|00001ac0| 20 20 20 20 20 20 20 2b | 20 36 2e 32 3a 20 48 6f | +| 6.2: Ho|
|00001ad0| 77 20 63 61 6e 20 49 20 | 77 72 69 74 65 20 70 6f |w can I |write po|
|00001ae0| 72 74 61 62 6c 65 20 63 | 6f 64 65 20 69 6e 20 41 |rtable c|ode in A|
|00001af0| 64 61 20 38 33 20 75 73 | 69 6e 67 20 70 72 65 64 |da 83 us|ing pred|
|00001b00| 65 66 69 6e 65 64 0a 20 | 20 20 20 20 20 20 20 20 |efined. | |
|00001b10| 20 20 20 74 79 70 65 73 | 20 6c 69 6b 65 20 46 6c | types| like Fl|
|00001b20| 6f 61 74 20 61 6e 64 20 | 4c 6f 6e 67 5f 46 6c 6f |oat and |Long_Flo|
|00001b30| 61 74 3f 20 4c 69 6b 65 | 77 69 73 65 2c 20 68 6f |at? Like|wise, ho|
|00001b40| 77 20 63 61 6e 20 49 20 | 77 72 69 74 65 0a 20 20 |w can I |write. |
|00001b50| 20 20 20 20 20 20 20 20 | 20 20 70 6f 72 74 61 62 | | portab|
|00001b60| 6c 65 20 63 6f 64 65 20 | 74 68 61 74 20 75 73 65 |le code |that use|
|00001b70| 73 20 4d 61 74 68 20 66 | 75 6e 63 74 69 6f 6e 73 |s Math f|unctions|
|00001b80| 20 6c 69 6b 65 20 53 69 | 6e 20 61 6e 64 20 4c 6f | like Si|n and Lo|
|00001b90| 67 20 74 68 61 74 0a 20 | 20 20 20 20 20 20 20 20 |g that. | |
|00001ba0| 20 20 20 61 72 65 20 64 | 65 66 69 6e 65 64 20 66 | are d|efined f|
|00001bb0| 6f 72 20 46 6c 6f 61 74 | 20 61 6e 64 20 4c 6f 6e |or Float| and Lon|
|00001bc0| 67 5f 46 6c 6f 61 74 3f | 0a 20 20 20 20 20 20 20 |g_Float?|. |
|00001bd0| 20 20 20 2b 20 36 2e 33 | 3a 20 49 73 20 41 64 61 | + 6.3|: Is Ada|
|00001be0| 20 61 6e 79 20 67 6f 6f | 64 20 61 74 20 6e 75 6d | any goo|d at num|
|00001bf0| 65 72 69 63 73 2c 20 61 | 6e 64 20 77 68 65 72 65 |erics, a|nd where|
|00001c00| 20 63 61 6e 20 49 20 6c | 65 61 72 6e 20 6d 6f 72 | can I l|earn mor|
|00001c10| 65 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 61 62 |e. | ab|
|00001c20| 6f 75 74 20 69 74 3f 0a | 20 20 20 20 20 20 20 20 |out it?.| |
|00001c30| 20 20 2b 20 36 2e 34 3a | 20 48 6f 77 20 64 6f 20 | + 6.4:| How do |
|00001c40| 49 20 67 65 74 20 52 65 | 61 6c 20 76 61 6c 75 65 |I get Re|al value|
|00001c50| 64 20 61 6e 64 20 43 6f | 6d 70 6c 65 78 20 76 61 |d and Co|mplex va|
|00001c60| 6c 75 65 64 20 6d 61 74 | 68 0a 20 20 20 20 20 20 |lued mat|h. |
|00001c70| 20 20 20 20 20 20 66 75 | 6e 63 74 69 6f 6e 73 20 | fu|nctions |
|00001c80| 69 6e 20 41 64 61 20 39 | 35 3f 0a 20 20 20 20 20 |in Ada 9|5?. |
|00001c90| 20 20 20 20 20 2b 20 36 | 2e 35 3a 20 57 68 61 74 | + 6|.5: What|
|00001ca0| 20 6c 69 62 72 61 72 69 | 65 73 20 6f 72 20 70 75 | librari|es or pu|
|00001cb0| 62 6c 69 63 20 61 6c 67 | 6f 72 69 74 68 6d 73 20 |blic alg|orithms |
|00001cc0| 65 78 69 73 74 20 66 6f | 72 20 41 64 61 3f 0a 0a |exist fo|r Ada?..|
|00001cd0| 0a 20 20 20 20 20 2a 20 | 37 3a 20 45 66 66 69 63 |. * |7: Effic|
|00001ce0| 69 65 6e 63 79 20 6f 66 | 20 41 64 61 20 43 6f 6e |iency of| Ada Con|
|00001cf0| 73 74 72 75 63 74 73 0a | 20 20 20 20 20 20 20 20 |structs.| |
|00001d00| 20 20 2b 20 37 2e 31 3a | 20 48 6f 77 20 6d 75 63 | + 7.1:| How muc|
|00001d10| 68 20 65 78 74 72 61 20 | 6f 76 65 72 68 65 61 64 |h extra |overhead|
|00001d20| 20 64 6f 20 67 65 6e 65 | 72 69 63 73 20 68 61 76 | do gene|rics hav|
|00001d30| 65 3f 0a 20 20 20 20 20 | 20 20 20 20 20 2b 20 37 |e?. | + 7|
|00001d40| 2e 32 3a 20 48 6f 77 20 | 64 6f 65 73 20 41 64 61 |.2: How |does Ada|
|00001d50| 20 63 6f 6d 70 61 72 65 | 20 74 6f 20 6f 74 68 65 | compare| to othe|
|00001d60| 72 20 6c 61 6e 67 75 61 | 67 65 73 20 69 6e 20 65 |r langua|ges in e|
|00001d70| 66 66 69 63 69 65 6e 63 | 79 20 6f 66 0a 20 20 20 |fficienc|y of. |
|00001d80| 20 20 20 20 20 20 20 20 | 20 63 6f 64 65 3f 0a 0a | | code?..|
|00001d90| 0a 20 20 20 20 20 2a 20 | 38 3a 20 41 64 76 61 6e |. * |8: Advan|
|00001da0| 63 65 64 20 50 72 6f 67 | 72 61 6d 6d 69 6e 67 20 |ced Prog|ramming |
|00001db0| 54 65 63 68 6e 69 71 75 | 65 73 20 77 69 74 68 20 |Techniqu|es with |
|00001dc0| 41 64 61 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |Ada. | + |
|00001dd0| 38 2e 31 3a 20 48 6f 77 | 20 63 61 6e 20 49 20 72 |8.1: How| can I r|
|00001de0| 65 64 65 66 69 6e 65 20 | 74 68 65 20 61 73 73 69 |edefine |the assi|
|00001df0| 67 6e 6d 65 6e 74 20 6f | 70 65 72 61 74 69 6f 6e |gnment o|peration|
|00001e00| 3f 0a 20 20 20 20 20 20 | 20 20 20 20 2b 20 38 2e |?. | + 8.|
|00001e10| 32 3a 20 44 6f 65 73 20 | 41 64 61 20 68 61 76 65 |2: Does |Ada have|
|00001e20| 20 61 75 74 6f 6d 61 74 | 69 63 20 63 6f 6e 73 74 | automat|ic const|
|00001e30| 72 75 63 74 6f 72 73 20 | 61 6e 64 20 64 65 73 74 |ructors |and dest|
|00001e40| 72 75 63 74 6f 72 73 3f | 0a 20 20 20 20 20 20 20 |ructors?|. |
|00001e50| 20 20 20 2b 20 38 2e 33 | 3a 20 53 68 6f 75 6c 64 | + 8.3|: Should|
|00001e60| 20 49 20 73 74 69 63 6b | 20 74 6f 20 61 20 6f 6e | I stick| to a on|
|00001e70| 65 20 70 61 63 6b 61 67 | 65 2c 20 6f 6e 65 20 74 |e packag|e, one t|
|00001e80| 79 70 65 20 61 70 70 72 | 6f 61 63 68 20 77 68 69 |ype appr|oach whi|
|00001e90| 6c 65 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 77 |le. | w|
|00001ea0| 72 69 74 69 6e 67 20 41 | 64 61 20 73 6f 66 74 77 |riting A|da softw|
|00001eb0| 61 72 65 3f 0a 20 20 20 | 20 20 20 20 20 20 20 2b |are?. | +|
|00001ec0| 20 38 2e 34 3a 20 57 68 | 61 74 20 69 73 20 74 68 | 8.4: Wh|at is th|
|00001ed0| 65 20 22 42 65 61 75 6a | 6f 6c 61 69 73 20 45 66 |e "Beauj|olais Ef|
|00001ee0| 66 65 63 74 22 3f 0a 20 | 20 20 20 20 20 20 20 20 |fect"?. | |
|00001ef0| 20 2b 20 38 2e 35 3a 20 | 57 68 61 74 20 61 62 6f | + 8.5: |What abo|
|00001f00| 75 74 20 74 68 65 20 22 | 52 69 70 70 6c 65 20 45 |ut the "|Ripple E|
|00001f10| 66 66 65 63 74 22 3f 0a | 20 20 20 20 20 20 20 20 |ffect"?.| |
|00001f20| 20 20 2b 20 38 2e 36 3a | 20 48 6f 77 20 74 6f 20 | + 8.6:| How to |
|00001f30| 77 72 69 74 65 20 61 6e | 20 41 64 61 20 70 72 6f |write an| Ada pro|
|00001f40| 67 72 61 6d 20 74 6f 20 | 63 6f 6d 70 75 74 65 20 |gram to |compute |
|00001f50| 77 68 65 6e 20 6f 6e 65 | 20 68 61 73 20 68 61 64 |when one| has had|
|00001f60| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 74 6f 6f |. | too|
|00001f70| 20 6d 75 63 68 20 61 6c | 63 6f 68 6f 6c 20 74 6f | much al|cohol to|
|00001f80| 20 6c 65 67 61 6c 6c 79 | 20 64 72 69 76 65 3f 0a | legally| drive?.|
|00001f90| 20 20 20 20 20 20 20 20 | 20 20 2b 20 38 2e 37 3a | | + 8.7:|
|00001fa0| 20 44 6f 65 73 20 41 64 | 61 20 68 61 76 65 20 6d | Does Ad|a have m|
|00001fb0| 61 63 72 6f 73 3f 0a 0a | 0a 20 20 20 20 20 2a 20 |acros?..|. * |
|00001fc0| 39 3a 20 41 64 61 20 61 | 6e 64 20 4f 74 68 65 72 |9: Ada a|nd Other|
|00001fd0| 20 50 72 6f 67 72 61 6d | 6d 69 6e 67 20 4c 61 6e | Program|ming Lan|
|00001fe0| 67 75 61 67 65 73 0a 20 | 20 20 20 20 20 20 20 20 |guages. | |
|00001ff0| 20 2b 20 39 2e 31 3a 20 | 57 68 65 72 65 20 63 61 | + 9.1: |Where ca|
|00002000| 6e 20 49 20 66 69 6e 64 | 20 70 72 6f 67 72 61 6d |n I find| program|
|00002010| 73 20 74 68 61 74 20 77 | 69 6c 6c 20 74 72 61 6e |s that w|ill tran|
|00002020| 73 6c 61 74 65 20 66 72 | 6f 6d 20 5b 73 6f 6d 65 |slate fr|om [some|
|00002030| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 6c 61 6e |. | lan|
|00002040| 67 75 61 67 65 5d 20 74 | 6f 20 41 64 61 3f 0a 20 |guage] t|o Ada?. |
|00002050| 20 20 20 20 20 20 20 20 | 20 2b 20 39 2e 32 3a 20 | | + 9.2: |
|00002060| 48 6f 77 20 63 61 6e 20 | 49 20 63 6f 6e 76 65 72 |How can |I conver|
|00002070| 74 20 41 64 61 20 38 33 | 20 73 6f 75 72 63 65 73 |t Ada 83| sources|
|00002080| 20 74 6f 20 41 64 61 20 | 39 58 3f 0a 20 20 20 20 | to Ada |9X?. |
|00002090| 20 20 20 20 20 20 2b 20 | 39 2e 33 3a 20 49 20 68 | + |9.3: I h|
|000020a0| 65 61 72 20 74 68 61 74 | 20 41 64 61 20 69 73 20 |ear that| Ada is |
|000020b0| 73 6c 6f 77 65 72 20 74 | 68 61 6e 20 46 6f 72 74 |slower t|han Fort|
|000020c0| 72 61 6e 20 6f 72 20 43 | 2c 20 69 73 20 74 68 61 |ran or C|, is tha|
|000020d0| 74 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 74 72 |t. | tr|
|000020e0| 75 65 3f 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |ue?. | + |
|000020f0| 39 2e 34 3a 20 49 73 6e | 27 74 20 41 64 61 20 6c |9.4: Isn|'t Ada l|
|00002100| 65 73 73 20 22 65 6c 65 | 67 61 6e 74 22 20 74 68 |ess "ele|gant" th|
|00002110| 61 6e 20 45 69 66 66 65 | 6c 3f 0a 20 20 20 20 20 |an Eiffe|l?. |
|00002120| 20 20 20 20 20 2b 20 39 | 2e 35 3a 20 41 72 65 20 | + 9|.5: Are |
|00002130| 74 68 65 72 65 20 61 6e | 79 20 70 61 70 65 72 73 |there an|y papers|
|00002140| 20 64 65 74 61 69 6c 69 | 6e 67 20 74 68 65 20 64 | detaili|ng the d|
|00002150| 69 66 66 65 72 65 6e 63 | 65 73 20 62 65 74 77 65 |ifferenc|es betwe|
|00002160| 65 6e 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 41 |en. | A|
|00002170| 64 61 20 61 6e 64 20 43 | 2b 2b 3f 0a 20 20 20 20 |da and C|++?. |
|00002180| 20 20 20 20 20 20 2b 20 | 39 2e 36 3a 20 49 20 6b | + |9.6: I k|
|00002190| 65 65 70 20 68 65 61 72 | 69 6e 67 20 74 68 61 74 |eep hear|ing that|
|000021a0| 20 41 64 61 20 69 73 20 | 61 20 22 73 74 72 6f 6e | Ada is |a "stron|
|000021b0| 67 6c 79 20 74 79 70 65 | 64 20 6c 61 6e 67 75 61 |gly type|d langua|
|000021c0| 67 65 22 2c 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ge",. | |
|000021d0| 20 62 75 74 20 69 74 20 | 73 65 65 6d 73 20 64 69 | but it |seems di|
|000021e0| 66 66 65 72 65 6e 74 20 | 66 72 6f 6d 20 77 68 61 |fferent |from wha|
|000021f0| 74 27 73 20 6d 65 61 6e | 74 20 69 6e 20 43 2b 2b |t's mean|t in C++|
|00002200| 2e 20 41 72 65 20 74 68 | 65 79 0a 20 20 20 20 20 |. Are th|ey. |
|00002210| 20 20 20 20 20 20 20 64 | 69 66 66 65 72 65 6e 74 | d|ifferent|
|00002220| 3f 0a 20 20 20 20 20 20 | 20 20 20 20 2b 20 39 2e |?. | + 9.|
|00002230| 37 3a 20 49 27 6d 20 74 | 6f 6c 64 20 41 64 61 20 |7: I'm t|old Ada |
|00002240| 64 6f 65 73 20 61 6c 6c | 20 73 6f 72 74 73 20 6f |does all| sorts o|
|00002250| 66 20 73 74 61 74 69 63 | 20 74 79 70 65 20 63 68 |f static| type ch|
|00002260| 65 63 6b 69 6e 67 2c 20 | 62 75 74 0a 20 20 20 20 |ecking, |but. |
|00002270| 20 20 20 20 20 20 20 20 | 63 61 6e 27 74 20 79 6f | |can't yo|
|00002280| 75 20 67 65 74 20 74 68 | 65 20 73 61 6d 65 20 65 |u get th|e same e|
|00002290| 66 66 65 63 74 20 75 73 | 69 6e 67 20 61 20 74 6f |ffect us|ing a to|
|000022a0| 6f 6c 20 6c 69 6b 65 20 | 22 6c 69 6e 74 22 20 77 |ol like |"lint" w|
|000022b0| 69 74 68 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |ith. | |
|000022c0| 43 3f 0a 20 20 20 20 20 | 20 20 20 20 20 2b 20 39 |C?. | + 9|
|000022d0| 2e 38 3a 20 44 6f 65 73 | 20 41 64 61 20 68 61 76 |.8: Does| Ada hav|
|000022e0| 65 20 73 6f 6d 65 74 68 | 69 6e 67 20 6c 69 6b 65 |e someth|ing like|
|000022f0| 20 74 68 65 20 53 74 61 | 6e 64 61 72 64 20 54 65 | the Sta|ndard Te|
|00002300| 6d 70 6c 61 74 65 0a 20 | 20 20 20 20 20 20 20 20 |mplate. | |
|00002310| 20 20 20 4c 69 62 72 61 | 72 79 20 28 53 54 4c 29 | Libra|ry (STL)|
|00002320| 20 69 6e 20 43 2b 2b 2c | 20 6f 72 20 6c 69 6b 65 | in C++,| or like|
|00002330| 20 74 68 65 20 63 6f 6d | 70 6f 6e 65 6e 74 73 20 | the com|ponents |
|00002340| 6f 6e 65 20 66 69 6e 64 | 73 20 69 6e 0a 20 20 20 |one find|s in. |
|00002350| 20 20 20 20 20 20 20 20 | 20 53 6d 61 6c 6c 74 61 | | Smallta|
|00002360| 6c 6b 20 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 73 3f |lk envir|onments?|
|00002370| 0a 20 20 20 20 20 20 20 | 20 20 20 2b 20 39 2e 39 |. | + 9.9|
|00002380| 3a 20 57 68 65 72 65 20 | 63 61 6e 20 49 20 66 69 |: Where |can I fi|
|00002390| 6e 64 20 74 68 65 20 65 | 71 75 69 76 61 6c 65 6e |nd the e|quivalen|
|000023a0| 74 20 6f 66 20 22 70 72 | 69 6e 74 66 22 20 69 6e |t of "pr|intf" in|
|000023b0| 20 41 64 61 3f 0a 0a 0a | 20 20 20 20 20 2a 20 31 | Ada?...| * 1|
|000023c0| 30 3a 20 49 6e 74 65 72 | 66 61 63 69 6e 67 20 77 |0: Inter|facing w|
|000023d0| 69 74 68 20 41 64 61 0a | 20 20 20 20 20 20 20 20 |ith Ada.| |
|000023e0| 20 20 2b 20 31 30 2e 31 | 3a 20 49 20 61 6d 20 77 | + 10.1|: I am w|
|000023f0| 72 69 74 69 6e 67 20 73 | 6f 66 74 77 61 72 65 20 |riting s|oftware |
|00002400| 74 68 61 74 20 75 73 65 | 64 20 74 68 65 20 44 69 |that use|d the Di|
|00002410| 73 74 72 69 62 75 74 65 | 64 0a 20 20 20 20 20 20 |stribute|d. |
|00002420| 20 20 20 20 20 20 49 6e | 74 65 72 61 63 74 69 76 | In|teractiv|
|00002430| 65 20 53 69 6d 75 6c 61 | 74 69 6f 6e 20 28 44 49 |e Simula|tion (DI|
|00002440| 53 29 20 69 6e 74 65 72 | 66 61 63 65 2c 20 64 6f |S) inter|face, do|
|00002450| 65 73 20 61 6e 20 69 6e | 74 65 72 66 61 63 65 0a |es an in|terface.|
|00002460| 20 20 20 20 20 20 20 20 | 20 20 20 20 65 78 69 73 | | exis|
|00002470| 74 20 69 6e 20 41 64 61 | 3f 0a 20 20 20 20 20 20 |t in Ada|?. |
|00002480| 20 20 20 20 2b 20 31 30 | 2e 32 3a 20 49 73 20 74 | + 10|.2: Is t|
|00002490| 68 65 72 65 20 61 6e 79 | 20 73 75 70 70 6f 72 74 |here any| support|
|000024a0| 20 66 6f 72 20 43 6f 6d | 6d 6f 6e 20 4f 62 6a 65 | for Com|mon Obje|
|000024b0| 63 74 20 52 65 71 75 65 | 73 74 20 42 72 6f 6b 65 |ct Reque|st Broke|
|000024c0| 72 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 41 72 |r. | Ar|
|000024d0| 63 68 69 74 65 63 74 75 | 72 65 20 28 43 4f 52 42 |chitectu|re (CORB|
|000024e0| 41 29 20 66 6f 72 20 41 | 64 61 20 39 58 3f 0a 0a |A) for A|da 9X?..|
|000024f0| 0a 20 20 20 20 20 2a 20 | 31 31 3a 20 46 69 6e 64 |. * |11: Find|
|00002500| 69 6e 67 20 41 64 64 69 | 74 69 6f 6e 61 6c 20 49 |ing Addi|tional I|
|00002510| 6e 66 6f 72 6d 61 74 69 | 6f 6e 0a 20 20 20 20 20 |nformati|on. |
|00002520| 20 20 20 20 20 2b 20 31 | 31 2e 31 3a 20 57 68 65 | + 1|1.1: Whe|
|00002530| 72 65 20 63 61 6e 20 49 | 20 66 69 6e 64 20 41 64 |re can I| find Ad|
|00002540| 61 20 62 6f 6f 6b 73 3f | 0a 20 20 20 20 20 20 20 |a books?|. |
|00002550| 20 20 20 2b 20 31 31 2e | 32 3a 20 41 72 65 20 74 | + 11.|2: Are t|
|00002560| 68 65 72 65 20 6f 74 68 | 65 72 20 41 64 61 2d 72 |here oth|er Ada-r|
|00002570| 65 6c 61 74 65 64 20 46 | 41 51 73 3f 0a 20 20 20 |elated F|AQs?. |
|00002580| 20 20 20 20 20 20 20 2b | 20 31 31 2e 33 3a 20 57 | +| 11.3: W|
|00002590| 68 61 74 20 69 73 20 74 | 68 65 20 22 48 42 41 50 |hat is t|he "HBAP|
|000025a0| 20 57 57 57 20 53 65 72 | 76 65 72 22 3f 0a 0a 0a | WWW Ser|ver"?...|
|000025b0| 20 20 20 20 20 2a 20 31 | 32 3a 20 50 72 65 74 74 | * 1|2: Prett|
|000025c0| 79 2d 70 72 69 6e 74 69 | 6e 67 20 61 6e 64 20 4d |y-printi|ng and M|
|000025d0| 65 61 73 75 72 69 6e 67 | 20 41 64 61 20 53 6f 75 |easuring| Ada Sou|
|000025e0| 72 63 65 20 43 6f 64 65 | 0a 20 20 20 20 20 20 20 |rce Code|. |
|000025f0| 20 20 20 2b 20 31 32 2e | 31 3a 20 49 73 20 74 68 | + 12.|1: Is th|
|00002600| 65 72 65 20 73 6f 66 74 | 77 61 72 65 20 74 68 61 |ere soft|ware tha|
|00002610| 74 20 67 65 6e 65 72 61 | 74 65 73 20 61 20 70 72 |t genera|tes a pr|
|00002620| 65 74 74 79 20 50 6f 73 | 74 53 63 72 69 70 74 0a |etty Pos|tScript.|
|00002630| 20 20 20 20 20 20 20 20 | 20 20 20 20 66 69 6c 65 | | file|
|00002640| 20 66 72 6f 6d 20 41 64 | 61 20 73 6f 75 72 63 65 | from Ad|a source|
|00002650| 20 63 6f 64 65 3f 0a 20 | 20 20 20 20 20 20 20 20 | code?. | |
|00002660| 20 2b 20 31 32 2e 32 3a | 20 49 20 75 73 65 20 76 | + 12.2:| I use v|
|00002670| 67 72 69 6e 64 20 74 6f | 20 64 6f 20 22 70 72 65 |grind to| do "pre|
|00002680| 74 74 79 20 70 72 69 6e | 74 69 6e 67 22 20 6f 66 |tty prin|ting" of|
|00002690| 20 6d 79 20 73 6f 75 72 | 63 65 2e 20 49 73 0a 20 | my sour|ce. Is. |
|000026a0| 20 20 20 20 20 20 20 20 | 20 20 20 74 68 65 72 65 | | there|
|000026b0| 20 61 20 76 67 72 69 6e | 64 20 64 65 66 69 6e 69 | a vgrin|d defini|
|000026c0| 74 69 6f 6e 20 66 6f 72 | 20 41 64 61 3f 0a 20 20 |tion for| Ada?. |
|000026d0| 20 20 20 20 20 20 20 20 | 2b 20 31 32 2e 33 3a 20 | |+ 12.3: |
|000026e0| 48 6f 77 20 61 62 6f 75 | 74 20 61 20 73 6f 75 72 |How abou|t a sour|
|000026f0| 63 65 20 63 6f 64 65 20 | 72 65 66 6f 72 6d 61 74 |ce code |reformat|
|00002700| 74 65 72 3f 0a 20 20 20 | 20 20 20 20 20 20 20 2b |ter?. | +|
|00002710| 20 31 32 2e 34 3a 20 48 | 6f 77 20 63 61 6e 20 49 | 12.4: H|ow can I|
|00002720| 20 63 6f 75 6e 74 20 73 | 6f 75 72 63 65 20 6c 69 | count s|ource li|
|00002730| 6e 65 73 20 6f 66 20 63 | 6f 64 65 20 28 53 4c 4f |nes of c|ode (SLO|
|00002740| 43 29 3f 0a 20 20 20 20 | 20 20 20 20 20 20 2b 20 |C)?. | + |
|00002750| 31 32 2e 35 3a 20 43 61 | 6e 20 49 20 6d 65 61 73 |12.5: Ca|n I meas|
|00002760| 75 72 65 20 6f 74 68 65 | 72 20 74 68 69 6e 67 73 |ure othe|r things|
|00002770| 3f 0a 0a 0a 20 20 20 20 | 20 2a 20 31 33 3a 20 43 |?... | * 13: C|
|00002780| 72 65 64 69 74 73 0a 0a | 20 20 20 20 20 2a 20 31 |redits..| * 1|
|00002790| 34 3a 20 43 6f 70 79 69 | 6e 67 20 74 68 69 73 20 |4: Copyi|ng this |
|000027a0| 46 41 51 0a 0a 0a 20 20 | 20 20 20 5f 5f 5f 5f 5f |FAQ... | _____|
|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 5f |________|________|
|000027d0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000027e0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 0a 0a 31 3a |________|____..1:|
|000027f0| 20 52 65 63 65 6e 74 20 | 63 68 61 6e 67 65 73 20 | Recent |changes |
|00002800| 74 6f 20 74 68 69 73 20 | 46 41 51 0a 0a 20 20 20 |to this |FAQ.. |
|00002810| 20 20 2a 20 39 36 30 35 | 32 32 3a 20 22 61 69 6d | * 9605|22: "aim|
|00002820| 61 70 22 20 6c 6f 63 61 | 74 65 64 20 28 31 32 2e |ap" loca|ted (12.|
|00002830| 33 29 2e 0a 20 20 20 20 | 20 2a 20 39 36 30 33 32 |3).. | * 96032|
|00002840| 30 3a 20 63 6f 6d 70 61 | 72 69 6e 67 20 74 68 65 |0: compa|ring the|
|00002850| 20 65 66 66 69 63 69 65 | 6e 63 79 20 6f 66 20 41 | efficie|ncy of A|
|00002860| 64 61 20 61 6e 64 20 6f | 74 68 65 72 20 6c 61 6e |da and o|ther lan|
|00002870| 67 75 61 67 65 73 20 28 | 37 2e 32 29 0a 20 20 20 |guages (|7.2). |
|00002880| 20 20 20 20 28 73 75 62 | 6d 69 74 74 65 64 20 62 | (sub|mitted b|
|00002890| 79 20 44 2e 20 57 68 65 | 65 6c 65 72 29 0a 20 20 |y D. Whe|eler). |
|000028a0| 20 20 20 2a 20 39 36 30 | 32 32 38 3a 20 72 65 66 | * 960|228: ref|
|000028b0| 65 72 65 6e 63 65 73 20 | 66 6f 72 20 72 65 64 65 |erences |for rede|
|000028c0| 66 69 6e 69 6e 67 20 74 | 68 65 20 61 73 73 69 67 |fining t|he assig|
|000028d0| 6e 6d 65 6e 74 20 6f 70 | 65 72 61 74 69 6f 6e 20 |nment op|eration |
|000028e0| 28 38 2e 31 29 0a 20 20 | 20 20 20 20 20 28 73 77 |(8.1). | (sw|
|000028f0| 69 74 63 68 65 64 20 71 | 75 65 73 74 69 6f 6e 73 |itched q|uestions|
|00002900| 20 38 2e 31 20 61 6e 64 | 20 38 2e 32 29 2e 0a 20 | 8.1 and| 8.2).. |
|00002910| 20 20 20 20 2a 20 39 36 | 30 31 33 30 3a 20 61 6e | * 96|0130: an|
|00002920| 6f 74 68 65 72 20 67 61 | 6d 65 20 77 72 69 74 74 |other ga|me writt|
|00002930| 65 6e 20 69 6e 20 41 64 | 61 20 28 33 2e 31 33 29 |en in Ad|a (3.13)|
|00002940| 2e 0a 20 20 20 20 20 2a | 20 39 36 30 31 32 33 3a |.. *| 960123:|
|00002950| 20 41 52 41 20 63 6f 6e | 74 65 73 74 20 66 6f 72 | ARA con|test for|
|00002960| 20 67 6f 6f 64 20 41 64 | 61 20 28 34 2e 33 29 2e | good Ad|a (4.3).|
|00002970| 0a 20 20 20 20 20 2a 20 | 39 35 30 39 32 35 3a 20 |. * |950925: |
|00002980| 72 65 6d 6f 76 65 64 20 | 61 20 63 6f 75 70 6c 65 |removed |a couple|
|00002990| 20 6f 66 20 6e 6f 6e 2d | 70 72 6f 67 72 61 6d 6d | of non-|programm|
|000029a0| 69 6e 67 20 71 75 65 73 | 74 69 6f 6e 73 2e 0a 20 |ing ques|tions.. |
|000029b0| 20 20 20 20 2a 20 39 35 | 30 38 32 38 3a 20 74 68 | * 95|0828: th|
|000029c0| 65 20 63 68 61 6e 67 65 | 20 6c 6f 67 73 20 6e 6f |e change| logs no|
|000029d0| 77 20 69 6e 64 69 63 61 | 74 65 20 74 68 65 20 73 |w indica|te the s|
|000029e0| 65 63 74 69 6f 6e 2f 71 | 75 65 73 74 69 6f 6e 20 |ection/q|uestion |
|000029f0| 6e 75 6d 62 65 72 2e 0a | 20 20 20 20 20 2a 20 39 |number..| * 9|
|00002a00| 35 30 38 31 39 3a 20 6e | 6f 6e 2d 62 6c 6f 63 6b |50819: n|on-block|
|00002a10| 69 6e 67 2c 20 6b 65 79 | 73 74 72 6f 6b 65 2d 61 |ing, key|stroke-a|
|00002a20| 74 2d 61 2d 74 69 6d 65 | 20 72 65 61 64 69 6e 67 |t-a-time| reading|
|00002a30| 20 28 33 2e 31 34 29 2e | 0a 20 20 20 20 20 2a 20 | (3.14).|. * |
|00002a40| 39 35 30 38 31 39 3a 20 | 73 6f 6d 65 20 55 52 4c |950819: |some URL|
|00002a50| 20 75 70 64 61 74 65 73 | 3a 20 41 64 61 49 43 20 | updates|: AdaIC |
|00002a60| 66 69 6c 65 73 20 6b 65 | 65 70 20 6d 6f 76 69 6e |files ke|ep movin|
|00002a70| 67 20 61 72 6f 75 6e 64 | 2e 0a 20 20 20 20 20 2a |g around|.. *|
|00002a80| 20 39 35 30 36 33 30 3a | 20 63 6f 72 72 65 63 74 | 950630:| correct|
|00002a90| 65 64 20 61 6e 73 77 65 | 72 73 20 6f 6e 20 74 61 |ed answe|rs on ta|
|00002aa0| 73 6b 20 73 77 69 74 63 | 68 69 6e 67 20 28 33 2e |sk switc|hing (3.|
|00002ab0| 36 29 20 61 6e 64 20 63 | 6f 6e 76 65 72 73 69 6f |6) and c|onversio|
|00002ac0| 6e 0a 20 20 20 20 20 20 | 20 76 73 2e 20 71 75 61 |n. | vs. qua|
|00002ad0| 6c 69 66 69 65 72 20 28 | 33 2e 38 29 2e 0a 20 20 |lifier (|3.8).. |
|00002ae0| 20 20 20 2a 20 39 35 30 | 35 31 37 3a 20 22 67 65 | * 950|517: "ge|
|00002af0| 6e 65 72 61 6c 22 20 63 | 6c 61 73 73 2d 77 69 64 |neral" c|lass-wid|
|00002b00| 65 20 61 63 63 65 73 73 | 20 74 79 70 65 20 28 35 |e access| type (5|
|00002b10| 2e 39 29 2e 0a 20 20 20 | 20 20 2a 20 39 35 30 34 |.9).. | * 9504|
|00002b20| 31 33 3a 20 76 61 72 69 | 61 6e 74 20 72 65 63 6f |13: vari|ant reco|
|00002b30| 72 64 73 20 76 73 2e 20 | 74 61 67 67 65 64 20 74 |rds vs. |tagged t|
|00002b40| 79 70 65 73 20 28 35 2e | 32 29 2c 20 73 75 62 6d |ypes (5.|2), subm|
|00002b50| 69 74 74 65 64 20 62 79 | 0a 20 20 20 20 20 20 20 |itted by|. |
|00002b60| 4b 2e a0 53 68 69 6c 6c | 69 6e 67 74 6f 6e 2e 0a |K..Shill|ington..|
|00002b70| 20 20 20 20 20 2a 20 39 | 35 30 34 30 36 3a 20 77 | * 9|50406: w|
|00002b80| 68 79 20 41 64 61 20 64 | 6f 65 73 20 6e 6f 74 20 |hy Ada d|oes not |
|00002b90| 61 6e 64 20 73 68 6f 75 | 6c 64 20 6e 6f 74 20 68 |and shou|ld not h|
|00002ba0| 61 76 65 20 6d 61 63 72 | 6f 73 20 28 38 2e 37 29 |ave macr|os (8.7)|
|00002bb0| 2e 0a 20 20 20 20 20 2a | 20 39 35 30 33 32 30 3a |.. *| 950320:|
|00002bc0| 20 6d 6f 72 65 20 6f 6e | 20 44 49 53 20 28 31 30 | more on| DIS (10|
|00002bd0| 2e 31 29 2e 0a 20 20 20 | 20 20 2a 20 39 35 30 33 |.1).. | * 9503|
|00002be0| 31 35 3a 20 41 64 61 20 | 69 73 20 67 6f 6f 64 20 |15: Ada |is good |
|00002bf0| 61 74 20 6e 75 6d 65 72 | 69 63 73 20 28 36 2e 33 |at numer|ics (6.3|
|00002c00| 29 2c 20 62 79 20 4a 2e | a0 50 61 72 6b 65 72 2e |), by J.|.Parker.|
|00002c10| 0a 20 20 20 20 20 2a 20 | 39 35 30 33 30 39 3a 20 |. * |950309: |
|00002c20| 64 72 69 6e 6b 69 6e 67 | 20 61 6e 64 20 64 72 69 |drinking| and dri|
|00002c30| 76 69 6e 67 20 65 78 61 | 6d 70 6c 65 20 28 38 2e |ving exa|mple (8.|
|00002c40| 36 29 2e 0a 20 20 20 20 | 20 2a 20 39 35 30 33 30 |6).. | * 95030|
|00002c50| 36 3a 20 61 64 64 65 64 | 20 63 6f 75 6e 74 69 6e |6: added| countin|
|00002c60| 67 20 53 4c 4f 43 20 28 | 31 32 2e 34 29 20 61 6e |g SLOC (|12.4) an|
|00002c70| 64 20 6d 65 61 73 75 72 | 69 6e 67 20 28 31 32 2e |d measur|ing (12.|
|00002c80| 35 29 2e 0a 20 20 20 20 | 20 2a 20 39 35 30 32 32 |5).. | * 95022|
|00002c90| 32 3a 20 66 69 78 65 64 | 20 73 6f 6d 65 20 74 79 |2: fixed| some ty|
|00002ca0| 70 6f 73 2e 0a 20 20 20 | 20 20 2a 20 39 35 30 32 |pos.. | * 9502|
|00002cb0| 30 37 3a 20 72 65 76 69 | 73 65 64 20 69 6e 74 72 |07: revi|sed intr|
|00002cc0| 6f 64 75 63 74 69 6f 6e | 2e 0a 20 20 20 20 20 2a |oduction|.. *|
|00002cd0| 20 39 35 30 32 30 32 3a | 20 75 70 64 61 74 65 64 | 950202:| updated|
|00002ce0| 20 64 69 73 63 75 73 73 | 69 6f 6e 20 6f 66 20 43 | discuss|ion of C|
|00002cf0| 2b 2b 20 53 54 4c 20 61 | 6e 64 20 53 6d 61 6c 6c |++ STL a|nd Small|
|00002d00| 74 61 6c 6b 20 6c 69 62 | 72 61 72 79 20 28 39 2e |talk lib|rary (9.|
|00002d10| 38 29 2e 0a 20 20 20 20 | 20 2a 20 39 35 30 31 32 |8).. | * 95012|
|00002d20| 36 3a 20 61 64 76 61 6e | 74 61 67 65 73 20 6f 66 |6: advan|tages of|
|00002d30| 20 63 6f 64 65 20 73 68 | 61 72 69 6e 67 20 66 6f | code sh|aring fo|
|00002d40| 72 20 67 65 6e 65 72 69 | 63 73 20 28 37 2e 31 29 |r generi|cs (7.1)|
|00002d50| 3b 20 50 61 73 63 61 6c | 20 74 6f 0a 20 20 20 20 |; Pascal| to. |
|00002d60| 20 20 20 41 64 61 20 74 | 6f 6f 6c 20 28 39 2e 31 | Ada t|ool (9.1|
|00002d70| 29 2e 0a 20 20 20 20 20 | 2a 20 39 35 30 31 32 35 |).. |* 950125|
|00002d80| 3a 20 77 68 79 20 64 65 | 66 69 6e 65 20 6e 65 77 |: why de|fine new|
|00002d90| 20 69 6e 74 65 67 65 72 | 20 74 79 70 65 73 20 28 | integer| types (|
|00002da0| 33 2e 31 31 29 2c 20 61 | 6e 64 20 77 68 79 20 75 |3.11), a|nd why u|
|00002db0| 73 65 20 74 68 65 0a 20 | 20 20 20 20 20 20 70 72 |se the. | pr|
|00002dc0| 65 64 65 66 69 6e 65 64 | 20 49 6e 74 65 67 65 72 |edefined| Integer|
|00002dd0| 20 74 79 70 65 20 28 33 | 2e 31 32 29 2c 20 73 75 | type (3|.12), su|
|00002de0| 62 6d 69 74 74 65 64 20 | 62 79 20 4a 2e a0 50 61 |bmitted |by J..Pa|
|00002df0| 72 6b 65 72 2e 0a 20 20 | 20 20 20 2a 20 39 35 30 |rker.. | * 950|
|00002e00| 31 32 34 3a 20 61 70 70 | 72 6f 76 65 64 20 66 6f |124: app|roved fo|
|00002e10| 72 20 70 6f 73 74 69 6e | 67 20 69 6e 20 2a 2e 61 |r postin|g in *.a|
|00002e20| 6e 73 77 65 72 73 2e 0a | 20 20 20 20 20 2a 20 39 |nswers..| * 9|
|00002e30| 35 30 31 31 36 3a 20 63 | 6f 6e 76 65 72 74 69 6e |50116: c|onvertin|
|00002e40| 67 20 41 64 61 20 38 33 | 20 63 6f 64 65 20 74 6f |g Ada 83| code to|
|00002e50| 20 41 64 61 20 39 58 20 | 28 39 2e 32 29 2e 0a 20 | Ada 9X |(9.2).. |
|00002e60| 20 20 20 20 2a 20 39 35 | 30 31 30 36 3a 20 6c 65 | * 95|0106: le|
|00002e70| 6e 67 74 68 79 20 63 6f | 64 65 20 73 65 63 74 69 |ngthy co|de secti|
|00002e80| 6f 6e 73 20 65 78 74 72 | 61 63 74 65 64 20 61 6e |ons extr|acted an|
|00002e90| 64 20 70 75 74 20 6f 6e | 20 46 54 50 20 73 65 72 |d put on| FTP ser|
|00002ea0| 76 65 72 2e 0a 20 20 20 | 20 20 2a 20 39 35 30 31 |ver.. | * 9501|
|00002eb0| 30 35 3a 20 70 72 69 6e | 74 66 20 73 6f 6c 75 74 |05: prin|tf solut|
|00002ec0| 69 6f 6e 20 28 39 2e 39 | 29 3b 20 75 70 64 61 74 |ion (9.9|); updat|
|00002ed0| 65 20 6f 6e 20 65 78 63 | 65 70 74 69 6f 6e 20 74 |e on exc|eption t|
|00002ee0| 72 61 63 65 73 20 61 6e | 64 0a 20 20 20 20 20 20 |races an|d. |
|00002ef0| 20 76 67 72 69 6e 64 2e | 0a 20 20 20 20 20 2a 20 | vgrind.|. * |
|00002f00| 39 35 30 31 30 34 3a 20 | 6c 69 6e 6b 73 20 66 72 |950104: |links fr|
|00002f10| 6f 6d 20 54 4f 43 20 74 | 6f 20 61 6c 6c 20 71 75 |om TOC t|o all qu|
|00002f20| 65 73 74 69 6f 6e 73 2e | 0a 0a 0a 20 20 20 57 68 |estions.|... Wh|
|00002f30| 61 74 27 73 20 69 6d 70 | 6f 72 74 61 6e 74 20 61 |at's imp|ortant a|
|00002f40| 6e 64 20 6d 69 73 73 69 | 6e 67 3a 0a 20 20 20 20 |nd missi|ng:. |
|00002f50| 20 2a 20 65 76 65 72 79 | 74 68 69 6e 67 2c 20 6c | * every|thing, l|
|00002f60| 69 66 65 2c 20 61 6e 64 | 20 34 32 0a 0a 0a 20 20 |ife, and| 42... |
|00002f70| 20 20 20 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f | _____|________|
|00002f80| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002f90| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002fa0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00002fb0| 5f 5f 5f 5f 0a 0a 0a 32 | 3a 20 49 6e 66 6f 72 6d |____...2|: Inform|
|00002fc0| 61 74 69 6f 6e 20 61 62 | 6f 75 74 20 74 68 69 73 |ation ab|out this|
|00002fd0| 20 64 6f 63 75 6d 65 6e | 74 0a 0a 20 20 20 54 68 | documen|t.. Th|
|00002fe0| 69 73 20 66 69 6c 65 20 | 69 73 20 70 6f 73 74 65 |is file |is poste|
|00002ff0| 64 20 6d 6f 6e 74 68 6c | 79 20 74 6f 20 63 6f 6d |d monthl|y to com|
|00003000| 70 2e 6c 61 6e 67 2e 61 | 64 61 2c 20 63 6f 6d 70 |p.lang.a|da, comp|
|00003010| 2e 61 6e 73 77 65 72 73 | 2c 20 61 6e 64 0a 20 20 |.answers|, and. |
|00003020| 20 6e 65 77 73 2e 61 6e | 73 77 65 72 73 2e 0a 0a | news.an|swers...|
|00003030| 20 20 20 54 68 69 73 20 | 64 6f 63 75 6d 65 6e 74 | This |document|
|00003040| 20 68 61 73 20 61 20 68 | 6f 6d 65 20 6f 6e 20 74 | has a h|ome on t|
|00003050| 68 65 20 48 6f 6d 65 20 | 6f 66 20 74 68 65 20 42 |he Home |of the B|
|00003060| 72 61 76 65 20 41 64 61 | 20 50 72 6f 67 72 61 6d |rave Ada| Program|
|00003070| 6d 65 72 73 0a 20 20 20 | 28 48 42 41 50 29 20 57 |mers. |(HBAP) W|
|00003080| 57 57 20 53 65 72 76 65 | 72 2c 20 69 6e 20 68 79 |WW Serve|r, in hy|
|00003090| 70 65 72 74 65 78 74 20 | 66 6f 72 6d 61 74 2c 20 |pertext |format, |
|000030a0| 55 52 4c 0a 20 20 20 68 | 74 74 70 3a 2f 2f 6c 67 |URL. h|ttp://lg|
|000030b0| 6c 77 77 77 2e 65 70 66 | 6c 2e 63 68 2f 41 64 61 |lwww.epf|l.ch/Ada|
|000030c0| 2f 46 41 51 2f 70 72 6f | 67 72 61 6d 6d 69 6e 67 |/FAQ/pro|gramming|
|000030d0| 2e 68 74 6d 6c 0a 0a 20 | 20 20 49 74 20 69 73 20 |.html.. | It is |
|000030e0| 61 76 61 69 6c 61 62 6c | 65 20 2d 2d 61 73 20 70 |availabl|e --as p|
|000030f0| 6f 73 74 65 64 20 69 6e | 20 2a 2e 61 6e 73 77 65 |osted in| *.answe|
|00003100| 72 73 2d 2d 20 6f 6e 20 | 72 74 66 6d 2e 6d 69 74 |rs-- on |rtfm.mit|
|00003110| 2e 65 64 75 2c 20 77 68 | 69 63 68 0a 20 20 20 61 |.edu, wh|ich. a|
|00003120| 72 63 68 69 76 65 73 20 | 61 6c 6c 20 46 41 51 20 |rchives |all FAQ |
|00003130| 66 69 6c 65 73 20 70 6f | 73 74 65 64 20 74 6f 20 |files po|sted to |
|00003140| 2a 2e 61 6e 73 77 65 72 | 73 3b 20 73 65 65 0a 20 |*.answer|s; see. |
|00003150| 20 20 66 74 70 3a 2f 2f | 72 74 66 6d 2e 6d 69 74 | ftp://|rtfm.mit|
|00003160| 2e 65 64 75 2f 70 75 62 | 2f 75 73 65 6e 65 74 2d |.edu/pub|/usenet-|
|00003170| 62 79 2d 67 72 6f 75 70 | 2f 6e 65 77 73 2e 61 6e |by-group|/news.an|
|00003180| 73 77 65 72 73 2f 63 6f | 6d 70 75 74 65 72 2d 6c |swers/co|mputer-l|
|00003190| 61 6e 67 2f 41 64 61 0a | 0a 20 20 20 54 68 65 20 |ang/Ada.|. The |
|000031a0| 74 65 78 74 2d 6f 6e 6c | 79 20 76 65 72 73 69 6f |text-onl|y versio|
|000031b0| 6e 20 69 73 20 61 6c 73 | 6f 20 61 76 61 69 6c 61 |n is als|o availa|
|000031c0| 62 6c 65 20 69 6e 20 64 | 69 72 65 63 74 6f 72 79 |ble in d|irectory|
|000031d0| 0a 20 20 20 66 74 70 3a | 2f 2f 6c 67 6c 66 74 70 |. ftp:|//lglftp|
|000031e0| 2e 65 70 66 6c 2e 63 68 | 2f 70 75 62 2f 41 64 61 |.epfl.ch|/pub/Ada|
|000031f0| 2f 46 41 51 0a 0a 20 20 | 20 4d 61 67 6e 75 73 20 |/FAQ.. | Magnus |
|00003200| 4b 65 6d 70 65 20 6d 61 | 69 6e 74 61 69 6e 73 20 |Kempe ma|intains |
|00003210| 74 68 69 73 20 64 6f 63 | 75 6d 65 6e 74 3b 20 69 |this doc|ument; i|
|00003220| 74 27 73 20 61 20 68 6f | 62 62 79 2c 20 6e 6f 74 |t's a ho|bby, not|
|00003230| 20 61 20 6a 6f 62 2e 0a | 20 20 20 46 65 65 64 62 | a job..| Feedb|
|00003240| 61 63 6b 20 28 63 6f 72 | 72 65 63 74 69 6f 6e 73 |ack (cor|rections|
|00003250| 2c 20 73 75 67 67 65 73 | 74 69 6f 6e 73 2c 20 69 |, sugges|tions, i|
|00003260| 64 65 61 73 29 20 61 62 | 6f 75 74 20 69 74 20 69 |deas) ab|out it i|
|00003270| 73 20 74 6f 20 62 65 20 | 73 65 6e 74 20 76 69 61 |s to be |sent via|
|00003280| 0a 20 20 20 65 2d 6d 61 | 69 6c 20 74 6f 20 4d 61 |. e-ma|il to Ma|
|00003290| 67 6e 75 73 2e 4b 65 6d | 70 65 40 64 69 2e 65 70 |gnus.Kem|pe@di.ep|
|000032a0| 66 6c 2e 63 68 0a 20 20 | 20 54 68 61 6e 6b 73 2e |fl.ch. | Thanks.|
|000032b0| 0a 0a 20 20 20 49 6e 20 | 61 6c 6c 20 63 61 73 65 |.. In |all case|
|000032c0| 73 2c 20 74 68 65 20 6d | 6f 73 74 20 75 70 2d 74 |s, the m|ost up-t|
|000032d0| 6f 2d 64 61 74 65 20 76 | 65 72 73 69 6f 6e 20 6f |o-date v|ersion o|
|000032e0| 66 20 74 68 65 20 46 41 | 51 20 69 73 20 74 68 65 |f the FA|Q is the|
|000032f0| 20 76 65 72 73 69 6f 6e | 0a 20 20 20 6d 61 69 6e | version|. main|
|00003300| 74 61 69 6e 65 64 20 6f | 6e 20 74 68 65 20 48 42 |tained o|n the HB|
|00003310| 41 50 20 57 57 57 20 53 | 65 72 76 65 72 2e 20 50 |AP WWW S|erver. P|
|00003320| 6c 65 61 73 65 20 65 78 | 63 75 73 65 20 61 6e 79 |lease ex|cuse any|
|00003330| 20 66 6f 72 6d 61 74 74 | 69 6e 67 0a 20 20 20 69 | formatt|ing. i|
|00003340| 6e 63 6f 6e 73 69 73 74 | 65 6e 63 69 65 73 20 69 |nconsist|encies i|
|00003350| 6e 20 74 68 65 20 70 6f | 73 74 65 64 20 76 65 72 |n the po|sted ver|
|00003360| 73 69 6f 6e 20 6f 66 20 | 74 68 69 73 20 64 6f 63 |sion of |this doc|
|00003370| 75 6d 65 6e 74 2c 20 61 | 73 20 69 74 20 69 73 0a |ument, a|s it is.|
|00003380| 20 20 20 61 75 74 6f 6d | 61 74 69 63 61 6c 6c 79 | autom|atically|
|00003390| 20 67 65 6e 65 72 61 74 | 65 64 20 66 72 6f 6d 20 | generat|ed from |
|000033a0| 74 68 65 20 6f 6e 2d 6c | 69 6e 65 20 76 65 72 73 |the on-l|ine vers|
|000033b0| 69 6f 6e 2e 0a 0a 20 20 | 20 20 20 5f 5f 5f 5f 5f |ion... | _____|
|000033c0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000033d0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000033e0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|000033f0| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 0a 0a 0a 33 |________|____...3|
|00003400| 3a 20 45 6c 65 6d 65 6e | 74 61 72 79 20 51 75 65 |: Elemen|tary Que|
|00003410| 73 74 69 6f 6e 73 0a 0a | 0a 33 2e 31 3a 20 48 6f |stions..|.3.1: Ho|
|00003420| 77 20 64 6f 20 49 20 6d | 61 6b 65 20 6f 70 65 72 |w do I m|ake oper|
|00003430| 61 74 69 6f 6e 73 20 64 | 69 72 65 63 74 6c 79 20 |ations d|irectly |
|00003440| 76 69 73 69 62 6c 65 20 | 77 69 74 68 6f 75 74 20 |visible |without |
|00003450| 22 75 73 65 22 69 6e 67 | 20 74 68 65 20 70 61 63 |"use"ing| the pac|
|00003460| 6b 61 67 65 3f 0a 0a 20 | 20 20 49 6e 20 41 64 61 |kage?.. | In Ada|
|00003470| 20 38 33 2c 20 79 6f 75 | 20 63 61 6e 20 72 65 6e | 83, you| can ren|
|00003480| 61 6d 65 20 74 68 65 20 | 6f 70 65 72 61 74 69 6f |ame the |operatio|
|00003490| 6e 73 20 69 6e 20 79 6f | 75 72 20 73 63 6f 70 65 |ns in yo|ur scope|
|000034a0| 2e 0a 0a 20 20 20 20 20 | 2d 2d 20 53 61 79 20 79 |... |-- Say y|
|000034b0| 6f 75 20 68 61 76 65 20 | 61 6e 20 69 6e 74 65 67 |ou have |an integ|
|000034c0| 65 72 20 74 79 70 65 20 | 63 61 6c 6c 65 64 20 49 |er type |called I|
|000034d0| 6e 74 20 69 6e 20 70 61 | 63 6b 61 67 65 20 54 79 |nt in pa|ckage Ty|
|000034e0| 70 65 73 0a 20 20 20 20 | 20 66 75 6e 63 74 69 6f |pes. | functio|
|000034f0| 6e 20 22 3c 22 20 28 4c | 65 66 74 2c 20 52 69 67 |n "<" (L|eft, Rig|
|00003500| 68 74 20 3a 20 54 79 70 | 65 73 2e 49 6e 74 29 0a |ht : Typ|es.Int).|
|00003510| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 42 6f | r|eturn Bo|
|00003520| 6f 6c 65 61 6e 0a 20 20 | 20 20 20 20 20 72 65 6e |olean. | ren|
|00003530| 61 6d 65 73 20 54 79 70 | 65 73 2e 22 3c 22 3b 0a |ames Typ|es."<";.|
|00003540| 20 20 20 20 20 2d 2d 20 | 4d 61 6b 65 20 73 75 72 | -- |Make sur|
|00003550| 65 20 74 68 65 20 70 72 | 6f 66 69 6c 65 73 20 6f |e the pr|ofiles o|
|00003560| 66 20 74 68 65 20 66 69 | 72 73 74 20 61 6e 64 20 |f the fi|rst and |
|00003570| 6c 61 73 74 20 22 3c 22 | 20 6d 61 74 63 68 21 0a |last "<"| match!.|
|00003580| 0a 0a 20 20 20 46 6f 72 | 20 6f 70 65 72 61 74 6f |.. For| operato|
|00003590| 72 73 2c 20 41 64 61 20 | 39 35 20 69 6e 74 72 6f |rs, Ada |95 intro|
|000035a0| 64 75 63 65 73 20 74 68 | 65 20 22 75 73 65 20 74 |duces th|e "use t|
|000035b0| 79 70 65 22 20 63 6c 61 | 75 73 65 3a 0a 0a 20 20 |ype" cla|use:.. |
|000035c0| 20 20 20 75 73 65 20 74 | 79 70 65 20 54 79 70 65 | use t|ype Type|
|000035d0| 73 2e 49 6e 74 3b 20 2d | 2d 20 6d 61 6b 65 73 20 |s.Int; -|- makes |
|000035e0| 6f 70 65 72 61 74 6f 72 | 73 20 64 69 72 65 63 74 |operator|s direct|
|000035f0| 6c 79 20 76 69 73 69 62 | 6c 65 0a 0a 0a 33 2e 32 |ly visib|le...3.2|
|00003600| 3a 20 48 6f 77 20 64 6f | 20 49 20 61 73 73 69 67 |: How do| I assig|
|00003610| 6e 20 74 6f 20 61 6e 20 | 61 72 72 61 79 20 6f 66 |n to an |array of|
|00003620| 20 6c 65 6e 67 74 68 20 | 31 3f 0a 0a 20 20 20 42 | length |1?.. B|
|00003630| 65 63 61 75 73 65 20 6f | 66 20 61 6d 62 69 67 75 |ecause o|f ambigu|
|00003640| 69 74 79 20 6f 66 20 70 | 61 72 65 6e 74 68 65 73 |ity of p|arenthes|
|00003650| 65 73 2c 20 6e 61 6d 65 | 64 20 6e 6f 74 61 74 69 |es, name|d notati|
|00003660| 6f 6e 20 6d 75 73 74 20 | 62 65 20 75 73 65 64 20 |on must |be used |
|00003670| 66 6f 72 0a 20 20 20 6f | 6e 65 2d 65 6c 65 6d 65 |for. o|ne-eleme|
|00003680| 6e 74 20 61 67 67 72 65 | 67 61 74 65 73 20 28 6f |nt aggre|gates (o|
|00003690| 72 2c 20 75 6e 64 65 72 | 20 61 20 64 69 66 66 65 |r, under| a diffe|
|000036a0| 72 65 6e 74 20 61 6e 67 | 6c 65 3a 20 61 20 70 6f |rent ang|le: a po|
|000036b0| 73 69 74 69 6f 6e 61 6c | 0a 20 20 20 61 67 67 72 |sitional|. aggr|
|000036c0| 65 67 61 74 65 20 6d 75 | 73 74 20 68 61 76 65 20 |egate mu|st have |
|000036d0| 6d 6f 72 65 20 74 68 61 | 6e 20 6f 6e 65 20 63 6f |more tha|n one co|
|000036e0| 6d 70 6f 6e 65 6e 74 29 | 2e 0a 0a 20 20 20 53 65 |mponent)|... Se|
|000036f0| 65 20 5b 52 4d 39 58 20 | 34 2e 33 2e 33 28 37 29 |e [RM9X |4.3.3(7)|
|00003700| 5d 20 61 73 20 77 65 6c | 6c 20 61 73 20 74 68 65 |] as wel|l as the|
|00003710| 20 73 79 6e 74 61 78 20 | 72 75 6c 65 20 6f 66 0a | syntax |rule of.|
|00003720| 20 20 20 70 6f 73 69 74 | 69 6f 6e 61 6c 5f 61 72 | posit|ional_ar|
|00003730| 72 61 79 5f 61 67 67 72 | 65 67 61 74 65 20 69 6e |ray_aggr|egate in|
|00003740| 20 5b 52 4d 39 58 20 34 | 2e 33 2e 33 5d 3b 20 68 | [RM9X 4|.3.3]; h|
|00003750| 69 73 74 6f 72 69 61 6e | 73 20 73 65 65 20 5b 52 |istorian|s see [R|
|00003760| 4d 38 33 0a 20 20 20 34 | 2e 33 28 34 29 5d 2e 0a |M83. 4|.3(4)]..|
|00003770| 0a 20 20 20 20 20 64 65 | 63 6c 61 72 65 0a 20 20 |. de|clare. |
|00003780| 20 20 20 20 20 41 72 72 | 61 79 5f 6f 66 5f 4f 6e | Arr|ay_of_On|
|00003790| 65 20 3a 20 61 72 72 61 | 79 20 28 31 2e 2e 31 29 |e : arra|y (1..1)|
|000037a0| 20 6f 66 20 46 6c 6f 61 | 74 3b 0a 20 20 20 20 20 | of Floa|t;. |
|000037b0| 62 65 67 69 6e 0a 20 20 | 20 20 20 20 20 2d 2d 20 |begin. | -- |
|000037c0| 41 72 72 61 79 5f 6f 66 | 5f 4f 6e 65 20 3a 3d 20 |Array_of|_One := |
|000037d0| 28 31 30 2e 30 29 3b 20 | 20 20 2d 2d 20 57 6f 6e |(10.0); | -- Won|
|000037e0| 27 74 20 77 6f 72 6b 2c | 20 70 61 72 73 65 64 20 |'t work,| parsed |
|000037f0| 61 73 20 61 6e 20 65 78 | 70 72 65 73 73 69 6f 6e |as an ex|pression|
|00003800| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00003810| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00003820| 20 20 20 20 20 2d 2d 20 | 77 69 74 68 69 6e 20 70 | -- |within p|
|00003830| 61 72 65 6e 74 68 65 73 | 65 73 0a 0a 20 20 20 20 |arenthes|es.. |
|00003840| 20 20 20 41 72 72 61 79 | 5f 6f 66 5f 4f 6e 65 20 | Array|_of_One |
|00003850| 3a 3d 20 28 31 20 3d 3e | 20 31 30 2e 30 29 3b 20 |:= (1 =>| 10.0); |
|00003860| 2d 2d 20 4e 6f 20 61 6d | 62 69 67 75 69 74 79 20 |-- No am|biguity |
|00003870| 68 65 72 65 0a 20 20 20 | 20 20 65 6e 64 3b 0a 0a |here. | end;..|
|00003880| 0a 20 20 20 59 6f 75 20 | 63 61 6e 27 74 20 77 72 |. You |can't wr|
|00003890| 69 74 65 20 61 20 6f 6e | 65 2d 65 6c 65 6d 65 6e |ite a on|e-elemen|
|000038a0| 74 20 70 6f 73 69 74 69 | 6f 6e 61 6c 20 61 67 67 |t positi|onal agg|
|000038b0| 72 65 67 61 74 65 20 69 | 6e 20 41 64 61 2e 20 4e |regate i|n Ada. N|
|000038c0| 6f 72 20 61 0a 20 20 20 | 7a 65 72 6f 2d 65 6c 65 |or a. |zero-ele|
|000038d0| 6d 65 6e 74 20 61 67 67 | 72 65 67 61 74 65 2e 20 |ment agg|regate. |
|000038e0| 54 68 65 20 72 65 61 73 | 6f 6e 20 66 6f 72 20 74 |The reas|on for t|
|000038f0| 68 69 73 20 72 65 73 74 | 72 69 63 74 69 6f 6e 20 |his rest|riction |
|00003900| 69 73 20 74 68 61 74 20 | 69 74 0a 20 20 20 77 6f |is that |it. wo|
|00003910| 75 6c 64 20 62 65 20 64 | 69 66 66 69 63 75 6c 74 |uld be d|ifficult|
|00003920| 20 66 6f 72 20 63 6f 6d | 70 69 6c 65 72 73 20 74 | for com|pilers t|
|00003930| 6f 20 64 65 74 65 72 6d | 69 6e 65 20 77 68 65 74 |o determ|ine whet|
|00003940| 68 65 72 3a 0a 0a 20 20 | 20 20 20 28 20 65 78 70 |her:.. | ( exp|
|00003950| 20 29 0a 0a 20 20 20 69 | 73 20 61 20 70 61 72 65 | ).. i|s a pare|
|00003960| 6e 74 68 65 73 69 7a 65 | 64 20 65 78 70 72 65 73 |nthesize|d expres|
|00003970| 73 69 6f 6e 20 6f 66 20 | 73 6f 6d 65 20 74 79 70 |sion of |some typ|
|00003980| 65 2c 20 6f 72 20 61 6e | 20 61 67 67 72 65 67 61 |e, or an| aggrega|
|00003990| 74 65 20 6f 66 20 61 6e | 0a 20 20 20 61 72 72 61 |te of an|. arra|
|000039a0| 79 20 74 79 70 65 2e 20 | 49 66 20 41 64 61 20 68 |y type. |If Ada h|
|000039b0| 61 64 20 75 73 65 64 20 | 73 6f 6d 65 20 6f 74 68 |ad used |some oth|
|000039c0| 65 72 20 6e 6f 74 61 74 | 69 6f 6e 20 66 6f 72 20 |er notat|ion for |
|000039d0| 61 67 67 72 65 67 61 74 | 65 73 20 28 73 61 79 2c |aggregat|es (say,|
|000039e0| 0a 20 20 20 22 5b 2e 2e | 2e 5d 22 29 2c 20 74 68 |. "[..|.]"), th|
|000039f0| 65 6e 20 74 68 69 73 20 | 70 72 6f 62 6c 65 6d 20 |en this |problem |
|00003a00| 77 6f 75 6c 64 20 6e 6f | 74 20 65 78 69 73 74 2e |would no|t exist.|
|00003a10| 0a 0a 20 20 20 41 70 70 | 61 72 65 6e 74 6c 79 20 |.. App|arently |
|00003a20| 74 68 65 20 6f 72 69 67 | 69 6e 61 6c 20 72 65 71 |the orig|inal req|
|00003a30| 75 69 72 65 6d 65 6e 74 | 73 20 66 6f 72 20 41 64 |uirement|s for Ad|
|00003a40| 61 20 66 6f 72 62 61 64 | 65 20 75 73 69 6e 67 20 |a forbad|e using |
|00003a50| 63 65 72 74 61 69 6e 0a | 20 20 20 41 53 43 49 49 |certain.| ASCII|
|00003a60| 20 63 68 61 72 61 63 74 | 65 72 73 2c 20 6c 69 6b | charact|ers, lik|
|00003a70| 65 20 27 5b 27 20 61 6e | 64 20 27 5d 27 2c 20 62 |e '[' an|d ']', b|
|00003a80| 65 63 61 75 73 65 20 74 | 68 6f 73 65 20 63 68 61 |ecause t|hose cha|
|00003a90| 72 61 63 74 65 72 73 20 | 77 65 72 65 20 6e 6f 74 |racters |were not|
|00003aa0| 0a 20 20 20 61 76 61 69 | 6c 61 62 6c 65 20 6f 6e |. avai|lable on|
|00003ab0| 20 61 6c 6c 20 68 61 72 | 64 77 61 72 65 2e 20 41 | all har|dware. A|
|00003ac0| 6c 73 6f 2c 20 63 65 72 | 74 61 69 6e 20 63 68 61 |lso, cer|tain cha|
|00003ad0| 72 61 63 74 65 72 73 20 | 61 72 65 20 75 73 65 64 |racters |are used|
|00003ae0| 20 66 6f 72 0a 20 20 20 | 64 69 66 66 65 72 65 6e | for. |differen|
|00003af0| 74 20 70 75 72 70 6f 73 | 65 73 20 61 6e 64 20 67 |t purpos|es and g|
|00003b00| 6c 79 70 68 73 20 69 6e | 20 63 6f 75 6e 74 72 69 |lyphs in| countri|
|00003b10| 65 73 20 74 68 61 74 20 | 6e 65 65 64 20 61 64 64 |es that |need add|
|00003b20| 69 74 69 6f 6e 61 6c 0a | 20 20 20 6c 65 74 74 65 |itional.| lette|
|00003b30| 72 73 20 6e 6f 74 20 70 | 72 65 73 65 6e 74 20 69 |rs not p|resent i|
|00003b40| 6e 20 41 53 43 49 49 2e | 0a 0a 0a 33 2e 33 3a 20 |n ASCII.|...3.3: |
|00003b50| 48 6f 77 20 64 6f 20 49 | 20 63 72 65 61 74 65 20 |How do I| create |
|00003b60| 61 20 43 2d 73 74 79 6c | 65 20 6e 75 6c 2d 74 65 |a C-styl|e nul-te|
|00003b70| 72 6d 69 6e 61 74 65 64 | 20 73 74 72 69 6e 67 3f |rminated| string?|
|00003b80| 0a 0a 20 20 20 49 6e 20 | 61 20 64 65 63 6c 61 72 |.. In |a declar|
|00003b90| 61 74 69 6f 6e 20 62 6c | 6f 63 6b 2c 20 61 70 70 |ation bl|ock, app|
|00003ba0| 65 6e 64 20 61 6e 20 41 | 53 43 49 49 2e 4e 55 4c |end an A|SCII.NUL|
|00003bb0| 20 74 6f 20 63 72 65 61 | 74 65 20 61 20 63 6f 6e | to crea|te a con|
|00003bc0| 73 74 61 6e 74 20 41 64 | 61 0a 20 20 20 73 74 72 |stant Ad|a. str|
|00003bd0| 69 6e 67 2e 0a 0a 20 20 | 20 20 20 64 65 63 6c 61 |ing... | decla|
|00003be0| 72 65 0a 20 20 20 20 20 | 20 20 53 74 72 5f 4e 75 |re. | Str_Nu|
|00003bf0| 6c 20 3a 20 63 6f 6e 73 | 74 61 6e 74 20 53 74 72 |l : cons|tant Str|
|00003c00| 69 6e 67 20 3a 3d 20 53 | 74 72 20 26 20 41 53 43 |ing := S|tr & ASC|
|00003c10| 49 49 2e 4e 55 4c 3b 0a | 20 20 20 20 20 62 65 67 |II.NUL;.| beg|
|00003c20| 69 6e 0a 20 20 20 20 20 | 20 20 43 61 6c 6c 5f 52 |in. | Call_R|
|00003c30| 65 71 75 69 72 69 6e 67 | 5f 43 5f 53 74 72 69 6e |equiring|_C_Strin|
|00003c40| 67 20 28 53 74 72 5f 4e | 75 6c 20 28 53 74 72 5f |g (Str_N|ul (Str_|
|00003c50| 4e 75 6c 27 46 69 72 73 | 74 29 27 41 64 64 72 65 |Nul'Firs|t)'Addre|
|00003c60| 73 73 29 3b 0a 20 20 20 | 20 20 65 6e 64 3b 0a 0a |ss);. | end;..|
|00003c70| 2d 2d 20 6f 72 20 2d 2d | 0a 0a 20 20 20 20 20 66 |-- or --|.. f|
|00003c80| 75 6e 63 74 69 6f 6e 20 | 4e 75 6c 5f 54 65 72 6d |unction |Nul_Term|
|00003c90| 69 6e 61 74 65 20 28 53 | 74 72 20 3a 20 53 74 72 |inate (S|tr : Str|
|00003ca0| 69 6e 67 29 0a 20 20 20 | 20 20 20 20 72 65 74 75 |ing). | retu|
|00003cb0| 72 6e 20 53 74 72 69 6e | 67 20 69 73 0a 20 20 20 |rn Strin|g is. |
|00003cc0| 20 20 20 20 53 74 72 5f | 4e 75 6c 20 3a 20 63 6f | Str_|Nul : co|
|00003cd0| 6e 73 74 61 6e 74 20 53 | 74 72 69 6e 67 20 3a 3d |nstant S|tring :=|
|00003ce0| 20 53 74 72 20 26 20 41 | 53 43 49 49 2e 4e 55 4c | Str & A|SCII.NUL|
|00003cf0| 3b 0a 20 20 20 20 20 62 | 65 67 69 6e 0a 20 20 20 |;. b|egin. |
|00003d00| 20 20 20 20 72 65 74 75 | 72 6e 20 53 74 72 5f 4e | retu|rn Str_N|
|00003d10| 75 6c 3b 0a 20 20 20 20 | 20 65 6e 64 20 4e 75 6c |ul;. | end Nul|
|00003d20| 5f 54 65 72 6d 69 6e 61 | 74 65 3b 0a 0a 0a 33 2e |_Termina|te;...3.|
|00003d30| 34 3a 20 48 6f 77 20 63 | 61 6e 20 49 20 63 72 65 |4: How c|an I cre|
|00003d40| 61 74 65 20 61 6e 20 61 | 72 72 61 79 20 6f 66 20 |ate an a|rray of |
|00003d50| 73 74 72 69 6e 67 73 20 | 6f 66 20 76 61 72 69 6f |strings |of vario|
|00003d60| 75 73 20 6c 65 6e 67 74 | 68 3f 0a 0a 20 20 20 49 |us lengt|h?.. I|
|00003d70| 6e 20 41 64 61 20 38 33 | 2c 20 79 6f 75 20 68 61 |n Ada 83|, you ha|
|00003d80| 76 65 20 74 6f 20 75 73 | 65 20 73 74 72 69 6e 67 |ve to us|e string|
|00003d90| 20 61 63 63 65 73 73 20 | 74 79 70 65 73 20 61 6e | access |types an|
|00003da0| 64 20 22 6e 65 77 22 20 | 74 6f 20 67 65 74 0a 20 |d "new" |to get. |
|00003db0| 20 20 22 72 61 67 67 65 | 64 22 20 61 72 72 61 79 | "ragge|d" array|
|00003dc0| 73 3a 0a 0a 20 20 20 20 | 20 74 79 70 65 20 53 74 |s:.. | type St|
|00003dd0| 72 69 6e 67 5f 41 63 63 | 65 73 73 20 69 73 0a 20 |ring_Acc|ess is. |
|00003de0| 20 20 20 20 20 20 61 63 | 63 65 73 73 20 53 74 72 | ac|cess Str|
|00003df0| 69 6e 67 3b 0a 0a 20 20 | 20 20 20 53 74 72 69 6e |ing;.. | Strin|
|00003e00| 67 73 20 3a 20 63 6f 6e | 73 74 61 6e 74 20 61 72 |gs : con|stant ar|
|00003e10| 72 61 79 20 28 50 6f 73 | 69 74 69 76 65 20 72 61 |ray (Pos|itive ra|
|00003e20| 6e 67 65 20 31 2e 2e 33 | 29 20 6f 66 20 53 74 72 |nge 1..3|) of Str|
|00003e30| 69 6e 67 5f 41 63 63 65 | 73 73 0a 20 20 20 20 20 |ing_Acce|ss. |
|00003e40| 20 20 20 20 20 20 20 20 | 3a 3d 20 28 20 31 20 3d | |:= ( 1 =|
|00003e50| 3e 20 6e 65 77 20 53 74 | 72 69 6e 67 27 28 22 4f |> new St|ring'("O|
|00003e60| 6e 65 22 29 2c 0a 20 20 | 20 20 20 20 20 20 20 20 |ne"),. | |
|00003e70| 20 20 20 20 20 20 20 20 | 32 20 3d 3e 20 6e 65 77 | |2 => new|
|00003e80| 20 53 74 72 69 6e 67 27 | 28 22 54 77 6f 22 29 2c | String'|("Two"),|
|00003e90| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00003ea0| 20 20 20 33 20 3d 3e 20 | 6e 65 77 20 53 74 72 69 | 3 => |new Stri|
|00003eb0| 6e 67 27 28 22 54 68 72 | 65 65 22 29 0a 20 20 20 |ng'("Thr|ee"). |
|00003ec0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 29 3b 0a | | );.|
|00003ed0| 0a 0a 20 20 20 49 6e 20 | 41 64 61 20 39 35 2c 20 |.. In |Ada 95, |
|00003ee0| 74 68 65 20 70 72 6f 63 | 65 73 73 20 69 73 20 73 |the proc|ess is s|
|00003ef0| 69 6d 70 6c 69 66 69 65 | 64 20 62 79 20 75 73 69 |implifie|d by usi|
|00003f00| 6e 67 20 61 6c 69 61 73 | 65 64 20 63 6f 6e 73 74 |ng alias|ed const|
|00003f10| 61 6e 74 73 3a 0a 0a 20 | 20 20 20 20 74 79 70 65 |ants:.. | type|
|00003f20| 20 53 74 72 69 6e 67 5f | 41 63 63 65 73 73 20 69 | String_|Access i|
|00003f30| 73 0a 20 20 20 20 20 20 | 20 61 63 63 65 73 73 20 |s. | access |
|00003f40| 63 6f 6e 73 74 61 6e 74 | 20 53 74 72 69 6e 67 3b |constant| String;|
|00003f50| 0a 0a 20 20 20 20 20 4f | 6e 65 20 3a 20 61 6c 69 |.. O|ne : ali|
|00003f60| 61 73 65 64 20 63 6f 6e | 73 74 61 6e 74 20 53 74 |ased con|stant St|
|00003f70| 72 69 6e 67 20 3a 3d 20 | 22 4f 6e 65 22 3b 0a 20 |ring := |"One";. |
|00003f80| 20 20 20 20 54 77 6f 20 | 3a 20 61 6c 69 61 73 65 | Two |: aliase|
|00003f90| 64 20 63 6f 6e 73 74 61 | 6e 74 20 53 74 72 69 6e |d consta|nt Strin|
|00003fa0| 67 20 3a 3d 20 22 54 77 | 6f 22 3b 0a 20 20 20 20 |g := "Tw|o";. |
|00003fb0| 20 54 68 72 65 65 20 3a | 20 61 6c 69 61 73 65 64 | Three :| aliased|
|00003fc0| 20 63 6f 6e 73 74 61 6e | 74 20 53 74 72 69 6e 67 | constan|t String|
|00003fd0| 20 3a 3d 20 22 54 68 72 | 65 65 22 3b 0a 0a 20 20 | := "Thr|ee";.. |
|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| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 3a 3d |. | :=|
|00004030| 20 28 20 31 20 3d 3e 20 | 4f 6e 65 27 41 63 63 65 | ( 1 => |One'Acce|
|00004040| 73 73 2c 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |ss,. | |
|00004050| 20 20 20 20 20 20 32 20 | 3d 3e 20 54 77 6f 27 41 | 2 |=> Two'A|
|00004060| 63 63 65 73 73 2c 0a 20 | 20 20 20 20 20 20 20 20 |ccess,. | |
|00004070| 20 20 20 20 20 20 20 20 | 20 33 20 3d 3e 20 54 68 | | 3 => Th|
|00004080| 72 65 65 27 41 63 63 65 | 73 73 0a 20 20 20 20 20 |ree'Acce|ss. |
|00004090| 20 20 20 20 20 20 20 20 | 20 20 20 29 3b 0a 0a 0a | | );...|
|000040a0| 33 2e 35 3a 20 49 20 6b | 6e 6f 77 20 61 6e 20 65 |3.5: I k|now an e|
|000040b0| 78 63 65 70 74 69 6f 6e | 20 69 73 20 72 61 69 73 |xception| is rais|
|000040c0| 65 64 2c 20 62 75 74 20 | 6d 79 20 70 72 6f 67 72 |ed, but |my progr|
|000040d0| 61 6d 20 71 75 69 74 73 | 20 77 69 74 68 20 6e 6f |am quits| with no|
|000040e0| 20 77 61 72 6e 69 6e 67 | 2e 20 57 68 79 3f 0a 0a | warning|. Why?..|
|000040f0| 0a 20 20 20 4f 6e 20 73 | 6f 6d 65 20 41 64 61 20 |. On s|ome Ada |
|00004100| 63 6f 6d 70 69 6c 65 72 | 73 2c 20 79 6f 75 20 68 |compiler|s, you h|
|00004110| 61 76 65 20 74 6f 20 6d | 61 6e 75 61 6c 6c 79 20 |ave to m|anually |
|00004120| 22 77 69 74 68 22 20 54 | 65 78 74 5f 49 4f 20 62 |"with" T|ext_IO b|
|00004130| 65 66 6f 72 65 0a 20 20 | 20 65 78 63 65 70 74 69 |efore. | excepti|
|00004140| 6f 6e 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 69 |on infor|mation i|
|00004150| 73 20 64 69 70 6c 61 79 | 65 64 20 74 6f 20 74 68 |s diplay|ed to th|
|00004160| 65 20 74 65 72 6d 69 6e | 61 6c 2e 0a 0a 20 20 20 |e termin|al... |
|00004170| 4f 6e 20 6f 74 68 65 72 | 20 41 64 61 20 63 6f 6d |On other| Ada com|
|00004180| 70 69 6c 65 72 73 2c 20 | 79 6f 75 20 6d 75 73 74 |pilers, |you must|
|00004190| 20 73 65 74 20 61 6e 20 | 65 6e 76 69 72 6f 6e 6d | set an |environm|
|000041a0| 65 6e 74 20 76 61 72 69 | 61 62 6c 65 20 66 6c 61 |ent vari|able fla|
|000041b0| 67 20 69 6e 0a 20 20 20 | 6f 72 64 65 72 20 74 6f |g in. |order to|
|000041c0| 20 63 61 75 73 65 20 74 | 68 65 20 65 78 63 65 70 | cause t|he excep|
|000041d0| 74 69 6f 6e 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |tion inf|ormation|
|000041e0| 20 74 72 61 63 65 20 74 | 6f 20 62 65 20 64 69 73 | trace t|o be dis|
|000041f0| 70 6c 61 79 65 64 2e 0a | 0a 0a 33 2e 36 3a 20 49 |played..|..3.6: I|
|00004200| 20 68 61 76 65 20 6f 6e | 6c 79 20 6f 6e 65 20 74 | have on|ly one t|
|00004210| 61 73 6b 20 69 6e 20 6d | 79 20 70 72 6f 67 72 61 |ask in m|y progra|
|00004220| 6d 2c 20 62 75 74 20 69 | 74 20 64 6f 65 73 6e 27 |m, but i|t doesn'|
|00004230| 74 20 73 65 65 6d 20 74 | 6f 20 72 75 6e 2e 20 57 |t seem t|o run. W|
|00004240| 68 79 3f 0a 0a 20 20 20 | 49 6e 20 41 64 61 2c 20 |hy?.. |In Ada, |
|00004250| 74 68 65 20 6d 61 69 6e | 20 70 72 6f 63 65 64 75 |the main| procedu|
|00004260| 72 65 20 69 73 20 61 75 | 74 6f 6d 61 74 69 63 61 |re is au|tomatica|
|00004270| 6c 6c 79 20 64 65 73 69 | 67 6e 61 74 65 64 20 61 |lly desi|gnated a|
|00004280| 73 20 61 20 74 61 73 6b | 2e 20 54 68 69 73 0a 20 |s a task|. This. |
|00004290| 20 20 74 61 73 6b 20 6d | 61 79 20 62 65 20 72 75 | task m|ay be ru|
|000042a0| 6e 6e 69 6e 67 20 66 6f | 72 65 76 65 72 2c 20 74 |nning fo|rever, t|
|000042b0| 68 75 73 20 73 74 61 72 | 76 69 6e 67 20 79 6f 75 |hus star|ving you|
|000042c0| 72 20 6f 74 68 65 72 20 | 74 61 73 6b 28 73 29 2c |r other |task(s),|
|000042d0| 20 62 65 63 61 75 73 65 | 0a 20 20 20 72 6f 75 6e | because|. roun|
|000042e0| 64 2d 72 6f 62 69 6e 20 | 73 63 68 65 64 75 6c 69 |d-robin |scheduli|
|000042f0| 6e 67 20 28 74 69 6d 65 | 2d 73 6c 69 63 69 6e 67 |ng (time|-slicing|
|00004300| 29 20 69 73 20 6e 6f 74 | 20 72 65 71 75 69 72 65 |) is not| require|
|00004310| 64 20 28 70 72 65 2d 65 | 6d 70 74 69 76 65 0a 20 |d (pre-e|mptive. |
|00004320| 20 20 73 63 68 65 64 75 | 6c 69 6e 67 20 61 70 70 | schedu|ling app|
|00004330| 6c 69 65 73 20 74 6f 20 | 74 61 73 6b 73 20 77 69 |lies to |tasks wi|
|00004340| 74 68 20 64 69 66 66 65 | 72 65 6e 74 20 6c 65 76 |th diffe|rent lev|
|00004350| 65 6c 73 20 6f 66 20 70 | 72 69 6f 72 69 74 79 29 |els of p|riority)|
|00004360| 2e 0a 0a 20 20 20 49 66 | 20 74 68 65 20 74 61 73 |... If| the tas|
|00004370| 6b 20 69 6e 20 71 75 65 | 73 74 69 6f 6e 20 69 73 |k in que|stion is|
|00004380| 20 67 65 74 74 69 6e 67 | 20 73 74 61 72 76 65 64 | getting| starved|
|00004390| 2c 20 69 74 27 73 20 61 | 20 70 72 6f 67 72 61 6d |, it's a| program|
|000043a0| 6d 65 72 20 70 72 6f 62 | 6c 65 6d 2c 0a 20 20 20 |mer prob|lem,. |
|000043b0| 6e 6f 74 20 61 6e 20 41 | 64 61 20 70 72 6f 62 6c |not an A|da probl|
|000043c0| 65 6d 2e 20 54 68 65 20 | 70 72 6f 67 72 61 6d 6d |em. The |programm|
|000043d0| 65 72 20 68 61 73 20 74 | 6f 20 75 73 65 20 61 6e |er has t|o use an|
|000043e0| 20 41 64 61 20 63 6f 6d | 70 69 6c 65 72 20 74 68 | Ada com|piler th|
|000043f0| 61 74 0a 20 20 20 73 75 | 70 70 6f 72 74 73 20 70 |at. su|pports p|
|00004400| 72 61 67 6d 61 20 54 69 | 6d 65 5f 53 6c 69 63 65 |ragma Ti|me_Slice|
|00004410| 2c 20 6f 72 20 64 6f 20 | 74 68 65 20 73 63 68 65 |, or do |the sche|
|00004420| 64 75 6c 69 6e 67 20 68 | 69 6d 73 65 6c 66 20 28 |duling h|imself (|
|00004430| 62 79 20 63 68 61 6e 67 | 69 6e 67 0a 20 20 20 74 |by chang|ing. t|
|00004440| 68 65 20 69 6d 70 6c 65 | 6d 65 6e 74 61 74 69 6f |he imple|mentatio|
|00004450| 6e 20 6f 66 20 68 69 73 | 20 41 64 61 20 70 72 6f |n of his| Ada pro|
|00004460| 67 72 61 6d 20 74 6f 20 | 65 6e 73 75 72 65 20 74 |gram to |ensure t|
|00004470| 68 61 74 20 6e 6f 20 74 | 61 73 6b 20 73 74 61 72 |hat no t|ask star|
|00004480| 76 65 73 0a 20 20 20 61 | 6e 6f 74 68 65 72 29 2e |ves. a|nother).|
|00004490| 0a 0a 20 20 20 4f 6e 65 | 20 73 6f 6c 75 74 69 6f |.. One| solutio|
|000044a0| 6e 20 69 73 20 74 6f 20 | 65 78 70 6c 69 63 69 74 |n is to |explicit|
|000044b0| 6c 79 20 70 75 74 20 74 | 68 65 20 6d 61 69 6e 20 |ly put t|he main |
|000044c0| 74 61 73 6b 20 74 6f 20 | 73 6c 65 65 70 20 77 69 |task to |sleep wi|
|000044d0| 74 68 69 6e 20 61 20 6c | 6f 6f 70 0a 20 20 20 63 |thin a l|oop. c|
|000044e0| 6f 6e 73 74 72 75 63 74 | 20 69 6e 20 6f 72 64 65 |onstruct| in orde|
|000044f0| 72 20 74 6f 20 61 76 6f | 69 64 20 73 74 61 72 76 |r to avo|id starv|
|00004500| 61 74 69 6f 6e 20 6f 66 | 20 74 68 65 20 6f 74 68 |ation of| the oth|
|00004510| 65 72 20 74 61 73 6b 28 | 73 29 2c 20 61 73 20 69 |er task(|s), as i|
|00004520| 6e 3a 0a 0a 20 20 20 20 | 20 70 72 6f 63 65 64 75 |n:.. | procedu|
|00004530| 72 65 20 4d 61 69 6e 20 | 69 73 0a 20 20 20 20 20 |re Main |is. |
|00004540| 20 20 74 61 73 6b 20 54 | 65 73 74 3b 0a 20 20 20 | task T|est;. |
|00004550| 20 20 20 20 74 61 73 6b | 20 62 6f 64 79 20 54 65 | task| body Te|
|00004560| 73 74 20 69 73 0a 20 20 | 20 20 20 20 20 62 65 67 |st is. | beg|
|00004570| 69 6e 0a 20 20 20 20 20 | 20 20 20 20 6c 6f 6f 70 |in. | loop|
|00004580| 0a 20 20 20 20 20 20 20 | 20 20 20 20 64 65 6c 61 |. | dela|
|00004590| 79 20 31 2e 30 3b 0a 20 | 20 20 20 20 20 20 20 20 |y 1.0;. | |
|000045a0| 20 20 54 65 78 74 5f 49 | 4f 2e 50 75 74 5f 4c 69 | Text_I|O.Put_Li|
|000045b0| 6e 65 20 28 22 54 65 73 | 74 22 29 3b 0a 20 20 20 |ne ("Tes|t");. |
|000045c0| 20 20 20 20 20 20 65 6e | 64 20 6c 6f 6f 70 3b 0a | en|d loop;.|
|000045d0| 20 20 20 20 20 20 20 65 | 6e 64 20 54 65 73 74 3b | e|nd Test;|
|000045e0| 0a 20 20 20 20 20 62 65 | 67 69 6e 0a 20 20 20 20 |. be|gin. |
|000045f0| 20 20 20 6c 6f 6f 70 0a | 20 20 20 20 20 20 20 20 | loop.| |
|00004600| 20 64 65 6c 61 79 20 32 | 30 2e 30 3b 0a 20 20 20 | delay 2|0.0;. |
|00004610| 20 20 20 20 20 20 54 65 | 78 74 5f 49 4f 2e 50 75 | Te|xt_IO.Pu|
|00004620| 74 5f 4c 69 6e 65 20 28 | 22 53 6c 65 65 70 69 6e |t_Line (|"Sleepin|
|00004630| 67 20 74 68 65 6e 20 77 | 72 69 74 69 6e 67 22 29 |g then w|riting")|
|00004640| 3b 0a 20 20 20 20 20 20 | 20 65 6e 64 20 6c 6f 6f |;. | end loo|
|00004650| 70 3b 0a 20 20 20 20 20 | 65 6e 64 20 4d 61 69 6e |p;. |end Main|
|00004660| 3b 0a 0a 0a 33 2e 37 3a | 20 48 6f 77 20 64 6f 20 |;...3.7:| How do |
|00004670| 49 20 69 6e 63 72 65 61 | 73 65 20 74 68 65 20 73 |I increa|se the s|
|00004680| 74 61 63 6b 20 73 69 7a | 65 20 66 6f 72 20 61 20 |tack siz|e for a |
|00004690| 74 61 73 6b 3f 0a 0a 20 | 20 20 44 65 66 69 6e 65 |task?.. | Define|
|000046a0| 20 74 68 65 20 74 61 73 | 6b 20 61 73 20 61 20 22 | the tas|k as a "|
|000046b0| 74 61 73 6b 20 74 79 70 | 65 22 20 61 6e 64 20 74 |task typ|e" and t|
|000046c0| 68 65 6e 20 75 73 65 20 | 61 20 70 72 61 67 6d 61 |hen use |a pragma|
|000046d0| 20 72 65 70 72 65 73 65 | 6e 74 61 74 69 6f 6e 0a | represe|ntation.|
|000046e0| 20 20 20 63 6c 61 75 73 | 65 2e 0a 0a 20 20 20 20 | claus|e... |
|000046f0| 20 74 61 73 6b 20 74 79 | 70 65 20 41 5f 54 61 73 | task ty|pe A_Tas|
|00004700| 6b 5f 54 79 70 65 3b 0a | 20 20 20 20 20 66 6f 72 |k_Type;.| for|
|00004710| 20 41 5f 54 61 73 6b 5f | 54 79 70 65 27 53 54 4f | A_Task_|Type'STO|
|00004720| 52 41 47 45 5f 53 49 5a | 45 20 75 73 65 20 31 30 |RAGE_SIZ|E use 10|
|00004730| 5f 30 30 30 3b 0a 20 20 | 20 20 20 2d 2d 20 31 30 |_000;. | -- 10|
|00004740| 4b 20 62 79 74 65 73 20 | 61 6c 6c 6f 63 61 74 65 |K bytes |allocate|
|00004750| 64 20 74 6f 20 69 6e 73 | 74 61 6e 63 65 73 20 6f |d to ins|tances o|
|00004760| 66 20 41 5f 54 61 73 6b | 5f 54 79 70 65 0a 20 20 |f A_Task|_Type. |
|00004770| 20 20 20 41 5f 54 61 73 | 6b 20 3a 20 41 5f 54 61 | A_Tas|k : A_Ta|
|00004780| 73 6b 5f 54 79 70 65 3b | 0a 0a 0a 33 2e 38 3a 20 |sk_Type;|...3.8: |
|00004790| 57 68 61 74 27 73 20 74 | 68 65 20 64 69 66 66 65 |What's t|he diffe|
|000047a0| 72 65 6e 63 65 20 62 65 | 74 77 65 65 6e 20 61 20 |rence be|tween a |
|000047b0| 74 79 70 65 20 63 6f 6e | 76 65 72 73 69 6f 6e 20 |type con|version |
|000047c0| 61 6e 64 20 61 20 71 75 | 61 6c 69 66 69 65 72 3f |and a qu|alifier?|
|000047d0| 0a 0a 20 20 20 55 73 65 | 20 61 20 71 75 61 6c 69 |.. Use| a quali|
|000047e0| 66 69 65 72 20 28 74 69 | 63 6b 29 20 74 6f 20 74 |fier (ti|ck) to t|
|000047f0| 65 6c 6c 20 74 68 65 20 | 63 6f 6d 70 69 6c 65 72 |ell the |compiler|
|00004800| 20 77 68 61 74 20 74 79 | 70 65 20 69 74 20 63 61 | what ty|pe it ca|
|00004810| 6e 20 65 78 70 65 63 74 | 3b 0a 20 20 20 74 68 69 |n expect|;. thi|
|00004820| 73 20 69 73 20 73 74 72 | 69 63 74 6c 79 20 61 20 |s is str|ictly a |
|00004830| 63 6f 6d 70 69 6c 65 2d | 74 69 6d 65 20 69 73 73 |compile-|time iss|
|00004840| 75 65 3a 20 61 20 71 75 | 61 6c 69 66 69 65 72 20 |ue: a qu|alifier |
|00004850| 22 68 69 6e 74 73 22 20 | 74 68 65 20 74 79 70 65 |"hints" |the type|
|00004860| 2c 0a 20 20 20 75 73 75 | 61 6c 6c 79 20 74 6f 20 |,. usu|ally to |
|00004870| 72 65 6d 6f 76 65 20 61 | 6e 20 61 6d 62 69 67 75 |remove a|n ambigu|
|00004880| 69 74 79 2e 20 55 73 65 | 20 61 20 63 6f 6e 76 65 |ity. Use| a conve|
|00004890| 72 73 69 6f 6e 20 74 6f | 20 74 65 6c 6c 20 74 68 |rsion to| tell th|
|000048a0| 65 20 63 6f 6d 70 69 6c | 65 72 0a 20 20 20 74 6f |e compil|er. to|
|000048b0| 20 63 6f 6e 76 65 72 74 | 20 61 6e 20 65 78 70 72 | convert| an expr|
|000048c0| 65 73 73 69 6f 6e 20 66 | 72 6f 6d 20 6f 6e 65 20 |ession f|rom one |
|000048d0| 74 79 70 65 20 74 6f 20 | 61 6e 6f 74 68 65 72 20 |type to |another |
|000048e0| 28 75 73 75 61 6c 6c 79 | 20 77 69 74 68 69 6e 20 |(usually| within |
|000048f0| 6f 6e 65 0a 20 20 20 64 | 65 72 69 76 61 74 69 6f |one. d|erivatio|
|00004900| 6e 20 68 69 65 72 61 72 | 63 68 79 29 3b 20 74 68 |n hierar|chy); th|
|00004910| 69 73 20 6f 70 65 72 61 | 74 69 6f 6e 20 6d 61 79 |is opera|tion may|
|00004920| 20 72 65 71 75 69 72 65 | 20 61 20 63 68 61 6e 67 | require| a chang|
|00004930| 65 20 6f 66 0a 20 20 20 | 72 65 70 72 65 73 65 6e |e of. |represen|
|00004940| 74 61 74 69 6f 6e 20 61 | 74 20 72 75 6e 2d 74 69 |tation a|t run-ti|
|00004950| 6d 65 20 28 65 2e 67 2e | 20 69 6e 20 63 61 73 65 |me (e.g.| in case|
|00004960| 20 6f 66 20 61 20 72 65 | 70 72 65 73 65 6e 74 61 | of a re|presenta|
|00004970| 74 69 6f 6e 20 63 6c 61 | 75 73 65 0a 20 20 20 61 |tion cla|use. a|
|00004980| 70 70 6c 79 69 6e 67 20 | 65 78 63 6c 75 73 69 76 |pplying |exclusiv|
|00004990| 65 6c 79 20 74 6f 20 74 | 68 65 20 73 6f 75 72 63 |ely to t|he sourc|
|000049a0| 65 20 74 79 70 65 29 2e | 0a 0a 20 20 20 20 20 41 |e type).|.. A|
|000049b0| 20 3a 20 49 6e 74 65 67 | 65 72 20 3a 3d 20 49 6e | : Integ|er := In|
|000049c0| 74 65 67 65 72 27 28 31 | 29 3b 20 20 2d 2d 20 74 |teger'(1|); -- t|
|000049d0| 68 69 73 20 69 73 20 61 | 20 71 75 61 6c 69 66 69 |his is a| qualifi|
|000049e0| 65 72 3a 20 73 61 6d 65 | 20 61 73 20 22 3a 3d 20 |er: same| as ":= |
|000049f0| 31 3b 22 0a 20 20 20 20 | 20 42 20 3a 20 49 6e 74 |1;". | B : Int|
|00004a00| 65 67 65 72 20 3a 3d 20 | 49 6e 74 65 67 65 72 20 |eger := |Integer |
|00004a10| 28 31 29 3b 20 20 2d 2d | 20 74 68 69 73 20 69 73 |(1); --| this is|
|00004a20| 20 61 20 63 6f 6e 76 65 | 72 73 69 6f 6e 0a 0a 0a | a conve|rsion...|
|00004a30| 33 2e 39 3a 20 48 6f 77 | 20 64 6f 20 49 20 61 76 |3.9: How| do I av|
|00004a40| 6f 69 64 20 74 68 65 20 | 70 6f 74 65 6e 74 69 61 |oid the |potentia|
|00004a50| 6c 20 73 70 61 63 65 20 | 69 6e 20 66 72 6f 6e 74 |l space |in front|
|00004a60| 20 6f 66 20 49 6e 74 65 | 67 65 72 27 49 6d 61 67 | of Inte|ger'Imag|
|00004a70| 65 3f 0a 0a 20 20 20 55 | 73 65 20 74 68 65 20 66 |e?.. U|se the f|
|00004a80| 75 6e 63 74 69 6f 6e 20 | 54 72 69 6d 20 66 72 6f |unction |Trim fro|
|00004a90| 6d 20 70 61 63 6b 61 67 | 65 20 41 64 61 2e 53 74 |m packag|e Ada.St|
|00004aa0| 72 69 6e 67 73 2e 46 69 | 78 65 64 20 28 79 6f 75 |rings.Fi|xed (you|
|00004ab0| 20 63 61 6e 0a 20 20 20 | 61 63 74 75 61 6c 6c 79 | can. |actually|
|00004ac0| 20 74 72 69 6d 20 73 74 | 72 69 6e 67 73 20 69 6e | trim st|rings in|
|00004ad0| 20 6d 61 6e 79 20 6f 74 | 68 65 72 20 75 73 65 66 | many ot|her usef|
|00004ae0| 75 6c 20 77 61 79 73 29 | 3a 0a 0a 20 20 20 20 20 |ul ways)|:.. |
|00004af0| 66 75 6e 63 74 69 6f 6e | 20 4d 79 5f 49 6d 61 67 |function| My_Imag|
|00004b00| 65 20 28 49 20 3a 20 49 | 6e 74 65 67 65 72 29 0a |e (I : I|nteger).|
|00004b10| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 53 74 | r|eturn St|
|00004b20| 72 69 6e 67 20 69 73 0a | 20 20 20 20 20 62 65 67 |ring is.| beg|
|00004b30| 69 6e 20 2d 2d 20 4d 79 | 5f 49 6d 61 67 65 0a 20 |in -- My|_Image. |
|00004b40| 20 20 20 20 20 20 72 65 | 74 75 72 6e 20 41 64 61 | re|turn Ada|
|00004b50| 2e 53 74 72 69 6e 67 73 | 2e 46 69 78 65 64 2e 54 |.Strings|.Fixed.T|
|00004b60| 72 69 6d 20 28 49 6e 74 | 65 67 65 72 27 49 6d 61 |rim (Int|eger'Ima|
|00004b70| 67 65 20 28 49 29 2c 20 | 41 64 61 2e 53 74 72 69 |ge (I), |Ada.Stri|
|00004b80| 6e 67 73 2e 4c 65 66 74 | 29 3b 0a 20 20 20 20 20 |ngs.Left|);. |
|00004b90| 65 6e 64 20 4d 79 5f 49 | 6d 61 67 65 3b 0a 0a 20 |end My_I|mage;.. |
|00004ba0| 20 20 20 20 2e 2e 2e 20 | 4d 79 5f 49 6d 61 67 65 | ... |My_Image|
|00004bb0| 20 28 31 32 29 20 3d 20 | 22 31 32 22 20 2e 2e 2e | (12) = |"12" ...|
|00004bc0| 0a 0a 0a 20 20 20 49 6e | 20 41 64 61 20 38 33 2c |... In| Ada 83,|
|00004bd0| 20 63 6f 64 65 20 61 20 | 66 75 6e 63 74 69 6f 6e | code a |function|
|00004be0| 20 74 68 61 74 20 61 63 | 63 65 70 74 73 20 61 20 | that ac|cepts a |
|00004bf0| 73 74 72 69 6e 67 20 61 | 6e 64 20 73 74 72 69 70 |string a|nd strip|
|00004c00| 73 20 74 68 65 0a 20 20 | 20 6c 65 61 64 69 6e 67 |s the. | leading|
|00004c10| 20 62 6c 61 6e 6b 3a 0a | 0a 20 20 20 20 20 66 75 | blank:.|. fu|
|00004c20| 6e 63 74 69 6f 6e 20 53 | 74 72 69 70 5f 4c 65 61 |nction S|trip_Lea|
|00004c30| 64 69 6e 67 5f 42 6c 61 | 6e 6b 20 28 53 74 72 20 |ding_Bla|nk (Str |
|00004c40| 3a 20 53 74 72 69 6e 67 | 29 0a 20 20 20 20 20 20 |: String|). |
|00004c50| 20 72 65 74 75 72 6e 20 | 53 74 72 69 6e 67 20 69 | return |String i|
|00004c60| 73 0a 20 20 20 20 20 62 | 65 67 69 6e 20 2d 2d 20 |s. b|egin -- |
|00004c70| 53 74 72 69 70 5f 4c 65 | 61 64 69 6e 67 5f 42 6c |Strip_Le|ading_Bl|
|00004c80| 61 6e 6b 0a 20 20 20 20 | 20 20 20 69 66 20 53 74 |ank. | if St|
|00004c90| 72 20 28 53 74 72 27 46 | 69 72 73 74 29 20 3d 20 |r (Str'F|irst) = |
|00004ca0| 27 20 27 20 74 68 65 6e | 0a 20 20 20 20 20 20 20 |' ' then|. |
|00004cb0| 20 20 72 65 74 75 72 6e | 20 53 74 72 20 28 31 2b | return| Str (1+|
|00004cc0| 53 74 72 27 46 69 72 73 | 74 20 2e 2e 20 53 74 72 |Str'Firs|t .. Str|
|00004cd0| 27 4c 61 73 74 29 3b 0a | 20 20 20 20 20 20 20 65 |'Last);.| e|
|00004ce0| 6c 73 65 0a 20 20 20 20 | 20 20 20 20 20 72 65 74 |lse. | ret|
|00004cf0| 75 72 6e 20 53 74 72 3b | 0a 20 20 20 20 20 20 20 |urn Str;|. |
|00004d00| 65 6e 64 20 69 66 3b 0a | 20 20 20 20 20 65 6e 64 |end if;.| end|
|00004d10| 20 53 74 72 69 70 5f 4c | 65 61 64 69 6e 67 5f 42 | Strip_L|eading_B|
|00004d20| 6c 61 6e 6b 3b 0a 0a 20 | 20 20 20 20 2e 2e 2e 0a |lank;.. | ....|
|00004d30| 0a 20 20 20 20 20 66 75 | 6e 63 74 69 6f 6e 20 4d |. fu|nction M|
|00004d40| 79 5f 49 6d 61 67 65 20 | 28 49 20 3a 20 49 6e 74 |y_Image |(I : Int|
|00004d50| 65 67 65 72 29 0a 20 20 | 20 20 20 20 20 72 65 74 |eger). | ret|
|00004d60| 75 72 6e 20 53 74 72 69 | 6e 67 20 69 73 0a 20 20 |urn Stri|ng is. |
|00004d70| 20 20 20 62 65 67 69 6e | 20 2d 2d 20 4d 79 5f 49 | begin| -- My_I|
|00004d80| 6d 61 67 65 0a 20 20 20 | 20 20 20 20 72 65 74 75 |mage. | retu|
|00004d90| 72 6e 20 53 74 72 69 70 | 5f 4c 65 61 64 69 6e 67 |rn Strip|_Leading|
|00004da0| 5f 42 6c 61 6e 6b 20 28 | 49 6e 74 65 67 65 72 27 |_Blank (|Integer'|
|00004db0| 49 6d 61 67 65 20 28 49 | 29 29 3b 0a 20 20 20 20 |Image (I|));. |
|00004dc0| 20 65 6e 64 20 4d 79 5f | 49 6d 61 67 65 3b 0a 0a | end My_|Image;..|
|00004dd0| 20 20 20 20 20 2e 2e 2e | 20 4d 79 5f 49 6d 61 67 | ...| My_Imag|
|00004de0| 65 20 28 31 32 29 20 3d | 20 22 31 32 22 20 2e 2e |e (12) =| "12" ..|
|00004df0| 2e 0a 0a 0a 33 2e 31 30 | 3a 20 57 68 79 20 69 73 |....3.10|: Why is|
|00004e00| 20 61 6e 20 65 78 63 65 | 70 74 69 6f 6e 20 72 61 | an exce|ption ra|
|00004e10| 69 73 65 64 20 77 68 65 | 6e 20 67 69 76 69 6e 67 |ised whe|n giving|
|00004e20| 20 61 20 64 65 66 61 75 | 6c 74 20 64 69 73 63 72 | a defau|lt discr|
|00004e30| 69 6d 69 6e 61 6e 74 3f | 0a 0a 20 20 20 4c 65 74 |iminant?|.. Let|
|00004e40| 27 73 20 61 73 73 75 6d | 65 20 79 6f 75 20 77 6f |'s assum|e you wo|
|00004e50| 75 6c 64 20 6c 69 6b 65 | 20 74 6f 20 6d 6f 64 65 |uld like| to mode|
|00004e60| 6c 20 76 61 72 79 69 6e | 67 2d 6c 65 6e 67 74 68 |l varyin|g-length|
|00004e70| 20 73 74 72 69 6e 67 73 | 3a 0a 0a 20 20 20 20 20 | strings|:.. |
|00004e80| 74 79 70 65 20 56 5f 53 | 74 72 69 6e 67 20 28 53 |type V_S|tring (S|
|00004e90| 69 7a 65 20 3a 20 4e 61 | 74 75 72 61 6c 20 3a 3d |ize : Na|tural :=|
|00004ea0| 20 30 29 20 69 73 0a 20 | 20 20 20 20 20 20 72 65 | 0) is. | re|
|00004eb0| 63 6f 72 64 0a 20 20 20 | 20 20 20 20 20 20 53 20 |cord. | S |
|00004ec0| 3a 20 53 74 72 69 6e 67 | 20 28 31 20 2e 2e 20 53 |: String| (1 .. S|
|00004ed0| 69 7a 65 29 3b 0a 20 20 | 20 20 20 20 20 65 6e 64 |ize);. | end|
|00004ee0| 20 72 65 63 6f 72 64 3b | 0a 0a 0a 20 20 20 28 66 | record;|... (f|
|00004ef0| 72 6f 6d 20 52 6f 62 65 | 72 74 20 44 65 77 61 72 |rom Robe|rt Dewar|
|00004f00| 29 0a 0a 20 20 20 57 68 | 65 6e 20 79 6f 75 20 67 |).. Wh|en you g|
|00004f10| 69 76 65 20 61 20 64 65 | 66 61 75 6c 74 20 64 69 |ive a de|fault di|
|00004f20| 73 63 72 69 6d 69 6e 61 | 6e 74 2c 20 74 68 65 6e |scrimina|nt, then|
|00004f30| 20 6f 6e 65 20 6d 65 74 | 68 6f 64 20 28 49 20 61 | one met|hod (I a|
|00004f40| 63 74 75 61 6c 6c 79 0a | 20 20 20 74 68 69 6e 6b |ctually.| think|
|00004f50| 20 69 74 20 69 73 20 74 | 68 65 20 70 72 65 66 65 | it is t|he prefe|
|00004f60| 72 72 65 64 20 6d 65 74 | 68 6f 64 29 20 6f 66 20 |rred met|hod) of |
|00004f70| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 20 69 |implemen|tation i|
|00004f80| 73 20 74 6f 20 61 6c 6c | 6f 63 61 74 65 20 74 68 |s to all|ocate th|
|00004f90| 65 0a 20 20 20 6d 61 78 | 69 6d 75 6d 20 70 6f 73 |e. max|imum pos|
|00004fa0| 73 69 62 6c 65 20 6c 65 | 6e 67 74 68 2e 20 53 69 |sible le|ngth. Si|
|00004fb0| 6e 63 65 20 79 6f 75 72 | 20 64 69 73 63 72 69 6d |nce your| discrim|
|00004fc0| 69 6e 61 6e 74 20 69 73 | 20 6f 66 20 74 79 70 65 |inant is| of type|
|00004fd0| 20 4e 61 74 75 72 61 6c | 2c 0a 20 20 20 74 68 69 | Natural|,. thi|
|00004fe0| 73 20 63 6c 65 61 72 6c | 79 20 77 6f 6e 27 74 20 |s clearl|y won't |
|00004ff0| 77 6f 72 6b 21 0a 0a 20 | 20 20 47 4e 41 54 20 6d |work!.. | GNAT m|
|00005000| 61 79 20 63 6f 6d 70 69 | 6c 65 20 69 74 2c 20 62 |ay compi|le it, b|
|00005010| 75 74 20 69 74 20 77 6f | 6e 27 74 20 72 75 6e 20 |ut it wo|n't run |
|00005020| 69 74 2c 20 61 6e 64 20 | 69 6e 64 65 65 64 20 49 |it, and |indeed I|
|00005030| 20 63 6f 6e 73 69 64 65 | 72 20 69 74 20 61 0a 20 | conside|r it a. |
|00005040| 20 20 47 4e 41 54 20 62 | 75 67 20 28 6f 6e 20 74 | GNAT b|ug (on t|
|00005050| 68 65 20 74 6f 64 6f 20 | 6c 69 73 74 29 20 74 68 |he todo |list) th|
|00005060| 61 74 20 6e 6f 20 77 61 | 72 6e 69 6e 67 20 69 73 |at no wa|rning is|
|00005070| 20 69 73 73 75 65 64 20 | 61 74 20 63 6f 6d 70 69 | issued |at compi|
|00005080| 6c 65 20 74 69 6d 65 0a | 20 20 20 66 6f 72 20 74 |le time.| for t|
|00005090| 68 69 73 20 6d 69 73 75 | 73 65 2e 0a 0a 20 20 20 |his misu|se... |
|000050a0| 53 6f 6d 65 20 63 6f 6d | 70 69 6c 65 72 73 2c 20 |Some com|pilers, |
|000050b0| 6e 6f 74 61 62 6c 79 20 | 41 6c 73 79 73 20 61 6e |notably |Alsys an|
|000050c0| 64 20 52 52 2c 20 68 61 | 76 65 20 61 74 20 6c 65 |d RR, ha|ve at le|
|000050d0| 61 73 74 20 70 61 72 74 | 69 61 6c 6c 79 20 22 73 |ast part|ially "s|
|000050e0| 6f 6c 76 65 64 22 0a 20 | 20 20 74 68 69 73 20 70 |olved". | this p|
|000050f0| 72 6f 62 6c 65 6d 20 62 | 79 20 69 6e 74 72 6f 64 |roblem b|y introd|
|00005100| 75 63 69 6e 67 20 68 69 | 64 64 65 6e 20 70 6f 69 |ucing hi|dden poi|
|00005110| 6e 74 65 72 73 2c 20 62 | 75 74 20 74 68 69 73 20 |nters, b|ut this |
|00005120| 74 6f 20 6d 65 20 69 73 | 20 61 6e 0a 20 20 20 75 |to me is| an. u|
|00005130| 6e 64 65 73 69 72 61 62 | 6c 65 20 69 6d 70 6c 65 |ndesirab|le imple|
|00005140| 6d 65 6e 74 61 74 69 6f | 6e 20 63 68 6f 69 63 65 |mentatio|n choice|
|00005150| 2e 0a 0a 20 20 20 46 69 | 72 73 74 2c 20 69 74 20 |... Fi|rst, it |
|00005160| 6d 65 61 6e 73 20 74 68 | 65 72 65 20 69 73 20 68 |means th|ere is h|
|00005170| 69 64 64 65 6e 20 68 65 | 61 70 20 61 63 74 69 76 |idden he|ap activ|
|00005180| 69 74 79 2c 20 77 68 69 | 63 68 20 73 65 65 6d 73 |ity, whi|ch seems|
|00005190| 0a 20 20 20 75 6e 64 65 | 73 69 72 61 62 6c 65 2e |. unde|sirable.|
|000051a0| 20 49 6e 20 61 20 6c 61 | 6e 67 75 61 67 65 20 77 | In a la|nguage w|
|000051b0| 68 65 72 65 20 70 6f 69 | 6e 74 65 72 73 20 61 72 |here poi|nters ar|
|000051c0| 65 20 65 78 70 6c 69 63 | 69 74 2c 20 69 74 20 69 |e explic|it, it i|
|000051d0| 73 0a 20 20 20 67 65 6e | 65 72 61 6c 6c 79 20 61 |s. gen|erally a|
|000051e0| 20 67 6f 6f 64 20 69 64 | 65 61 20 69 66 20 61 6c | good id|ea if al|
|000051f0| 6c 6f 63 61 74 69 6f 6e | 20 69 73 20 61 6c 73 6f |location| is also|
|00005200| 20 65 78 70 6c 69 63 69 | 74 2c 20 61 6e 64 20 63 | explici|t, and c|
|00005210| 65 72 74 61 69 6e 6c 79 | 0a 20 20 20 66 6f 72 20 |ertainly|. for |
|00005220| 72 65 61 6c 2d 74 69 6d | 65 20 77 6f 72 6b 2c 20 |real-tim|e work, |
|00005230| 68 69 64 64 65 6e 20 61 | 6e 79 74 68 69 6e 67 20 |hidden a|nything |
|00005240| 69 73 20 77 6f 72 72 69 | 73 6f 6d 65 2e 0a 0a 20 |is worri|some... |
|00005250| 20 20 53 65 63 6f 6e 64 | 2c 20 69 74 20 69 73 20 | Second|, it is |
|00005260| 6e 6f 74 20 65 61 73 79 | 20 74 6f 20 64 6f 20 75 |not easy| to do u|
|00005270| 6e 69 66 6f 72 6d 6c 79 | 2e 20 41 6c 73 79 73 20 |niformly|. Alsys |
|00005280| 65 6e 64 73 20 75 70 20 | 69 6e 74 72 6f 64 75 63 |ends up |introduc|
|00005290| 69 6e 67 0a 20 20 20 61 | 72 62 69 74 72 61 72 79 |ing. a|rbitrary|
|000052a0| 20 72 65 73 74 72 69 63 | 74 69 6f 6e 73 20 6f 6e | restric|tions on|
|000052b0| 20 74 68 65 20 63 6f 6d | 70 6f 73 69 74 69 6f 6e | the com|position|
|000052c0| 20 6f 66 20 73 75 63 68 | 20 74 79 70 65 73 20 28 | of such| types (|
|000052d0| 74 72 79 20 6d 61 6b 69 | 6e 67 20 61 6e 0a 20 20 |try maki|ng an. |
|000052e0| 20 61 72 72 61 79 20 6f | 66 20 74 68 65 6d 29 2c | array o|f them),|
|000052f0| 20 61 6e 64 20 52 52 20 | 69 6e 74 72 6f 64 75 63 | and RR |introduc|
|00005300| 65 73 20 6e 6f 6e 2d 63 | 6f 6e 74 69 67 75 6f 75 |es non-c|ontiguou|
|00005310| 73 20 72 65 70 72 65 73 | 65 6e 74 61 74 69 6f 6e |s repres|entation|
|00005320| 73 2c 0a 20 20 20 77 68 | 69 63 68 20 61 72 65 20 |s,. wh|ich are |
|00005330| 6c 65 67 61 6c 20 62 75 | 74 20 74 72 6f 75 62 6c |legal bu|t troubl|
|00005340| 65 73 6f 6d 65 2e 0a 0a | 20 20 20 54 6f 20 22 73 |esome...| To "s|
|00005350| 6f 6c 76 65 22 20 74 68 | 65 20 70 72 6f 62 6c 65 |olve" th|e proble|
|00005360| 6d 20 79 6f 75 72 73 65 | 6c 66 2c 20 6a 75 73 74 |m yourse|lf, just|
|00005370| 20 64 65 63 6c 61 72 65 | 20 61 20 72 65 61 73 6f | declare| a reaso|
|00005380| 6e 61 62 6c 65 20 6d 61 | 78 69 6d 75 6d 0a 20 20 |nable ma|ximum. |
|00005390| 20 6c 65 6e 67 74 68 2c | 20 61 6e 64 20 75 73 65 | length,| and use|
|000053a0| 20 61 20 73 75 62 74 79 | 70 65 20 72 65 70 72 65 | a subty|pe repre|
|000053b0| 73 65 6e 74 69 6e 67 20 | 74 68 69 73 20 6c 65 6e |senting |this len|
|000053c0| 67 74 68 20 61 73 20 74 | 68 65 20 73 75 62 74 79 |gth as t|he subty|
|000053d0| 70 65 20 6f 66 0a 20 20 | 20 74 68 65 20 64 69 73 |pe of. | the dis|
|000053e0| 63 72 69 6d 69 6e 61 6e | 74 3a 0a 0a 20 20 20 20 |criminan|t:.. |
|000053f0| 20 4d 61 78 5f 4c 65 6e | 67 74 68 20 3a 20 63 6f | Max_Len|gth : co|
|00005400| 6e 73 74 61 6e 74 20 3a | 3d 20 32 30 30 3b 0a 0a |nstant :|= 200;..|
|00005410| 20 20 20 20 20 73 75 62 | 74 79 70 65 20 49 6e 64 | sub|type Ind|
|00005420| 65 78 20 69 73 0a 20 20 | 20 20 20 20 20 4e 61 74 |ex is. | Nat|
|00005430| 75 72 61 6c 20 72 61 6e | 67 65 20 30 20 2e 2e 20 |ural ran|ge 0 .. |
|00005440| 4d 61 78 5f 4c 65 6e 67 | 74 68 3b 0a 0a 20 20 20 |Max_Leng|th;.. |
|00005450| 20 20 74 79 70 65 20 56 | 5f 53 74 72 69 6e 67 20 | type V|_String |
|00005460| 28 53 69 7a 65 20 3a 20 | 49 6e 64 65 78 20 3a 3d |(Size : |Index :=|
|00005470| 20 30 29 20 69 73 0a 20 | 20 20 20 20 20 20 72 65 | 0) is. | re|
|00005480| 63 6f 72 64 0a 20 20 20 | 20 20 20 20 20 20 53 20 |cord. | S |
|00005490| 3a 20 53 74 72 69 6e 67 | 20 28 31 20 2e 2e 20 53 |: String| (1 .. S|
|000054a0| 69 7a 65 29 3b 0a 20 20 | 20 20 20 20 20 65 6e 64 |ize);. | end|
|000054b0| 20 72 65 63 6f 72 64 3b | 0a 0a 0a 33 2e 31 31 3a | record;|...3.11:|
|000054c0| 20 57 68 65 6e 20 49 20 | 77 61 6e 74 20 61 6e 20 | When I |want an |
|000054d0| 49 6e 74 65 67 65 72 20 | 74 79 70 65 2c 20 77 68 |Integer |type, wh|
|000054e0| 61 74 27 73 20 77 72 6f | 6e 67 20 77 69 74 68 20 |at's wro|ng with |
|000054f0| 6a 75 73 74 20 75 73 69 | 6e 67 20 74 68 65 20 70 |just usi|ng the p|
|00005500| 72 65 64 65 66 69 6e 65 | 64 0a 74 79 70 65 20 49 |redefine|d.type I|
|00005510| 6e 74 65 67 65 72 20 6f | 72 20 4c 6f 6e 67 5f 49 |nteger o|r Long_I|
|00005520| 6e 74 65 67 65 72 3f 20 | 57 68 79 20 77 6f 75 6c |nteger? |Why woul|
|00005530| 64 20 49 20 65 76 65 72 | 20 77 61 6e 74 20 74 6f |d I ever| want to|
|00005540| 20 64 65 63 6c 61 72 65 | 20 6e 65 77 20 49 6e 74 | declare| new Int|
|00005550| 65 67 65 72 0a 74 79 70 | 65 73 3f 0a 0a 20 20 20 |eger.typ|es?.. |
|00005560| 49 66 20 79 6f 75 20 64 | 65 63 6c 61 72 65 20 32 |If you d|eclare 2|
|00005570| 20 64 69 73 74 69 6e 63 | 74 20 69 6e 74 65 67 65 | distinc|t intege|
|00005580| 72 20 74 79 70 65 73 2c | 20 66 6f 72 20 65 78 61 |r types,| for exa|
|00005590| 6d 70 6c 65 2c 0a 0a 20 | 20 20 20 20 74 79 70 65 |mple,.. | type|
|000055a0| 20 44 61 74 61 5f 49 6e | 64 65 78 20 20 20 20 20 | Data_In|dex |
|000055b0| 20 20 20 69 73 20 72 61 | 6e 67 65 20 31 2e 2e 31 | is ra|nge 1..1|
|000055c0| 30 30 3b 0a 20 20 20 20 | 20 74 79 70 65 20 54 69 |00;. | type Ti|
|000055d0| 6d 65 5f 53 65 72 69 65 | 73 5f 49 6e 64 65 78 20 |me_Serie|s_Index |
|000055e0| 69 73 20 72 61 6e 67 65 | 20 30 2e 2e 32 2a 2a 31 |is range| 0..2**1|
|000055f0| 35 2d 31 3b 0a 0a 0a 20 | 20 20 74 68 65 6e 20 6f |5-1;... | then o|
|00005600| 62 6a 65 63 74 73 20 6f | 66 20 74 79 70 65 20 44 |bjects o|f type D|
|00005610| 61 74 61 5f 49 6e 64 65 | 78 20 63 61 6e 27 74 20 |ata_Inde|x can't |
|00005620| 62 65 20 61 73 73 69 67 | 6e 65 64 20 28 64 69 72 |be assig|ned (dir|
|00005630| 65 63 74 6c 79 29 20 74 | 6f 0a 20 20 20 76 61 72 |ectly) t|o. var|
|00005640| 69 61 62 6c 65 73 20 6f | 66 20 74 79 70 65 20 54 |iables o|f type T|
|00005650| 69 6d 65 5f 53 65 72 69 | 65 73 5f 49 6e 64 65 78 |ime_Seri|es_Index|
|00005660| 2c 20 61 6e 64 20 76 69 | 63 65 2d 76 65 72 73 61 |, and vi|ce-versa|
|00005670| 2e 20 4c 69 6b 65 77 69 | 73 65 2c 0a 20 20 20 76 |. Likewi|se,. v|
|00005680| 61 72 69 61 62 6c 65 73 | 20 6f 66 20 74 68 65 73 |ariables| of thes|
|00005690| 65 20 32 20 74 79 70 65 | 73 20 63 61 6e 27 74 20 |e 2 type|s can't |
|000056a0| 62 65 20 6d 69 78 65 64 | 20 69 6e 20 61 72 69 74 |be mixed| in arit|
|000056b0| 68 6d 65 74 69 63 61 6c | 20 65 78 70 72 65 73 73 |hmetical| express|
|000056c0| 69 6f 6e 73 0a 20 20 20 | 28 77 69 74 68 6f 75 74 |ions. |(without|
|000056d0| 20 65 78 70 6c 69 63 69 | 74 20 74 79 70 65 20 63 | explici|t type c|
|000056e0| 6f 6e 76 65 72 73 69 6f | 6e 73 29 2e 20 54 68 69 |onversio|ns). Thi|
|000056f0| 73 20 6d 61 79 20 73 65 | 65 6d 20 6c 69 6b 65 20 |s may se|em like |
|00005700| 61 20 73 6f 75 72 63 65 | 20 6f 66 0a 20 20 20 65 |a source| of. e|
|00005710| 6e 64 6c 65 73 73 20 69 | 72 72 69 74 61 74 69 6f |ndless i|rritatio|
|00005720| 6e 2c 20 62 75 74 20 6f | 6e 20 74 68 65 20 63 6f |n, but o|n the co|
|00005730| 6e 74 72 61 72 79 2c 20 | 67 6f 6f 64 20 70 72 6f |ntrary, |good pro|
|00005740| 67 61 6d 6d 65 72 73 20 | 75 73 65 20 69 74 20 74 |gammers |use it t|
|00005750| 6f 0a 20 20 20 69 6d 70 | 72 6f 76 65 20 74 68 65 |o. imp|rove the|
|00005760| 20 63 6c 61 72 69 74 79 | 20 6f 66 20 74 68 65 69 | clarity| of thei|
|00005770| 72 20 63 6f 64 65 2c 20 | 74 6f 20 6d 61 6b 65 20 |r code, |to make |
|00005780| 69 74 20 6d 6f 72 65 20 | 72 6f 62 75 73 74 2c 20 |it more |robust, |
|00005790| 61 6e 64 20 6d 6f 72 65 | 0a 20 20 20 70 6f 72 74 |and more|. port|
|000057a0| 61 62 6c 65 2e 20 54 68 | 65 20 66 69 72 73 74 20 |able. Th|e first |
|000057b0| 32 20 65 78 61 6d 70 6c | 65 73 20 64 69 73 63 75 |2 exampl|es discu|
|000057c0| 73 73 20 74 68 69 73 2e | 20 54 68 65 20 74 68 69 |ss this.| The thi|
|000057d0| 72 64 20 65 78 61 6d 70 | 6c 65 0a 20 20 20 64 69 |rd examp|le. di|
|000057e0| 73 63 75 73 73 65 73 20 | 74 68 65 20 64 65 63 6c |scusses |the decl|
|000057f0| 61 72 61 74 69 6f 6e 20 | 6f 66 20 6d 61 63 68 69 |aration |of machi|
|00005800| 6e 65 2d 70 6f 72 74 61 | 62 6c 65 20 33 32 2d 62 |ne-porta|ble 32-b|
|00005810| 69 74 20 69 6e 74 65 67 | 65 72 73 2e 0a 20 20 20 |it integ|ers.. |
|00005820| 44 65 63 6c 61 72 69 6e | 67 20 6f 62 6a 65 63 74 |Declarin|g object|
|00005830| 73 20 6f 66 20 74 79 70 | 65 20 49 6e 74 65 67 65 |s of typ|e Intege|
|00005840| 72 20 63 61 6e 20 62 65 | 20 68 69 67 68 6c 79 20 |r can be| highly |
|00005850| 6e 6f 6e 2d 70 6f 72 74 | 61 62 6c 65 2c 20 61 6e |non-port|able, an|
|00005860| 64 20 6f 66 0a 20 20 20 | 63 6f 75 72 73 65 20 74 |d of. |course t|
|00005870| 79 70 65 20 4c 6f 6e 67 | 5f 49 6e 74 65 67 65 72 |ype Long|_Integer|
|00005880| 20 6d 61 79 20 6e 6f 74 | 20 65 78 69 73 74 20 6f | may not| exist o|
|00005890| 6e 20 73 6f 6d 65 20 63 | 6f 6d 70 69 6c 65 72 73 |n some c|ompilers|
|000058a0| 2e 0a 0a 20 20 20 20 45 | 78 61 6d 70 6c 65 20 31 |... E|xample 1|
|000058b0| 2e 0a 0a 20 20 20 53 75 | 70 70 6f 73 65 20 79 6f |... Su|ppose yo|
|000058c0| 75 20 64 65 63 6c 61 72 | 65 20 61 72 72 61 79 73 |u declar|e arrays|
|000058d0| 20 75 73 69 6e 67 20 74 | 68 65 20 61 62 6f 76 65 | using t|he above|
|000058e0| 20 69 6e 64 69 63 65 73 | 3a 0a 0a 20 20 20 20 20 | indices|:.. |
|000058f0| 74 79 70 65 20 54 69 6d | 65 5f 53 65 72 69 65 73 |type Tim|e_Series|
|00005900| 20 69 73 20 61 72 72 61 | 79 20 28 54 69 6d 65 5f | is arra|y (Time_|
|00005910| 53 65 72 69 65 73 5f 49 | 6e 64 65 78 29 20 6f 66 |Series_I|ndex) of|
|00005920| 20 46 6c 6f 61 74 3b 0a | 20 20 20 20 20 74 79 70 | Float;.| typ|
|00005930| 65 20 59 5f 41 78 69 73 | 5f 44 61 74 61 20 69 73 |e Y_Axis|_Data is|
|00005940| 20 61 72 72 61 79 20 28 | 44 61 74 61 5f 49 6e 64 | array (|Data_Ind|
|00005950| 65 78 29 20 20 20 20 20 | 20 20 20 6f 66 20 46 6c |ex) | of Fl|
|00005960| 6f 61 74 3b 0a 0a 20 20 | 20 20 20 4d 65 61 73 75 |oat;.. | Measu|
|00005970| 72 65 6d 65 6e 74 20 3a | 20 54 69 6d 65 5f 53 65 |rement :| Time_Se|
|00005980| 72 69 65 73 3b 0a 0a 0a | 20 20 20 4e 6f 77 20 69 |ries;...| Now i|
|00005990| 66 20 79 6f 75 20 6d 69 | 73 74 61 6b 65 6e 6c 79 |f you mi|stakenly|
|000059a0| 20 74 72 79 20 74 6f 20 | 69 74 65 72 61 74 65 20 | try to |iterate |
|000059b0| 6f 76 65 72 20 6f 6e 65 | 20 61 72 72 61 79 20 77 |over one| array w|
|000059c0| 69 74 68 20 74 68 65 20 | 69 6e 64 65 78 20 6f 66 |ith the |index of|
|000059d0| 0a 20 20 20 74 68 65 20 | 6f 74 68 65 72 2c 20 74 |. the |other, t|
|000059e0| 68 65 20 63 6f 6d 70 69 | 6c 65 72 20 63 61 6e 20 |he compi|ler can |
|000059f0| 63 61 74 63 68 20 74 68 | 65 20 65 72 72 6f 72 20 |catch th|e error |
|00005a00| 61 74 20 63 6f 6d 70 69 | 6c 65 20 74 69 6d 65 3a |at compi|le time:|
|00005a10| 0a 0a 20 20 20 20 20 66 | 6f 72 20 49 20 69 6e 20 |.. f|or I in |
|00005a20| 44 61 74 61 5f 49 6e 64 | 65 78 20 6c 6f 6f 70 0a |Data_Ind|ex loop.|
|00005a30| 20 20 20 20 20 20 20 20 | 53 75 6d 20 3a 3d 20 53 | |Sum := S|
|00005a40| 75 6d 20 2b 20 4d 65 61 | 73 75 72 65 6d 65 6e 74 |um + Mea|surement|
|00005a50| 28 49 29 3b 20 20 2d 2d | 20 63 6f 6d 70 69 6c 61 |(I); --| compila|
|00005a60| 74 69 6f 6e 20 65 72 72 | 6f 72 0a 20 20 20 20 20 |tion err|or. |
|00005a70| 65 6e 64 20 6c 6f 6f 70 | 3b 0a 0a 0a 20 20 20 20 |end loop|;... |
|00005a80| 45 78 61 6d 70 6c 65 20 | 32 2e 0a 0a 20 20 20 54 |Example |2... T|
|00005a90| 68 69 73 20 69 73 20 6c | 69 66 74 65 64 20 66 72 |his is l|ifted fr|
|00005aa0| 6f 6d 20 54 75 63 6b 65 | 72 20 54 61 66 74 27 73 |om Tucke|r Taft's|
|00005ab0| 20 62 72 69 65 66 20 69 | 6e 74 72 6f 64 75 63 74 | brief i|ntroduct|
|00005ac0| 69 6f 6e 20 74 6f 20 41 | 64 61 20 39 35 20 69 6e |ion to A|da 95 in|
|00005ad0| 20 74 68 65 0a 20 20 20 | 63 6f 6e 74 72 69 62 75 | the. |contribu|
|00005ae0| 74 65 64 20 70 61 70 65 | 72 73 20 73 65 63 74 69 |ted pape|rs secti|
|00005af0| 6f 6e 20 6f 66 20 74 68 | 65 20 41 64 61 20 57 6f |on of th|e Ada Wo|
|00005b00| 72 6c 64 20 57 69 64 65 | 20 57 65 62 20 68 6f 6d |rld Wide| Web hom|
|00005b10| 65 70 61 67 65 2e 20 48 | 65 72 65 0a 20 20 20 54 |epage. H|ere. T|
|00005b20| 75 63 6b 65 72 20 75 73 | 65 73 20 74 68 65 20 41 |ucker us|es the A|
|00005b30| 64 61 20 39 35 20 75 6e | 73 69 67 6e 65 64 20 69 |da 95 un|signed i|
|00005b40| 6e 74 65 67 65 72 73 2c | 20 63 61 6c 6c 65 64 20 |ntegers,| called |
|00005b50| 6d 6f 64 75 6c 61 72 20 | 74 79 70 65 73 2c 20 69 |modular |types, i|
|00005b60| 6e 20 74 68 65 0a 20 20 | 20 69 6d 70 6c 65 6d 65 |n the. | impleme|
|00005b70| 6e 74 61 74 69 6f 6e 20 | 6f 66 20 61 20 70 72 6f |ntation |of a pro|
|00005b80| 74 65 63 74 65 64 20 74 | 79 70 65 2c 20 77 68 69 |tected t|ype, whi|
|00005b90| 63 68 20 64 65 66 69 6e | 65 73 20 61 20 64 69 73 |ch defin|es a dis|
|00005ba0| 6b 20 63 6f 6e 74 72 6f | 6c 20 75 6e 69 74 2e 0a |k contro|l unit..|
|00005bb0| 20 20 20 4d 6f 64 75 6c | 61 72 20 74 79 70 65 73 | Modul|ar types|
|00005bc0| 20 61 72 65 20 69 6e 74 | 65 67 65 72 20 74 79 70 | are int|eger typ|
|00005bd0| 65 73 20 77 69 74 68 20 | 22 61 6e 64 22 2c 20 22 |es with |"and", "|
|00005be0| 6f 72 22 20 61 6e 64 20 | 22 78 6f 72 22 20 64 65 |or" and |"xor" de|
|00005bf0| 66 69 6e 65 64 2c 20 73 | 6f 0a 20 20 20 73 79 73 |fined, s|o. sys|
|00005c00| 74 65 6d 73 20 70 72 6f | 67 72 61 6d 6d 65 72 73 |tems pro|grammers|
|00005c10| 20 61 72 65 20 6c 69 6b | 65 6c 79 20 74 6f 20 75 | are lik|ely to u|
|00005c20| 73 65 20 74 68 65 6d 20 | 61 73 20 62 69 74 20 6d |se them |as bit m|
|00005c30| 61 73 6b 73 2e 20 4a 75 | 73 74 20 61 73 20 74 68 |asks. Ju|st as th|
|00005c40| 65 0a 20 20 20 61 72 72 | 61 79 20 69 6e 64 69 63 |e. arr|ay indic|
|00005c50| 65 73 20 6f 66 20 74 68 | 65 20 32 20 61 72 72 61 |es of th|e 2 arra|
|00005c60| 79 73 20 64 65 66 69 6e | 65 64 20 61 62 6f 76 65 |ys defin|ed above|
|00005c70| 20 61 72 65 20 6e 65 76 | 65 72 20 6d 65 61 6e 74 | are nev|er meant|
|00005c80| 20 74 6f 20 62 65 0a 20 | 20 20 6d 69 78 65 64 2c | to be. | mixed,|
|00005c90| 20 74 68 65 20 6d 6f 64 | 75 6c 61 72 20 69 6e 74 | the mod|ular int|
|00005ca0| 65 67 65 72 20 74 79 70 | 65 73 20 75 73 65 64 20 |eger typ|es used |
|00005cb0| 74 6f 20 69 6d 70 6c 65 | 6d 65 6e 74 20 74 68 65 |to imple|ment the|
|00005cc0| 20 64 69 73 6b 20 63 6f | 6e 74 72 6f 6c 0a 20 20 | disk co|ntrol. |
|00005cd0| 20 75 6e 69 74 20 61 72 | 65 20 6e 65 76 65 72 20 | unit ar|e never |
|00005ce0| 6d 65 61 6e 74 20 74 6f | 20 62 65 20 6d 69 78 65 |meant to| be mixe|
|00005cf0| 64 2e 20 54 6f 20 6d 61 | 6b 65 20 73 75 72 65 20 |d. To ma|ke sure |
|00005d00| 74 68 65 20 63 6f 6d 70 | 69 6c 65 72 20 65 6e 66 |the comp|iler enf|
|00005d10| 6f 72 63 65 73 0a 20 20 | 20 74 68 69 73 2c 20 74 |orces. | this, t|
|00005d20| 68 65 79 20 61 72 65 20 | 64 65 63 6c 61 72 65 64 |hey are |declared|
|00005d30| 20 61 73 20 64 69 73 74 | 69 6e 63 74 20 74 79 70 | as dist|inct typ|
|00005d40| 65 73 3a 0a 0a 20 20 20 | 20 20 74 79 70 65 20 46 |es:.. | type F|
|00005d50| 6c 61 67 73 20 20 20 69 | 73 20 6d 6f 64 20 32 2a |lags i|s mod 2*|
|00005d60| 2a 34 3b 20 20 2d 2d 20 | 61 20 34 2d 62 69 74 20 |*4; -- |a 4-bit |
|00005d70| 66 6c 61 67 73 20 66 69 | 65 6c 64 0a 20 20 20 20 |flags fi|eld. |
|00005d80| 20 74 79 70 65 20 43 6f | 6e 74 72 6f 6c 20 69 73 | type Co|ntrol is|
|00005d90| 20 6d 6f 64 20 32 2a 2a | 34 3b 20 20 2d 2d 20 41 | mod 2**|4; -- A|
|00005da0| 20 34 2d 62 69 74 20 63 | 6f 6e 74 72 6f 6c 20 66 | 4-bit c|ontrol f|
|00005db0| 69 65 6c 64 0a 0a 20 20 | 20 20 20 53 74 61 74 75 |ield.. | Statu|
|00005dc0| 73 5f 4d 61 73 6b 20 20 | 3a 20 63 6f 6e 73 74 61 |s_Mask |: consta|
|00005dd0| 6e 74 20 46 6c 61 67 73 | 20 3a 3d 20 32 23 31 30 |nt Flags| := 2#10|
|00005de0| 30 31 23 3b 20 20 20 2d | 2d 20 53 65 74 20 66 69 |01#; -|- Set fi|
|00005df0| 72 73 74 20 61 6e 64 20 | 6c 61 73 74 20 62 69 74 |rst and |last bit|
|00005e00| 73 2e 0a 20 20 20 20 20 | 53 74 61 74 75 73 5f 52 |s.. |Status_R|
|00005e10| 65 61 64 79 20 3a 20 63 | 6f 6e 73 74 61 6e 74 20 |eady : c|onstant |
|00005e20| 46 6c 61 67 73 20 3a 3d | 20 32 23 31 30 30 30 23 |Flags :=| 2#1000#|
|00005e30| 3b 20 20 20 2d 2d 20 53 | 74 61 74 75 73 20 3d 20 |; -- S|tatus = |
|00005e40| 52 65 61 64 79 0a 0a 20 | 20 20 20 20 53 74 61 72 |Ready.. | Star|
|00005e50| 74 5f 58 66 72 20 20 20 | 20 3a 20 63 6f 6e 73 74 |t_Xfr | : const|
|00005e60| 61 6e 74 20 43 6f 6e 74 | 72 6f 6c 20 3a 3d 20 32 |ant Cont|rol := 2|
|00005e70| 23 30 30 30 31 23 3b 20 | 2d 2d 20 49 6e 69 74 69 |#0001#; |-- Initi|
|00005e80| 61 74 65 20 78 66 72 20 | 63 6f 6d 6d 61 6e 64 0a |ate xfr |command.|
|00005e90| 0a 0a 20 20 20 4e 6f 77 | 20 69 66 20 73 6f 6d 65 |.. Now| if some|
|00005ea0| 6f 6e 65 20 61 74 74 65 | 6d 70 74 73 20 74 6f 20 |one atte|mpts to |
|00005eb0| 61 70 70 6c 79 20 61 20 | 46 6c 61 67 20 76 61 72 |apply a |Flag var|
|00005ec0| 69 61 62 6c 65 20 77 68 | 65 72 65 20 61 20 43 6f |iable wh|ere a Co|
|00005ed0| 6e 74 72 6f 6c 0a 20 20 | 20 76 61 72 69 61 62 6c |ntrol. | variabl|
|00005ee0| 65 20 73 68 6f 75 6c 64 | 20 62 65 20 75 73 65 64 |e should| be used|
|00005ef0| 20 28 6f 72 20 76 69 63 | 65 2d 76 65 72 73 61 29 | (or vic|e-versa)|
|00005f00| 20 74 68 65 20 63 6f 6d | 70 69 6c 65 72 20 77 69 | the com|piler wi|
|00005f10| 6c 6c 20 63 61 74 63 68 | 20 74 68 65 0a 20 20 20 |ll catch| the. |
|00005f20| 65 72 72 6f 72 2e 20 54 | 68 69 73 20 69 73 20 65 |error. T|his is e|
|00005f30| 73 70 65 63 69 61 6c 6c | 79 20 69 6d 70 6f 72 74 |speciall|y import|
|00005f40| 61 6e 74 20 77 68 65 6e | 20 74 68 65 20 63 6f 64 |ant when| the cod|
|00005f50| 65 20 69 73 20 6d 61 69 | 6e 74 61 69 6e 65 64 20 |e is mai|ntained |
|00005f60| 62 79 0a 20 20 20 70 72 | 6f 67 72 61 6d 6d 65 72 |by. pr|ogrammer|
|00005f70| 73 20 77 68 6f 20 64 69 | 64 20 6e 6f 74 20 77 72 |s who di|d not wr|
|00005f80| 69 74 65 20 69 74 2e 0a | 0a 20 20 20 20 52 65 6d |ite it..|. Rem|
|00005f90| 61 72 6b 73 20 6f 6e 20 | 45 78 61 6d 70 6c 65 73 |arks on |Examples|
|00005fa0| 20 31 20 61 6e 64 20 32 | 2e 0a 0a 20 20 20 31 2e | 1 and 2|... 1.|
|00005fb0| 20 4e 6f 74 69 63 65 20 | 74 68 61 74 20 69 6e 20 | Notice |that in |
|00005fc0| 62 6f 74 68 20 65 78 61 | 6d 70 6c 65 73 20 74 68 |both exa|mples th|
|00005fd0| 65 20 70 72 6f 67 72 61 | 6d 6d 65 72 20 77 61 73 |e progra|mmer was|
|00005fe0| 20 61 62 6c 65 20 74 6f | 20 73 74 61 74 65 20 68 | able to| state h|
|00005ff0| 69 73 0a 20 20 20 69 6e | 74 65 6e 74 69 6f 6e 73 |is. in|tentions|
|00006000| 20 72 61 74 68 65 72 20 | 66 6f 72 63 65 66 75 6c | rather |forceful|
|00006010| 6c 79 20 69 6e 20 74 68 | 65 20 63 6f 64 65 20 2d |ly in th|e code -|
|00006020| 20 69 6e 74 65 6e 74 69 | 6f 6e 73 20 74 68 61 74 | intenti|ons that|
|00006030| 20 6f 74 68 65 72 77 69 | 73 65 0a 20 20 20 6d 69 | otherwi|se. mi|
|00006040| 67 68 74 20 68 61 76 65 | 20 62 65 65 6e 20 65 78 |ght have| been ex|
|00006050| 70 72 65 73 73 65 64 20 | 6d 75 63 68 20 6c 65 73 |pressed |much les|
|00006060| 73 20 66 6f 72 63 65 66 | 75 6c 6c 79 20 69 6e 20 |s forcef|ully in |
|00006070| 63 6f 6d 6d 65 6e 74 20 | 73 74 61 74 65 6d 65 6e |comment |statemen|
|00006080| 74 73 2e 0a 20 20 20 42 | 65 63 61 75 73 65 20 6f |ts.. B|ecause o|
|00006090| 66 20 41 64 61 27 73 20 | 73 74 72 6f 6e 67 20 74 |f Ada's |strong t|
|000060a0| 79 70 69 6e 67 20 6d 6f | 64 65 6c 2c 20 74 68 65 |yping mo|del, the|
|000060b0| 20 63 6f 6d 70 69 6c 65 | 72 20 77 61 73 20 61 62 | compile|r was ab|
|000060c0| 6c 65 20 74 6f 20 63 61 | 74 63 68 0a 20 20 20 65 |le to ca|tch. e|
|000060d0| 72 72 6f 72 73 20 61 74 | 20 63 6f 6d 70 69 6c 65 |rrors at| compile|
|000060e0| 2d 74 69 6d 65 20 77 68 | 65 6e 20 74 68 65 20 70 |-time wh|en the p|
|000060f0| 72 6f 67 72 61 6d 6d 65 | 72 27 73 20 69 6e 74 65 |rogramme|r's inte|
|00006100| 6e 74 69 6f 6e 73 20 77 | 65 72 65 20 76 69 6f 6c |ntions w|ere viol|
|00006110| 61 74 65 64 2e 0a 0a 0a | 20 20 20 32 2e 20 4e 6f |ated....| 2. No|
|00006120| 74 69 63 65 20 61 6c 73 | 6f 20 74 68 61 74 20 74 |tice als|o that t|
|00006130| 68 65 20 49 6e 74 65 67 | 65 72 20 64 65 63 6c 61 |he Integ|er decla|
|00006140| 72 61 74 69 6f 6e 73 20 | 69 6e 20 74 68 65 20 32 |rations |in the 2|
|00006150| 20 65 78 61 6d 70 6c 65 | 73 20 61 72 65 0a 20 20 | example|s are. |
|00006160| 20 6d 61 63 68 69 6e 65 | 20 70 6f 72 74 61 62 6c | machine| portabl|
|00006170| 65 2c 20 75 6e 6c 69 6b | 65 20 49 6e 74 65 67 65 |e, unlik|e Intege|
|00006180| 72 20 61 6e 64 20 4c 6f | 6e 67 5f 49 6e 74 65 67 |r and Lo|ng_Integ|
|00006190| 65 72 2e 20 41 20 63 6f | 6d 70 69 6c 65 72 20 77 |er. A co|mpiler w|
|000061a0| 69 6c 6c 0a 20 20 20 74 | 79 70 69 63 61 6c 6c 79 |ill. t|ypically|
|000061b0| 20 6d 61 70 20 74 68 65 | 73 65 20 69 6e 74 65 67 | map the|se integ|
|000061c0| 65 72 20 74 79 70 65 73 | 20 6f 6e 74 6f 20 74 68 |er types| onto th|
|000061d0| 65 20 6d 6f 73 74 20 65 | 66 66 69 63 69 65 6e 74 |e most e|fficient|
|000061e0| 20 62 61 73 65 20 74 79 | 70 65 0a 20 20 20 74 68 | base ty|pe. th|
|000061f0| 61 74 20 69 73 20 61 76 | 61 69 6c 61 62 6c 65 20 |at is av|ailable |
|00006200| 6f 6e 20 74 68 65 20 74 | 61 72 67 65 74 20 6d 61 |on the t|arget ma|
|00006210| 63 68 69 6e 65 2e 0a 0a | 20 20 20 20 45 78 61 6d |chine...| Exam|
|00006220| 70 6c 65 20 33 2e 0a 0a | 20 20 20 41 6c 74 68 6f |ple 3...| Altho|
|00006230| 75 67 68 20 74 68 65 20 | 65 78 61 6d 70 6c 65 73 |ugh the |examples|
|00006240| 20 67 69 76 65 6e 20 61 | 62 6f 76 65 20 61 72 65 | given a|bove are|
|00006250| 20 67 6f 6f 64 20 6f 6e | 65 73 2c 20 69 74 20 69 | good on|es, it i|
|00006260| 73 20 6e 6f 74 20 6e 65 | 63 65 73 73 61 72 69 6c |s not ne|cessaril|
|00006270| 79 0a 20 20 20 61 20 63 | 6f 6d 6d 6f 6e 20 70 72 |y. a c|ommon pr|
|00006280| 61 63 74 69 63 65 20 74 | 6f 20 64 65 66 69 6e 65 |actice t|o define|
|00006290| 20 61 20 6c 61 72 67 65 | 20 6e 75 6d 62 65 72 20 | a large| number |
|000062a0| 6f 66 20 64 69 73 74 69 | 6e 63 74 20 69 6e 74 65 |of disti|nct inte|
|000062b0| 67 65 72 20 74 79 70 65 | 73 2e 0a 20 20 20 49 6e |ger type|s.. In|
|000062c0| 20 6d 61 6e 79 20 63 61 | 73 65 73 20 69 74 20 69 | many ca|ses it i|
|000062d0| 73 20 61 70 70 72 6f 70 | 72 69 61 74 65 20 74 6f |s approp|riate to|
|000062e0| 20 75 73 65 20 28 73 61 | 79 29 20 61 20 33 32 2d | use (sa|y) a 32-|
|000062f0| 62 69 74 20 69 6e 74 65 | 67 65 72 20 28 6f 72 20 |bit inte|ger (or |
|00006300| 61 0a 20 20 20 73 6d 61 | 6c 6c 20 6e 75 6d 62 65 |a. sma|ll numbe|
|00006310| 72 20 6f 66 20 73 75 63 | 68 20 74 79 70 65 73 29 |r of suc|h types)|
|00006320| 20 61 6e 64 20 64 65 63 | 6c 61 72 65 20 61 70 70 | and dec|lare app|
|00006330| 72 6f 70 72 69 61 74 65 | 20 73 75 62 74 79 70 65 |ropriate| subtype|
|00006340| 73 20 6f 66 20 69 74 0a | 20 20 20 28 74 68 65 6d |s of it.| (them|
|00006350| 29 2e 20 54 6f 20 64 65 | 63 6c 61 72 65 20 61 20 |). To de|clare a |
|00006360| 70 6f 72 74 61 62 6c 65 | 20 33 32 2d 62 69 74 20 |portable| 32-bit |
|00006370| 69 6e 74 65 67 65 72 20 | 28 6f 72 20 6d 6f 72 65 |integer |(or more|
|00006380| 20 61 63 63 75 72 61 74 | 65 6c 79 2c 20 74 68 65 | accurat|ely, the|
|00006390| 0a 20 20 20 6d 6f 73 74 | 20 65 66 66 69 63 69 65 |. most| efficie|
|000063a0| 6e 74 20 69 6e 74 65 67 | 65 72 20 74 68 61 74 20 |nt integ|er that |
|000063b0| 69 73 20 61 74 20 6c 65 | 61 73 74 20 33 32 2d 62 |is at le|ast 32-b|
|000063c0| 69 74 73 29 3a 0a 0a 20 | 20 20 74 79 70 65 20 49 |its):.. | type I|
|000063d0| 6e 74 5f 74 6d 70 20 69 | 73 20 72 61 6e 67 65 20 |nt_tmp i|s range |
|000063e0| 2d 32 2a 2a 33 31 2b 31 | 20 2e 2e 20 32 2a 2a 33 |-2**31+1| .. 2**3|
|000063f0| 31 2d 31 3b 0a 20 20 20 | 74 79 70 65 20 49 6e 74 |1-1;. |type Int|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.