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 6e 65 77 | 73 66 65 65 64 2e 69 6e |.edu!new|sfeed.in|
|00000040| 74 65 72 6e 65 74 6d 63 | 69 2e 63 6f 6d 21 68 6f |ternetmc|i.com!ho|
|00000050| 77 6c 61 6e 64 2e 72 65 | 73 74 6f 6e 2e 61 6e 73 |wland.re|ston.ans|
|00000060| 2e 6e 65 74 21 73 75 72 | 66 6e 65 74 2e 6e 6c 21 |.net!sur|fnet.nl!|
|00000070| 73 77 73 62 65 36 2e 73 | 77 69 74 63 68 2e 63 68 |swsbe6.s|witch.ch|
|00000080| 21 73 77 69 64 69 72 2e | 73 77 69 74 63 68 2e 63 |!swidir.|switch.c|
|00000090| 68 21 65 70 66 6c 6e 65 | 77 73 21 64 69 6e 65 77 |h!epflne|ws!dinew|
|000000a0| 73 2e 65 70 66 6c 2e 63 | 68 21 4d 61 67 6e 75 73 |s.epfl.c|h!Magnus|
|000000b0| 2e 4b 65 6d 70 65 0a 46 | 72 6f 6d 3a 20 4d 61 67 |.Kempe.F|rom: Mag|
|000000c0| 6e 75 73 2e 4b 65 6d 70 | 65 40 64 69 2e 65 70 66 |nus.Kemp|e@di.epf|
|000000d0| 6c 2e 63 68 20 28 4d 61 | 67 6e 75 73 20 4b 65 6d |l.ch (Ma|gnus Kem|
|000000e0| 70 65 29 0a 4e 65 77 73 | 67 72 6f 75 70 73 3a 20 |pe).News|groups: |
|000000f0| 63 6f 6d 70 2e 6c 61 6e | 67 2e 61 64 61 2c 63 6f |comp.lan|g.ada,co|
|00000100| 6d 70 2e 61 6e 73 77 65 | 72 73 2c 6e 65 77 73 2e |mp.answe|rs,news.|
|00000110| 61 6e 73 77 65 72 73 0a | 53 75 62 6a 65 63 74 3a |answers.|Subject:|
|00000120| 20 41 64 61 20 46 41 51 | 3a 20 50 72 6f 67 72 61 | Ada FAQ|: Progra|
|00000130| 6d 6d 69 6e 67 20 77 69 | 74 68 20 41 64 61 20 28 |mming wi|th Ada (|
|00000140| 70 61 72 74 20 34 20 6f | 66 20 34 29 0a 46 6f 6c |part 4 o|f 4).Fol|
|00000150| 6c 6f 77 75 70 2d 54 6f | 3a 20 70 6f 73 74 65 72 |lowup-To|: poster|
|00000160| 0a 44 61 74 65 3a 20 33 | 30 20 4d 61 79 20 31 39 |.Date: 3|0 May 19|
|00000170| 39 36 20 31 37 3a 30 39 | 3a 34 38 20 47 4d 54 0a |96 17:09|:48 GMT.|
|00000180| 4f 72 67 61 6e 69 7a 61 | 74 69 6f 6e 3a 20 4e 6f |Organiza|tion: No|
|00000190| 6e 65 0a 4c 69 6e 65 73 | 3a 20 38 37 31 0a 53 65 |ne.Lines|: 871.Se|
|000001a0| 6e 64 65 72 3a 20 6d 61 | 67 6e 75 73 40 6c 67 6c |nder: ma|gnus@lgl|
|000001b0| 73 75 6e 34 2e 65 70 66 | 6c 2e 63 68 20 28 4d 61 |sun4.epf|l.ch (Ma|
|000001c0| 67 6e 75 73 20 4b 65 6d | 70 65 29 0a 41 70 70 72 |gnus Kem|pe).Appr|
|000001d0| 6f 76 65 64 3a 20 6e 65 | 77 73 2d 61 6e 73 77 65 |oved: ne|ws-answe|
|000001e0| 72 73 2d 72 65 71 75 65 | 73 74 40 4d 49 54 2e 45 |rs-reque|st@MIT.E|
|000001f0| 44 55 0a 44 69 73 74 72 | 69 62 75 74 69 6f 6e 3a |DU.Distr|ibution:|
|00000200| 20 77 6f 72 6c 64 0a 4d | 65 73 73 61 67 65 2d 49 | world.M|essage-I|
|00000210| 44 3a 20 3c 34 6f 6b 6b | 6f 73 24 69 64 74 40 64 |D: <4okk|os$idt@d|
|00000220| 69 73 75 6e 6d 73 2e 65 | 70 66 6c 2e 63 68 3e 0a |isunms.e|pfl.ch>.|
|00000230| 52 65 70 6c 79 2d 54 6f | 3a 20 4d 61 67 6e 75 73 |Reply-To|: Magnus|
|00000240| 2e 4b 65 6d 70 65 40 64 | 69 2e 65 70 66 6c 2e 63 |.Kempe@d|i.epfl.c|
|00000250| 68 20 28 4d 61 67 6e 75 | 73 20 4b 65 6d 70 65 29 |h (Magnu|s Kempe)|
|00000260| 0a 4e 4e 54 50 2d 50 6f | 73 74 69 6e 67 2d 48 6f |.NNTP-Po|sting-Ho|
|00000270| 73 74 3a 20 6c 67 6c 73 | 75 6e 34 2e 65 70 66 6c |st: lgls|un4.epfl|
|00000280| 2e 63 68 0a 4d 69 6d 65 | 2d 56 65 72 73 69 6f 6e |.ch.Mime|-Version|
|00000290| 3a 20 31 2e 30 0a 43 6f | 6e 74 65 6e 74 2d 54 79 |: 1.0.Co|ntent-Ty|
|000002a0| 70 65 3a 20 74 65 78 74 | 2f 70 6c 61 69 6e 3b 20 |pe: text|/plain; |
|000002b0| 63 68 61 72 73 65 74 3d | 69 73 6f 2d 38 38 35 39 |charset=|iso-8859|
|000002c0| 2d 31 0a 43 6f 6e 74 65 | 6e 74 2d 54 72 61 6e 73 |-1.Conte|nt-Trans|
|000002d0| 66 65 72 2d 45 6e 63 6f | 64 69 6e 67 3a 20 38 62 |fer-Enco|ding: 8b|
|000002e0| 69 74 0a 53 75 6d 6d 61 | 72 79 3a 20 41 64 61 20 |it.Summa|ry: Ada |
|000002f0| 50 72 6f 67 72 61 6d 6d | 65 72 27 73 20 46 72 65 |Programm|er's Fre|
|00000300| 71 75 65 6e 74 6c 79 20 | 41 73 6b 65 64 20 51 75 |quently |Asked Qu|
|00000310| 65 73 74 69 6f 6e 73 20 | 28 61 6e 64 20 61 6e 73 |estions |(and ans|
|00000320| 77 65 72 73 29 2c 0a 20 | 20 20 20 20 20 20 20 20 |wers),. | |
|00000330| 20 20 70 61 72 74 20 34 | 20 6f 66 20 34 2e 0a 20 | part 4| of 4.. |
|00000340| 20 20 20 20 20 20 20 20 | 50 6c 65 61 73 65 20 72 | |Please r|
|00000350| 65 61 64 20 62 65 66 6f | 72 65 20 70 6f 73 74 69 |ead befo|re posti|
|00000360| 6e 67 2e 0a 4b 65 79 77 | 6f 72 64 73 3a 20 61 64 |ng..Keyw|ords: ad|
|00000370| 76 61 6e 63 65 64 20 6c | 61 6e 67 75 61 67 65 2c |vanced l|anguage,|
|00000380| 20 61 72 74 69 66 69 63 | 69 61 6c 20 6c 61 6e 67 | artific|ial lang|
|00000390| 75 61 67 65 73 2c 20 63 | 6f 6d 70 75 74 65 72 20 |uages, c|omputer |
|000003a0| 73 6f 66 74 77 61 72 65 | 2c 0a 20 20 20 20 20 20 |software|,. |
|000003b0| 20 20 20 20 64 61 74 61 | 20 70 72 6f 63 65 73 73 | data| process|
|000003c0| 69 6e 67 2c 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 |ing, pro|gramming|
|000003d0| 20 6c 61 6e 67 75 61 67 | 65 73 2c 20 41 64 61 0a | languag|es, Ada.|
|000003e0| 58 72 65 66 3a 20 73 65 | 6e 61 74 6f 72 2d 62 65 |Xref: se|nator-be|
|000003f0| 64 66 65 6c 6c 6f 77 2e | 6d 69 74 2e 65 64 75 20 |dfellow.|mit.edu |
|00000400| 63 6f 6d 70 2e 6c 61 6e | 67 2e 61 64 61 3a 34 35 |comp.lan|g.ada:45|
|00000410| 36 37 36 20 63 6f 6d 70 | 2e 61 6e 73 77 65 72 73 |676 comp|.answers|
|00000420| 3a 31 38 39 39 39 20 6e | 65 77 73 2e 61 6e 73 77 |:18999 n|ews.answ|
|00000430| 65 72 73 3a 37 33 30 38 | 35 0a 0a 41 72 63 68 69 |ers:7308|5..Archi|
|00000440| 76 65 2d 6e 61 6d 65 3a | 20 63 6f 6d 70 75 74 65 |ve-name:| compute|
|00000450| 72 2d 6c 61 6e 67 2f 41 | 64 61 2f 70 72 6f 67 72 |r-lang/A|da/progr|
|00000460| 61 6d 6d 69 6e 67 2f 70 | 61 72 74 34 0a 43 6f 6d |amming/p|art4.Com|
|00000470| 70 2d 6c 61 6e 67 2d 61 | 64 61 2d 61 72 63 68 69 |p-lang-a|da-archi|
|00000480| 76 65 2d 6e 61 6d 65 3a | 20 70 72 6f 67 72 61 6d |ve-name:| program|
|00000490| 6d 69 6e 67 2f 70 61 72 | 74 34 0a 50 6f 73 74 69 |ming/par|t4.Posti|
|000004a0| 6e 67 2d 46 72 65 71 75 | 65 6e 63 79 3a 20 6d 6f |ng-Frequ|ency: mo|
|000004b0| 6e 74 68 6c 79 0a 4c 61 | 73 74 2d 6d 6f 64 69 66 |nthly.La|st-modif|
|000004c0| 69 65 64 3a 20 32 32 20 | 4d 61 79 20 31 39 39 36 |ied: 22 |May 1996|
|000004d0| 0a 4c 61 73 74 2d 70 6f | 73 74 65 64 3a 20 32 33 |.Last-po|sted: 23|
|000004e0| 20 41 70 72 69 6c 20 31 | 39 39 36 0a 0a 20 20 20 | April 1|996.. |
|000004f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000500| 20 20 20 20 20 20 20 20 | 20 20 20 20 41 64 61 20 | | Ada |
|00000510| 50 72 6f 67 72 61 6d 6d | 65 72 27 73 0a 20 20 20 |Programm|er's. |
|00000520| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000530| 20 20 20 20 46 72 65 71 | 75 65 6e 74 6c 79 20 41 | Freq|uently A|
|00000540| 73 6b 65 64 20 51 75 65 | 73 74 69 6f 6e 73 20 28 |sked Que|stions (|
|00000550| 46 41 51 29 0a 0a 20 20 | 20 49 4d 50 4f 52 54 41 |FAQ).. | IMPORTA|
|00000560| 4e 54 20 4e 4f 54 45 3a | 20 4e 6f 20 46 41 51 20 |NT NOTE:| No FAQ |
|00000570| 63 61 6e 20 73 75 62 73 | 74 69 74 75 74 65 20 66 |can subs|titute f|
|00000580| 6f 72 20 72 65 61 6c 20 | 74 65 61 63 68 69 6e 67 |or real |teaching|
|00000590| 20 61 6e 64 0a 20 20 20 | 64 6f 63 75 6d 65 6e 74 | and. |document|
|000005a0| 61 74 69 6f 6e 2e 20 54 | 68 65 72 65 20 69 73 20 |ation. T|here is |
|000005b0| 61 6e 20 61 6e 6e 6f 74 | 61 74 65 64 20 6c 69 73 |an annot|ated lis|
|000005c0| 74 20 6f 66 20 41 64 61 | 20 62 6f 6f 6b 73 20 69 |t of Ada| books i|
|000005d0| 6e 20 74 68 65 0a 20 20 | 20 63 6f 6d 70 61 6e 69 |n the. | compani|
|000005e0| 6f 6e 20 63 6f 6d 70 2e | 6c 61 6e 67 2e 61 64 61 |on comp.|lang.ada|
|000005f0| 20 46 41 51 2e 0a 0a 20 | 20 20 20 52 65 63 65 6e | FAQ... | Recen|
|00000600| 74 20 63 68 61 6e 67 65 | 73 20 74 6f 20 74 68 69 |t change|s to thi|
|00000610| 73 20 46 41 51 20 61 72 | 65 20 6c 69 73 74 65 64 |s FAQ ar|e listed|
|00000620| 20 69 6e 20 74 68 65 20 | 66 69 72 73 74 20 73 65 | in the |first se|
|00000630| 63 74 69 6f 6e 20 61 66 | 74 65 72 20 74 68 65 20 |ction af|ter the |
|00000640| 74 61 62 6c 65 0a 20 20 | 20 20 6f 66 20 63 6f 6e |table. | of con|
|00000650| 74 65 6e 74 73 2e 20 54 | 68 69 73 20 64 6f 63 75 |tents. T|his docu|
|00000660| 6d 65 6e 74 20 69 73 20 | 75 6e 64 65 72 20 65 78 |ment is |under ex|
|00000670| 70 6c 69 63 69 74 20 63 | 6f 70 79 72 69 67 68 74 |plicit c|opyright|
|00000680| 2e 0a 0a 54 68 69 73 20 | 69 73 20 70 61 72 74 20 |...This |is part |
|00000690| 34 20 6f 66 20 61 20 34 | 2d 70 61 72 74 20 70 6f |4 of a 4|-part po|
|000006a0| 73 74 69 6e 67 3b 20 70 | 61 72 74 20 31 20 63 6f |sting; p|art 1 co|
|000006b0| 6e 74 61 69 6e 73 20 74 | 68 65 20 74 61 62 6c 65 |ntains t|he table|
|000006c0| 20 6f 66 20 63 6f 6e 74 | 65 6e 74 73 2e 0a 50 61 | of cont|ents..Pa|
|000006d0| 72 74 20 32 20 62 65 67 | 69 6e 73 20 77 69 74 68 |rt 2 beg|ins with|
|000006e0| 20 71 75 65 73 74 69 6f | 6e 20 35 2e 0a 50 61 72 | questio|n 5..Par|
|000006f0| 74 20 33 20 62 65 67 69 | 6e 73 20 77 69 74 68 20 |t 3 begi|ns with |
|00000700| 71 75 65 73 74 69 6f 6e | 20 36 2e 0a 50 61 72 74 |question| 6..Part|
|00000710| 73 20 31 2c 20 32 2c 20 | 61 6e 64 20 33 20 73 68 |s 1, 2, |and 3 sh|
|00000720| 6f 75 6c 64 20 62 65 20 | 74 68 65 20 70 72 65 76 |ould be |the prev|
|00000730| 69 6f 75 73 20 70 6f 73 | 74 69 6e 67 73 20 69 6e |ious pos|tings in|
|00000740| 20 74 68 69 73 20 74 68 | 72 65 61 64 2e 0a 0a 0a | this th|read....|
|00000750| 39 3a 20 41 64 61 20 61 | 6e 64 20 4f 74 68 65 72 |9: Ada a|nd Other|
|00000760| 20 50 72 6f 67 72 61 6d | 6d 69 6e 67 20 4c 61 6e | Program|ming Lan|
|00000770| 67 75 61 67 65 73 0a 0a | 0a 39 2e 31 3a 20 57 68 |guages..|.9.1: Wh|
|00000780| 65 72 65 20 63 61 6e 20 | 49 20 66 69 6e 64 20 70 |ere can |I find p|
|00000790| 72 6f 67 72 61 6d 73 20 | 74 68 61 74 20 77 69 6c |rograms |that wil|
|000007a0| 6c 20 74 72 61 6e 73 6c | 61 74 65 20 66 72 6f 6d |l transl|ate from|
|000007b0| 20 5b 73 6f 6d 65 20 6c | 61 6e 67 75 61 67 65 5d | [some l|anguage]|
|000007c0| 20 74 6f 0a 41 64 61 3f | 0a 0a 20 20 20 49 74 20 | to.Ada?|.. It |
|000007d0| 69 73 20 67 65 6e 65 72 | 61 6c 6c 79 20 61 64 76 |is gener|ally adv|
|000007e0| 69 73 61 62 6c 65 20 74 | 6f 20 73 69 6d 70 6c 79 |isable t|o simply|
|000007f0| 20 69 6e 74 65 72 66 61 | 63 65 20 66 72 6f 6d 20 | interfa|ce from |
|00000800| 41 64 61 20 74 6f 20 74 | 68 65 0a 20 20 20 65 78 |Ada to t|he. ex|
|00000810| 69 73 74 69 6e 67 20 63 | 6f 64 65 20 73 65 67 6d |isting c|ode segm|
|00000820| 65 6e 74 73 20 74 68 61 | 74 20 28 73 68 6f 75 6c |ents tha|t (shoul|
|00000830| 64 29 20 61 6c 72 65 61 | 64 79 20 77 6f 72 6b 2e |d) alrea|dy work.|
|00000840| 20 4e 6f 74 65 20 74 68 | 61 74 20 41 64 61 20 28 | Note th|at Ada (|
|00000850| 39 35 29 0a 20 20 20 6e | 6f 77 20 68 61 73 20 61 |95). n|ow has a|
|00000860| 6e 20 61 6e 6e 65 78 20 | 64 65 76 6f 74 65 64 20 |n annex |devoted |
|00000870| 74 6f 20 73 70 65 63 69 | 66 79 69 6e 67 20 68 6f |to speci|fying ho|
|00000880| 77 20 74 6f 20 69 6e 74 | 65 72 66 61 63 65 20 77 |w to int|erface w|
|00000890| 69 74 68 20 63 6f 64 65 | 0a 20 20 20 77 72 69 74 |ith code|. writ|
|000008a0| 74 65 6e 20 69 6e 20 6f | 74 68 65 72 20 70 72 6f |ten in o|ther pro|
|000008b0| 67 72 61 6d 6d 69 6e 67 | 20 6c 61 6e 67 75 61 67 |gramming| languag|
|000008c0| 65 73 20 28 43 2c 20 46 | 6f 74 72 61 6e 2c 20 61 |es (C, F|otran, a|
|000008d0| 6e 64 20 43 6f 62 6f 6c | 29 2c 20 61 6e 64 0a 20 |nd Cobol|), and. |
|000008e0| 20 20 74 68 65 72 65 20 | 61 72 65 20 61 6c 72 65 | there |are alre|
|000008f0| 61 64 79 20 69 6e 74 65 | 72 66 61 63 65 73 20 74 |ady inte|rfaces t|
|00000900| 6f 20 43 2b 2b 20 74 6f | 6f 2e 0a 0a 20 20 20 41 |o C++ to|o... A|
|00000910| 6e 6f 74 68 65 72 20 6f | 70 74 69 6f 6e 20 69 73 |nother o|ption is|
|00000920| 20 74 6f 20 72 65 64 65 | 73 69 67 6e 20 74 68 65 | to rede|sign the|
|00000930| 20 63 6f 64 65 2c 20 74 | 61 6b 69 6e 67 20 6f 66 | code, t|aking of|
|00000940| 20 63 6f 75 72 73 65 20 | 61 64 76 61 6e 74 61 67 | course |advantag|
|00000950| 65 20 6f 66 0a 20 20 20 | 6f 6e 65 27 73 20 6b 6e |e of. |one's kn|
|00000960| 6f 77 6c 65 64 67 65 20 | 6f 66 20 74 68 65 20 63 |owledge |of the c|
|00000970| 75 72 72 65 6e 74 20 73 | 79 73 74 65 6d 2e 20 46 |urrent s|ystem. F|
|00000980| 6f 72 20 69 6e 73 74 61 | 6e 63 65 2c 20 4a 6f 62 |or insta|nce, Job|
|00000990| a0 48 6f 6e 69 67 0a 20 | 20 20 72 65 70 6f 72 74 |.Honig. | report|
|000009a0| 65 64 20 74 68 61 74 20 | 68 65 20 64 69 64 20 74 |ed that |he did t|
|000009b0| 68 69 73 20 74 77 69 63 | 65 2c 20 6f 6e 63 65 20 |his twic|e, once |
|000009c0| 66 6f 72 20 43 6f 63 6f | 2c 20 61 20 70 61 72 73 |for Coco|, a pars|
|000009d0| 65 72 20 67 65 6e 65 72 | 61 74 6f 72 20 66 6f 72 |er gener|ator for|
|000009e0| 0a 20 20 20 4c 41 4c 52 | 20 6c 65 66 74 20 61 74 |. LALR| left at|
|000009f0| 74 72 69 62 75 74 65 64 | 20 67 72 61 6d 6d 61 72 |tributed| grammar|
|00000a00| 73 2c 20 61 6e 64 20 6f | 6e 63 65 20 66 6f 72 20 |s, and o|nce for |
|00000a10| 46 6c 65 78 2c 20 74 68 | 65 20 77 65 6c 6c 20 6b |Flex, th|e well k|
|00000a20| 6e 6f 77 6e 0a 20 20 20 | 73 63 61 6e 6e 65 72 20 |nown. |scanner |
|00000a30| 67 65 6e 65 72 61 74 6f | 72 2e 20 42 6f 74 68 20 |generato|r. Both |
|00000a40| 61 74 74 65 6d 70 74 73 | 20 72 65 76 65 61 6c 65 |attempts| reveale|
|00000a50| 64 20 65 72 72 6f 72 73 | 20 69 6e 20 74 68 65 20 |d errors| in the |
|00000a60| 6f 72 69 67 69 6e 61 6c | 0a 20 20 20 73 6f 66 74 |original|. soft|
|00000a70| 77 61 72 65 3b 20 74 68 | 65 79 20 77 65 72 65 20 |ware; th|ey were |
|00000a80| 75 6e 63 6f 76 65 72 65 | 64 20 62 79 20 64 65 73 |uncovere|d by des|
|00000a90| 69 67 6e 69 6e 67 20 74 | 68 65 20 6e 65 77 20 73 |igning t|he new s|
|00000aa0| 79 73 74 65 6d 20 75 73 | 69 6e 67 20 74 68 65 0a |ystem us|ing the.|
|00000ab0| 20 20 20 68 69 67 68 65 | 72 20 61 62 73 74 72 61 | highe|r abstra|
|00000ac0| 63 74 69 6f 6e 20 6c 65 | 76 65 6c 20 61 6c 6c 6f |ction le|vel allo|
|00000ad0| 77 65 64 20 62 79 20 41 | 64 61 2e 2e 2e 0a 0a 20 |wed by A|da..... |
|00000ae0| 20 20 53 6f 20 74 68 65 | 72 65 20 69 73 20 73 75 | So the|re is su|
|00000af0| 70 70 6f 72 74 20 66 6f | 72 20 74 68 65 20 72 65 |pport fo|r the re|
|00000b00| 71 75 69 72 65 6d 65 6e | 74 73 20 61 6e 61 6c 79 |quiremen|ts analy|
|00000b10| 73 69 73 20 28 74 72 61 | 6e 73 69 74 69 6f 6e 20 |sis (tra|nsition |
|00000b20| 74 6f 20 41 64 61 29 2c | 0a 20 20 20 62 75 74 20 |to Ada),|. but |
|00000b30| 69 74 20 69 73 20 6e 6f | 74 20 6f 62 76 69 6f 75 |it is no|t obviou|
|00000b40| 73 20 74 68 61 74 20 74 | 68 65 20 70 72 6f 70 6f |s that t|he propo|
|00000b50| 73 65 64 20 69 6d 70 6c | 65 6d 65 6e 74 61 74 69 |sed impl|ementati|
|00000b60| 6f 6e 20 28 75 73 69 6e | 67 20 61 20 73 6f 75 72 |on (usin|g a sour|
|00000b70| 63 65 0a 20 20 20 63 6f | 64 65 20 74 72 61 6e 73 |ce. co|de trans|
|00000b80| 6c 61 74 6f 72 29 20 69 | 73 20 61 20 67 6f 6f 64 |lator) i|s a good|
|00000b90| 20 73 6f 6c 75 74 69 6f | 6e 2e 0a 0a 20 20 20 53 | solutio|n... S|
|00000ba0| 74 69 6c 6c 2c 20 79 6f | 75 20 6d 61 79 20 68 61 |till, yo|u may ha|
|00000bb0| 76 65 20 63 6f 6d 70 65 | 6c 6c 69 6e 67 20 72 65 |ve compe|lling re|
|00000bc0| 61 73 6f 6e 73 20 74 6f | 20 74 72 61 6e 73 6c 61 |asons to| transla|
|00000bd0| 74 65 20 79 6f 75 72 20 | 65 78 69 73 74 69 6e 67 |te your |existing|
|00000be0| 0a 20 20 20 73 6f 75 72 | 63 65 20 74 6f 20 41 64 |. sour|ce to Ad|
|00000bf0| 61 2e 20 49 6e 20 74 68 | 61 74 20 63 61 73 65 2c |a. In th|at case,|
|00000c00| 20 68 65 72 65 20 69 73 | 20 61 20 6c 69 73 74 20 | here is| a list |
|00000c10| 6f 66 20 61 76 61 69 6c | 61 62 6c 65 20 74 72 61 |of avail|able tra|
|00000c20| 6e 73 6c 61 74 6f 72 73 | 3a 0a 0a 20 20 20 20 20 |nslators|:.. |
|00000c30| 2a 20 50 61 73 63 61 6c | 20 74 6f 20 41 64 61 3a |* Pascal| to Ada:|
|00000c40| 0a 0a 20 20 20 20 20 20 | 20 52 2e 52 2e 20 53 6f |.. | R.R. So|
|00000c50| 66 74 77 61 72 65 27 73 | 20 50 61 73 74 72 61 6e |ftware's| Pastran|
|00000c60| 20 70 72 6f 67 72 61 6d | 20 28 50 61 73 63 61 6c | program| (Pascal|
|00000c70| 20 74 6f 20 41 64 61 20 | 54 72 61 6e 73 6c 61 74 | to Ada |Translat|
|00000c80| 6f 72 29 2e 0a 0a 20 20 | 20 20 20 20 20 54 6f 20 |or)... | To |
|00000c90| 73 65 65 20 74 68 65 20 | 64 69 66 66 65 72 65 6e |see the |differen|
|00000ca0| 63 65 73 20 69 6e 20 70 | 72 6f 67 72 61 6d 6d 69 |ces in p|rogrammi|
|00000cb0| 6e 67 20 73 74 79 6c 65 | 2c 20 73 65 65 20 22 41 |ng style|, see "A|
|00000cc0| 64 61 20 66 6f 72 0a 20 | 20 20 20 20 20 20 45 78 |da for. | Ex|
|00000cd0| 70 65 72 69 65 6e 63 65 | 64 20 50 72 6f 67 72 61 |perience|d Progra|
|00000ce0| 6d 6d 65 72 73 22 2c 20 | 62 79 20 41 2e 20 4e 69 |mmers", |by A. Ni|
|00000cf0| 63 6f 20 48 61 62 65 72 | 6d 61 6e 6e 20 61 6e 64 |co Haber|mann and|
|00000d00| 20 44 65 77 61 79 6e 65 | 20 45 2e 0a 20 20 20 20 | Dewayne| E.. |
|00000d10| 20 20 20 50 65 72 72 79 | 20 28 41 64 64 69 73 6f | Perry| (Addiso|
|00000d20| 6e 2d 57 65 73 6c 65 79 | 20 50 75 62 2e 20 43 6f |n-Wesley| Pub. Co|
|00000d30| 2e 2c 20 52 65 61 64 69 | 6e 67 2c 20 4d 61 73 73 |., Readi|ng, Mass|
|00000d40| 2e 2c 20 31 39 38 33 29 | 2e 20 43 6f 76 65 72 73 |., 1983)|. Covers|
|00000d50| 20 41 64 61 0a 20 20 20 | 20 20 20 20 61 6e 64 20 | Ada. | and |
|00000d60| 50 61 73 63 61 6c 2e 0a | 0a 20 20 20 20 20 2a 20 |Pascal..|. * |
|00000d70| 46 6f 72 74 72 61 6e 20 | 74 6f 20 41 64 61 3a 20 |Fortran |to Ada: |
|00000d80| 3f 3f 3f 0a 0a 20 20 20 | 20 20 2a 20 43 4f 42 4f |???.. | * COBO|
|00000d90| 4c 20 74 6f 20 41 64 61 | 3a 20 3f 3f 3f 0a 0a 20 |L to Ada|: ???.. |
|00000da0| 20 20 20 20 2a 20 43 2b | 2b 20 74 6f 20 41 64 61 | * C+|+ to Ada|
|00000db0| 3a 20 3f 3f 3f 0a 0a 20 | 20 20 20 20 2a 20 43 20 |: ???.. | * C |
|00000dc0| 74 6f 20 41 64 61 3a 20 | 3f 3f 3f 0a 0a 20 20 20 |to Ada: |???.. |
|00000dd0| 20 20 2a 20 4d 6f 64 75 | 6c 61 2d 32 20 74 6f 20 | * Modu|la-2 to |
|00000de0| 41 64 61 3a 0a 0a 20 20 | 20 20 20 20 20 28 66 72 |Ada:.. | (fr|
|00000df0| 6f 6d 20 57 61 79 6e 65 | 20 52 2e 20 4c 61 77 74 |om Wayne| R. Lawt|
|00000e00| 6f 6e 29 0a 20 20 20 20 | 20 20 20 54 68 65 20 49 |on). | The I|
|00000e10| 64 61 68 6f 20 4e 61 74 | 69 6f 6e 61 6c 20 45 6e |daho Nat|ional En|
|00000e20| 67 69 6e 65 65 72 69 6e | 67 20 4c 61 62 6f 72 61 |gineerin|g Labora|
|00000e30| 74 6f 72 79 20 28 49 4e | 45 4c 29 2c 20 61 20 44 |tory (IN|EL), a D|
|00000e40| 65 70 74 20 6f 66 20 45 | 6e 65 72 67 79 0a 20 20 |ept of E|nergy. |
|00000e50| 20 20 20 20 20 4c 61 62 | 20 68 61 73 20 61 20 62 | Lab| has a b|
|00000e60| 61 73 69 63 20 63 61 70 | 61 62 69 6c 69 74 79 20 |asic cap|ability |
|00000e70| 66 6f 72 20 4d 6f 64 75 | 6c 61 2d 32 20 74 6f 20 |for Modu|la-2 to |
|00000e80| 41 64 61 2d 38 33 2e 20 | 54 68 65 20 74 6f 6f 6c |Ada-83. |The tool|
|00000e90| 20 69 73 0a 20 20 20 20 | 20 20 20 22 72 65 73 65 | is. | "rese|
|00000ea0| 61 72 63 68 20 67 72 61 | 64 65 22 20 71 75 61 6c |arch gra|de" qual|
|00000eb0| 69 74 79 2c 20 62 75 74 | 20 6d 61 79 20 70 72 6f |ity, but| may pro|
|00000ec0| 76 69 64 65 20 61 20 73 | 74 61 72 74 69 6e 67 20 |vide a s|tarting |
|00000ed0| 70 6f 69 6e 74 20 66 6f | 72 0a 20 20 20 20 20 20 |point fo|r. |
|00000ee0| 20 77 68 61 74 20 79 6f | 75 20 6e 65 65 64 2e 20 | what yo|u need. |
|00000ef0| 54 68 69 73 20 69 73 20 | 74 68 65 20 73 61 6d 65 |This is |the same|
|00000f00| 20 67 72 6f 75 70 20 6f | 66 20 70 65 6f 70 6c 65 | group o|f people|
|00000f10| 20 77 68 6f 20 62 72 6f | 75 67 68 74 20 79 6f 75 | who bro|ught you|
|00000f20| 0a 20 20 20 20 20 20 20 | 41 64 61 53 41 47 45 2e |. |AdaSAGE.|
|00000f30| 20 47 69 76 65 20 74 68 | 65 6d 20 61 20 72 69 6e | Give th|em a rin|
|00000f40| 67 20 61 74 20 28 32 30 | 38 29 20 35 32 36 2d 30 |g at (20|8) 526-0|
|00000f50| 36 35 36 2e 20 54 68 69 | 73 20 69 73 20 61 6e 20 |656. Thi|s is an |
|00000f60| 61 6e 73 77 65 72 0a 20 | 20 20 20 20 20 20 64 65 |answer. | de|
|00000f70| 73 6b 20 68 6f 74 6c 69 | 6e 65 20 69 6e 20 74 68 |sk hotli|ne in th|
|00000f80| 65 20 73 65 63 74 69 6f | 6e 20 74 68 61 74 20 77 |e sectio|n that w|
|00000f90| 72 6f 74 65 20 74 68 65 | 20 74 6f 6f 6c 2e 0a 0a |rote the| tool...|
|00000fa0| 20 20 20 20 20 20 20 49 | 66 20 79 6f 75 20 61 72 | I|f you ar|
|00000fb0| 65 20 6c 6f 6f 6b 69 6e | 67 20 66 6f 72 20 63 6f |e lookin|g for co|
|00000fc0| 6d 6d 65 72 63 69 61 6c | 20 71 75 61 6c 69 74 79 |mmercial| quality|
|00000fd0| 2c 20 49 20 77 69 73 68 | 20 79 6f 75 20 74 68 65 |, I wish| you the|
|00000fe0| 20 62 65 73 74 20 6f 66 | 0a 20 20 20 20 20 20 20 | best of|. |
|00000ff0| 6c 75 63 6b 2e 20 49 66 | 20 79 6f 75 20 6a 75 73 |luck. If| you jus|
|00001000| 74 20 6e 65 65 64 20 73 | 6f 6d 65 74 68 69 6e 67 |t need s|omething|
|00001010| 20 74 6f 20 70 65 72 66 | 6f 72 6d 20 38 30 25 20 | to perf|orm 80% |
|00001020| 6f 66 20 74 68 65 20 67 | 72 75 6e 74 20 63 6f 64 |of the g|runt cod|
|00001030| 65 0a 20 20 20 20 20 20 | 20 74 72 61 6e 73 6c 61 |e. | transla|
|00001040| 74 69 6f 6e 2c 20 49 20 | 74 68 69 6e 6b 20 74 68 |tion, I |think th|
|00001050| 69 73 20 6d 69 67 68 74 | 20 6d 65 65 74 20 79 6f |is might| meet yo|
|00001060| 75 72 20 6e 65 65 64 73 | 2e 20 49 20 6b 6e 6f 77 |ur needs|. I know|
|00001070| 20 6f 66 20 74 77 6f 0a | 20 20 20 20 20 20 20 73 | of two.| s|
|00001080| 79 73 74 65 6d 73 20 63 | 6f 6d 70 72 69 73 69 6e |ystems c|omprisin|
|00001090| 67 20 61 62 6f 75 74 20 | 32 35 30 2c 30 30 30 20 |g about |250,000 |
|000010a0| 6c 69 6e 65 73 20 6f 66 | 20 63 6f 64 65 20 74 68 |lines of| code th|
|000010b0| 61 74 20 77 65 72 65 0a | 20 20 20 20 20 20 20 6f |at were.| o|
|000010c0| 72 69 67 69 6e 61 6c 6c | 79 20 64 65 76 65 6c 6f |riginall|y develo|
|000010d0| 70 65 64 20 69 6e 20 4d | 6f 64 75 6c 61 2d 32 20 |ped in M|odula-2 |
|000010e0| 74 68 65 6e 20 74 72 61 | 6e 73 6c 61 74 65 64 20 |then tra|nslated |
|000010f0| 61 6e 64 20 63 6c 65 61 | 6e 65 64 20 75 70 20 69 |and clea|ned up i|
|00001100| 6e 0a 20 20 20 20 20 20 | 20 41 64 61 20 38 33 20 |n. | Ada 83 |
|00001110| 61 66 74 65 72 20 41 6c | 73 79 73 20 31 2e 30 20 |after Al|sys 1.0 |
|00001120| 66 6f 72 20 74 68 65 20 | 50 43 20 63 61 6d 65 20 |for the |PC came |
|00001130| 6f 75 74 20 62 61 63 6b | 20 61 72 6f 75 6e 64 20 |out back| around |
|00001140| 31 39 38 37 2e 0a 0a 20 | 20 20 20 20 2a 20 56 69 |1987... | * Vi|
|00001150| 73 75 61 6c 20 42 61 73 | 69 63 20 74 6f 20 41 64 |sual Bas|ic to Ad|
|00001160| 61 3a 20 4e 4f 54 21 20 | 3a 2d 29 0a 0a 0a 39 2e |a: NOT! |:-)...9.|
|00001170| 32 3a 20 48 6f 77 20 63 | 61 6e 20 49 20 63 6f 6e |2: How c|an I con|
|00001180| 76 65 72 74 20 41 64 61 | 20 38 33 20 73 6f 75 72 |vert Ada| 83 sour|
|00001190| 63 65 73 20 74 6f 20 41 | 64 61 20 39 58 3f 0a 0a |ces to A|da 9X?..|
|000011a0| 20 20 20 46 69 72 73 74 | 20 79 6f 75 20 73 68 6f | First| you sho|
|000011b0| 75 6c 64 20 72 65 61 64 | 20 74 68 65 20 66 6f 6c |uld read| the fol|
|000011c0| 6c 6f 77 69 6e 67 20 64 | 6f 63 75 6d 65 6e 74 2c |lowing d|ocument,|
|000011d0| 20 77 68 69 63 68 20 77 | 69 6c 6c 20 70 72 6f 76 | which w|ill prov|
|000011e0| 69 64 65 20 79 6f 75 0a | 20 20 20 77 69 74 68 20 |ide you.| with |
|000011f0| 6d 75 63 68 20 75 73 65 | 66 75 6c 20 69 6e 66 6f |much use|ful info|
|00001200| 72 6d 61 74 69 6f 6e 3a | 20 22 43 68 61 6e 67 65 |rmation:| "Change|
|00001210| 73 20 74 6f 20 41 64 61 | 20 2d 2d 20 31 39 38 37 |s to Ada| -- 1987|
|00001220| 20 74 6f 20 31 39 39 35 | 22 2c 20 66 69 6c 65 0a | to 1995|", file.|
|00001230| 20 20 20 63 68 38 33 2e | 7b 70 73 2c 64 6f 63 7d | ch83.|{ps,doc}|
|00001240| 2c 20 69 6e 20 64 69 72 | 65 63 74 6f 72 79 0a 20 |, in dir|ectory. |
|00001250| 20 20 66 74 70 3a 2f 2f | 73 77 2d 65 6e 67 2e 66 | ftp://|sw-eng.f|
|00001260| 61 6c 6c 73 2d 63 68 75 | 72 63 68 2e 76 61 2e 75 |alls-chu|rch.va.u|
|00001270| 73 2f 70 75 62 6c 69 63 | 2f 41 64 61 49 43 2f 73 |s/public|/AdaIC/s|
|00001280| 74 61 6e 64 61 72 64 73 | 2f 39 35 6c 72 6d 5f 72 |tandards|/95lrm_r|
|00001290| 61 74 2f 76 36 2e 30 0a | 0a 0a 20 20 20 49 66 20 |at/v6.0.|.. If |
|000012a0| 79 6f 75 27 72 65 20 75 | 73 69 6e 67 20 47 4e 41 |you're u|sing GNA|
|000012b0| 54 2c 20 74 68 65 20 74 | 6f 6f 6c 20 79 6f 75 20 |T, the t|ool you |
|000012c0| 61 72 65 20 70 72 6f 62 | 61 62 6c 79 20 6c 6f 6f |are prob|ably loo|
|000012d0| 6b 69 6e 67 20 66 6f 72 | 20 69 73 0a 20 20 20 22 |king for| is. "|
|000012e0| 67 6e 61 74 63 68 6f 70 | 22 2e 20 49 6e 20 63 73 |gnatchop|". In cs|
|000012f0| 68 20 79 6f 75 20 63 6f | 75 6c 64 20 75 73 65 20 |h you co|uld use |
|00001300| 73 6f 6d 65 74 68 69 6e | 67 20 6c 69 6b 65 20 74 |somethin|g like t|
|00001310| 68 69 73 20 74 6f 20 71 | 75 69 63 6b 6c 79 0a 20 |his to q|uickly. |
|00001320| 20 20 70 72 6f 63 65 73 | 73 20 65 78 69 73 74 69 | proces|s existi|
|00001330| 6e 67 20 66 69 6c 65 73 | 3a 0a 0a 20 20 20 20 20 |ng files|:.. |
|00001340| 63 64 20 64 65 73 74 5f | 64 69 72 20 20 20 20 20 |cd dest_|dir |
|00001350| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 23 | | #|
|00001360| 20 54 68 65 20 64 65 73 | 74 69 6e 61 74 69 6f 6e | The des|tination|
|00001370| 20 64 69 72 65 63 74 6f | 72 79 0a 20 20 20 20 20 | directo|ry. |
|00001380| 66 6f 72 65 61 63 68 20 | 66 20 28 20 2e 2e 2f 73 |foreach |f ( ../s|
|00001390| 72 63 5f 64 69 72 2f 2a | 2e 61 20 29 20 20 20 23 |rc_dir/*|.a ) #|
|000013a0| 20 2e 2e 2f 73 72 63 5f | 64 69 72 20 69 73 20 74 | ../src_|dir is t|
|000013b0| 68 65 20 73 6f 75 72 63 | 65 20 64 69 72 65 63 74 |he sourc|e direct|
|000013c0| 6f 72 79 0a 20 20 20 20 | 20 20 20 67 6e 61 74 63 |ory. | gnatc|
|000013d0| 68 6f 70 20 24 66 0a 20 | 20 20 20 20 65 6e 64 0a |hop $f. | end.|
|000013e0| 0a 20 20 20 67 6e 61 74 | 63 68 6f 70 20 77 69 6c |. gnat|chop wil|
|000013f0| 6c 20 73 68 6f 77 20 79 | 6f 75 20 77 68 61 74 20 |l show y|ou what |
|00001400| 73 6f 75 72 63 65 73 20 | 61 72 65 20 63 61 75 73 |sources |are caus|
|00001410| 69 6e 67 20 70 72 6f 62 | 6c 65 6d 73 2e 0a 0a 0a |ing prob|lems....|
|00001420| 39 2e 33 3a 20 49 20 68 | 65 61 72 20 74 68 61 74 |9.3: I h|ear that|
|00001430| 20 41 64 61 20 69 73 20 | 73 6c 6f 77 65 72 20 74 | Ada is |slower t|
|00001440| 68 61 6e 20 46 6f 72 74 | 72 61 6e 20 6f 72 20 43 |han Fort|ran or C|
|00001450| 2c 20 69 73 20 74 68 61 | 74 20 74 72 75 65 3f 0a |, is tha|t true?.|
|00001460| 0a 20 20 20 46 69 72 73 | 74 2c 20 6e 6f 74 65 20 |. Firs|t, note |
|00001470| 74 68 61 74 20 79 6f 75 | 20 61 72 65 20 63 6f 6d |that you| are com|
|00001480| 70 61 72 69 6e 67 20 63 | 6f 6d 70 69 6c 65 72 73 |paring c|ompilers|
|00001490| 2c 20 6e 6f 74 20 6c 61 | 6e 67 75 61 67 65 73 2e |, not la|nguages.|
|000014a0| 20 54 68 65 72 65 20 69 | 73 0a 20 20 20 6e 6f 20 | There i|s. no |
|000014b0| 73 75 63 68 20 74 68 69 | 6e 67 20 61 73 20 22 66 |such thi|ng as "f|
|000014c0| 61 73 74 22 20 41 64 61 | 20 63 6f 64 65 20 61 6e |ast" Ada| code an|
|000014d0| 79 20 6d 6f 72 65 20 74 | 68 61 6e 20 74 68 65 72 |y more t|han ther|
|000014e0| 65 20 69 73 20 22 66 61 | 73 74 22 20 43 2b 2b 20 |e is "fa|st" C++ |
|000014f0| 6f 72 0a 20 20 20 46 6f | 72 74 72 61 6e 20 63 6f |or. Fo|rtran co|
|00001500| 64 65 2e 20 4e 6f 77 2c | 20 77 68 65 6e 20 63 6f |de. Now,| when co|
|00001510| 6d 70 61 72 69 6e 67 20 | 65 78 65 63 75 74 69 6f |mparing |executio|
|00001520| 6e 20 73 70 65 65 64 73 | 20 6f 6e 20 73 69 6d 69 |n speeds| on simi|
|00001530| 6c 61 72 0a 20 20 20 70 | 6c 61 74 66 6f 72 6d 73 |lar. p|latforms|
|00001540| 2c 20 79 6f 75 20 6d 75 | 73 74 20 6b 65 65 70 20 |, you mu|st keep |
|00001550| 69 6e 20 6d 69 6e 64 20 | 74 68 65 20 6f 70 74 69 |in mind |the opti|
|00001560| 6d 69 7a 61 74 69 6f 6e | 20 6c 65 76 65 6c 73 2c |mization| levels,|
|00001570| 20 4f 53 20 74 75 6e 69 | 6e 67 2c 0a 20 20 20 65 | OS tuni|ng,. e|
|00001580| 74 63 2e 20 77 68 69 6c | 65 20 6d 61 6b 69 6e 67 |tc. whil|e making|
|00001590| 20 74 68 65 20 63 6f 6d | 70 61 72 69 73 6f 6e 73 | the com|parisons|
|000015a0| 2e 20 54 68 65 20 62 6f | 74 74 6f 6d 20 6c 69 6e |. The bo|ttom lin|
|000015b0| 65 20 69 73 20 74 68 61 | 74 0a 20 20 20 62 65 6e |e is tha|t. ben|
|000015c0| 63 68 6d 61 72 6b 69 6e | 67 2c 20 65 73 70 65 63 |chmarkin|g, espec|
|000015d0| 69 61 6c 6c 79 20 62 65 | 74 77 65 65 6e 20 74 77 |ially be|tween tw|
|000015e0| 6f 20 64 69 66 66 65 72 | 65 6e 74 20 6c 61 6e 67 |o differ|ent lang|
|000015f0| 75 61 67 65 73 2c 20 72 | 65 71 75 69 72 65 73 0a |uages, r|equires.|
|00001600| 20 20 20 5f 76 65 72 79 | 5f 20 63 61 72 65 66 75 | _very|_ carefu|
|00001610| 6c 20 6d 65 61 73 75 72 | 65 6d 65 6e 74 2e 20 49 |l measur|ement. I|
|00001620| 6e 20 67 65 6e 65 72 61 | 6c 2c 20 73 75 63 68 20 |n genera|l, such |
|00001630| 72 65 73 75 6c 74 73 20 | 73 68 6f 75 6c 64 20 62 |results |should b|
|00001640| 65 20 76 69 65 77 65 64 | 0a 20 20 20 77 69 74 68 |e viewed|. with|
|00001650| 20 63 61 75 74 69 6f 6e | 2e 0a 0a 20 20 20 28 41 | caution|... (A|
|00001660| 20 6d 65 73 73 61 67 65 | 20 66 72 6f 6d 20 42 65 | message| from Be|
|00001670| 76 69 6e 20 42 72 65 74 | 74 20 6f 66 20 44 45 43 |vin Bret|t of DEC|
|00001680| 29 0a 0a 20 20 20 49 20 | 68 61 76 65 20 62 65 65 |).. I |have bee|
|00001690| 6e 20 61 73 6b 65 64 20 | 74 6f 20 63 6f 6d 6d 65 |n asked |to comme|
|000016a0| 6e 74 20 6f 6e 20 74 68 | 65 20 72 65 6c 61 74 69 |nt on th|e relati|
|000016b0| 76 65 20 70 65 72 66 6f | 72 6d 61 6e 63 65 20 6f |ve perfo|rmance o|
|000016c0| 66 20 61 6c 67 6f 72 69 | 74 68 6d 73 0a 20 20 20 |f algori|thms. |
|000016d0| 63 6f 64 65 64 20 69 6e | 20 41 64 61 20 61 6e 64 |coded in| Ada and|
|000016e0| 20 69 6e 20 46 6f 72 74 | 72 61 6e 2e 0a 0a 20 20 | in Fort|ran... |
|000016f0| 20 54 68 69 73 20 71 75 | 65 73 74 69 6f 6e 20 68 | This qu|estion h|
|00001700| 61 73 20 63 6f 6d 65 20 | 75 70 20 72 65 70 65 61 |as come |up repea|
|00001710| 74 65 64 6c 79 20 6f 76 | 65 72 20 74 68 65 20 79 |tedly ov|er the y|
|00001720| 65 61 72 73 2c 20 61 6e | 64 20 64 65 73 65 72 76 |ears, an|d deserv|
|00001730| 65 73 20 61 0a 20 20 20 | 63 6f 6d 70 6c 65 74 65 |es a. |complete|
|00001740| 20 61 6e 73 77 65 72 2c | 20 72 61 74 68 65 72 20 | answer,| rather |
|00001750| 74 68 61 6e 20 61 20 73 | 69 6d 70 6c 69 73 74 69 |than a s|implisti|
|00001760| 63 20 6f 6e 65 2e 0a 0a | 20 20 20 54 68 65 72 65 |c one...| There|
|00001770| 20 61 72 65 20 6d 61 6e | 79 20 66 61 63 74 6f 72 | are man|y factor|
|00001780| 73 20 77 68 69 63 68 20 | 69 6e 66 6c 75 65 6e 63 |s which |influenc|
|00001790| 65 20 74 68 65 20 73 69 | 7a 65 20 61 6e 64 20 65 |e the si|ze and e|
|000017a0| 78 65 63 75 74 69 6f 6e | 20 73 70 65 65 64 20 6f |xecution| speed o|
|000017b0| 66 0a 20 20 20 74 68 65 | 20 72 75 6e 6e 69 6e 67 |f. the| running|
|000017c0| 20 70 72 6f 67 72 61 6d | 2c 20 61 6e 64 20 74 68 | program|, and th|
|000017d0| 65 79 20 61 6c 6c 20 70 | 6c 61 79 20 74 6f 67 65 |ey all p|lay toge|
|000017e0| 74 68 65 72 20 74 6f 20 | 67 65 74 20 61 20 66 75 |ther to |get a fu|
|000017f0| 6c 6c 20 61 6e 73 77 65 | 72 2e 0a 20 20 20 49 20 |ll answe|r.. I |
|00001800| 73 68 61 6c 6c 20 74 68 | 65 6e 20 64 69 73 63 75 |shall th|en discu|
|00001810| 73 73 20 61 6e 20 65 78 | 61 63 74 20 41 64 61 20 |ss an ex|act Ada |
|00001820| 76 2e 20 46 6f 72 74 72 | 61 6e 20 63 6f 6d 70 61 |v. Fortr|an compa|
|00001830| 72 69 73 6f 6e 20 74 68 | 61 74 20 44 69 67 69 74 |rison th|at Digit|
|00001840| 61 6c 0a 20 20 20 77 61 | 73 20 69 6e 76 6f 6c 76 |al. wa|s involv|
|00001850| 65 64 20 69 6e 2e 0a 0a | 20 20 20 46 69 72 73 74 |ed in...| First|
|00001860| 2c 20 61 20 70 6f 73 69 | 74 69 6f 6e 20 73 74 61 |, a posi|tion sta|
|00001870| 74 65 6d 65 6e 74 3a 20 | 54 68 65 20 76 61 72 69 |tement: |The vari|
|00001880| 61 74 69 6f 6e 20 62 65 | 74 77 65 65 6e 20 41 64 |ation be|tween Ad|
|00001890| 61 20 61 6e 64 20 46 6f | 72 74 72 61 6e 20 69 73 |a and Fo|rtran is|
|000018a0| 0a 20 20 20 6c 65 73 73 | 20 74 68 61 6e 20 74 68 |. less| than th|
|000018b0| 65 20 76 61 72 69 61 74 | 69 6f 6e 20 77 69 74 68 |e variat|ion with|
|000018c0| 69 6e 20 74 68 65 20 6c | 61 6e 67 75 61 67 65 20 |in the l|anguage |
|000018d0| 63 61 75 73 65 64 20 62 | 79 20 74 68 65 20 65 78 |caused b|y the ex|
|000018e0| 61 63 74 0a 20 20 20 69 | 6d 70 6c 65 6d 65 6e 74 |act. i|mplement|
|000018f0| 61 74 69 6f 6e 20 64 65 | 74 61 69 6c 73 2e 20 41 |ation de|tails. A|
|00001900| 20 70 65 72 73 6f 6e 20 | 76 65 72 73 65 64 20 69 | person |versed i|
|00001910| 6e 20 74 68 65 20 41 64 | 61 20 69 73 73 75 65 73 |n the Ad|a issues|
|00001920| 20 73 68 6f 75 6c 64 20 | 64 6f 20 61 73 0a 20 20 | should |do as. |
|00001930| 20 77 65 6c 6c 20 69 6e | 20 41 64 61 20 61 73 20 | well in| Ada as |
|00001940| 61 20 70 65 72 73 6f 6e | 20 76 65 72 73 65 64 20 |a person| versed |
|00001950| 69 6e 20 74 68 65 20 46 | 6f 72 74 72 61 6e 20 69 |in the F|ortran i|
|00001960| 73 73 75 65 73 20 77 69 | 6c 6c 20 64 6f 20 69 6e |ssues wi|ll do in|
|00001970| 0a 20 20 20 46 6f 72 74 | 72 61 6e 2e 20 54 68 65 |. Fort|ran. The|
|00001980| 20 73 69 7a 65 20 61 6e | 64 20 65 78 65 63 75 74 | size an|d execut|
|00001990| 69 6f 6e 20 73 70 65 65 | 64 20 6f 66 20 74 68 65 |ion spee|d of the|
|000019a0| 20 72 65 73 75 6c 74 20 | 73 68 6f 75 6c 64 20 62 | result |should b|
|000019b0| 65 20 77 69 74 68 69 6e | 20 61 0a 20 20 20 66 65 |e within| a. fe|
|000019c0| 77 20 70 65 72 63 65 6e | 74 20 6f 66 20 65 61 63 |w percen|t of eac|
|000019d0| 68 20 6f 74 68 65 72 2e | 0a 0a 20 20 20 28 61 29 |h other.|.. (a)|
|000019e0| 20 44 69 66 66 65 72 65 | 6e 63 65 73 20 64 75 65 | Differe|nces due|
|000019f0| 20 74 6f 20 74 68 65 20 | 63 6f 6d 70 69 6c 65 72 | to the |compiler|
|00001a00| 0a 0a 20 20 20 49 6e 20 | 74 68 65 20 63 61 73 65 |.. In |the case|
|00001a10| 20 6f 66 20 74 68 65 20 | 44 45 43 20 41 64 61 20 | of the |DEC Ada |
|00001a20| 61 6e 64 20 46 6f 72 74 | 72 61 6e 20 63 6f 6d 70 |and Fort|ran comp|
|00001a30| 69 6c 65 72 73 2c 20 74 | 68 65 20 6f 70 74 69 6d |ilers, t|he optim|
|00001a40| 69 7a 65 72 20 61 6e 64 | 0a 20 20 20 20 20 20 20 |izer and|. |
|00001a50| 63 6f 64 65 20 67 65 6e | 65 72 61 74 6f 72 20 61 |code gen|erator a|
|00001a60| 72 65 20 74 68 65 20 73 | 61 6d 65 2e 20 4e 65 76 |re the s|ame. Nev|
|00001a70| 65 72 2d 74 68 65 2d 6c | 65 73 73 2c 20 74 68 65 |er-the-l|ess, the|
|00001a80| 20 65 78 61 63 74 20 69 | 6e 70 75 74 73 20 69 6e | exact i|nputs in|
|00001a90| 74 6f 0a 20 20 20 20 20 | 20 20 74 68 65 20 6f 70 |to. | the op|
|00001aa0| 74 69 6d 69 7a 65 72 20 | 61 6e 64 20 63 6f 64 65 |timizer |and code|
|00001ab0| 20 67 65 6e 65 72 61 74 | 6f 72 20 6d 61 79 20 64 | generat|or may d|
|00001ac0| 69 66 66 65 72 20 73 6c | 69 67 68 74 6c 79 20 77 |iffer sl|ightly w|
|00001ad0| 68 65 6e 20 74 68 65 20 | 73 61 6d 65 0a 20 20 20 |hen the |same. |
|00001ae0| 20 20 20 20 61 6c 67 6f | 72 69 74 68 6d 20 69 73 | algo|rithm is|
|00001af0| 20 63 6f 6d 70 69 6c 65 | 64 20 62 79 20 74 68 65 | compile|d by the|
|00001b00| 20 41 64 61 20 61 6e 64 | 20 46 6f 72 74 72 61 6e | Ada and| Fortran|
|00001b10| 20 63 6f 6d 70 69 6c 65 | 72 73 2c 20 61 6e 64 20 | compile|rs, and |
|00001b20| 74 68 69 73 0a 20 20 20 | 20 20 20 20 63 61 6e 20 |this. | can |
|00001b30| 72 65 73 75 6c 74 20 69 | 6e 20 6d 61 6a 6f 72 20 |result i|n major |
|00001b40| 64 69 66 66 65 72 65 6e | 63 65 73 20 69 6e 20 74 |differen|ces in t|
|00001b50| 68 65 20 67 65 6e 65 72 | 61 74 65 64 20 63 6f 64 |he gener|ated cod|
|00001b60| 65 2e 20 49 6e 20 74 68 | 65 73 65 0a 20 20 20 20 |e. In th|ese. |
|00001b70| 20 20 20 63 61 73 65 73 | 20 74 68 65 20 63 6f 6d | cases| the com|
|00001b80| 70 69 6c 65 72 20 66 72 | 6f 6e 74 20 65 6e 64 73 |piler fr|ont ends|
|00001b90| 20 63 61 6e 20 75 73 75 | 61 6c 6c 79 20 62 65 20 | can usu|ally be |
|00001ba0| 6d 6f 64 69 66 69 65 64 | 20 74 6f 20 63 6f 72 72 |modified| to corr|
|00001bb0| 65 63 74 0a 20 20 20 20 | 20 20 20 74 68 65 20 73 |ect. | the s|
|00001bc0| 6c 6f 77 65 72 20 6f 6e | 65 2e 0a 0a 20 20 20 20 |lower on|e... |
|00001bd0| 20 20 20 57 65 20 68 61 | 76 65 20 6e 6f 74 20 6f | We ha|ve not o|
|00001be0| 62 73 65 72 76 65 64 20 | 61 6e 79 20 6d 61 6a 6f |bserved |any majo|
|00001bf0| 72 20 64 69 66 66 65 72 | 65 6e 63 65 73 20 69 6e |r differ|ences in|
|00001c00| 20 67 65 6e 65 72 61 74 | 65 64 20 63 6f 64 65 0a | generat|ed code.|
|00001c10| 20 20 20 20 20 20 20 71 | 75 61 6c 69 74 79 20 62 | q|uality b|
|00001c20| 65 74 77 65 65 6e 20 74 | 68 65 20 44 45 43 20 41 |etween t|he DEC A|
|00001c30| 64 61 20 61 6e 64 20 44 | 45 43 20 46 6f 72 74 72 |da and D|EC Fortr|
|00001c40| 61 6e 20 63 6f 6d 70 69 | 6c 65 72 73 20 63 61 75 |an compi|lers cau|
|00001c50| 73 65 64 20 62 79 0a 20 | 20 20 20 20 20 20 73 75 |sed by. | su|
|00001c60| 63 68 20 69 73 73 75 65 | 73 2e 0a 0a 0a 20 20 20 |ch issue|s.... |
|00001c70| 28 62 29 20 44 69 66 66 | 65 72 65 6e 63 65 73 20 |(b) Diff|erences |
|00001c80| 64 75 65 20 74 6f 20 74 | 68 65 20 6c 61 6e 67 75 |due to t|he langu|
|00001c90| 61 67 65 0a 0a 20 20 20 | 49 74 20 69 73 20 76 65 |age.. |It is ve|
|00001ca0| 72 79 20 69 6d 70 6f 72 | 74 61 6e 74 20 74 68 61 |ry impor|tant tha|
|00001cb0| 74 20 74 68 65 20 73 61 | 6d 65 20 61 6c 67 6f 72 |t the sa|me algor|
|00001cc0| 69 74 68 6d 20 62 65 20 | 77 72 69 74 74 65 6e 20 |ithm be |written |
|00001cd0| 69 6e 20 74 68 65 20 74 | 77 6f 0a 20 20 20 20 20 |in the t|wo. |
|00001ce0| 20 20 6c 61 6e 67 75 61 | 67 65 73 2e 20 54 68 65 | langua|ges. The|
|00001cf0| 20 62 69 67 67 65 73 74 | 20 64 69 66 66 65 72 65 | biggest| differe|
|00001d00| 6e 63 65 73 20 77 65 20 | 68 61 76 65 20 6f 62 73 |nces we |have obs|
|00001d10| 65 72 76 65 64 20 61 72 | 65 0a 20 20 20 20 20 20 |erved ar|e. |
|00001d20| 20 20 20 31 2e 20 48 61 | 76 69 6e 67 20 74 68 65 | 1. Ha|ving the|
|00001d30| 20 77 72 6f 6e 67 20 64 | 69 6d 65 6e 73 69 6f 6e | wrong d|imension|
|00001d40| 20 76 61 72 79 69 6e 67 | 20 66 61 73 74 65 73 74 | varying| fastest|
|00001d50| 2c 20 73 69 6e 63 65 20 | 69 74 20 69 73 0a 20 20 |, since |it is. |
|00001d60| 20 20 20 20 20 20 20 20 | 20 20 64 65 73 69 72 65 | | desire|
|00001d70| 61 62 6c 65 20 74 6f 20 | 68 61 76 65 20 74 68 65 |able to |have the|
|00001d80| 20 66 69 72 73 74 20 64 | 69 6d 65 6e 73 69 6f 6e | first d|imension|
|00001d90| 20 63 68 61 6e 67 69 6e | 67 20 66 61 73 74 65 73 | changin|g fastes|
|00001da0| 74 20 69 6e 0a 20 20 20 | 20 20 20 20 20 20 20 20 |t in. | |
|00001db0| 20 46 6f 72 74 72 61 6e | 2c 20 61 6e 64 20 74 68 | Fortran|, and th|
|00001dc0| 65 20 6c 61 73 74 20 64 | 69 6d 65 6e 73 69 6f 6e |e last d|imension|
|00001dd0| 20 69 6e 20 41 64 61 2e | 20 54 68 75 73 20 77 68 | in Ada.| Thus wh|
|00001de0| 65 6e 20 61 6e 0a 20 20 | 20 20 20 20 20 20 20 20 |en an. | |
|00001df0| 20 20 61 6c 67 6f 72 69 | 74 68 6d 20 69 73 20 74 | algori|thm is t|
|00001e00| 72 61 6e 73 6c 69 74 65 | 72 61 74 65 64 2c 20 74 |ranslite|rated, t|
|00001e10| 68 65 20 61 72 72 61 79 | 20 69 6e 64 65 78 65 73 |he array| indexes|
|00001e20| 20 6d 75 73 74 20 62 65 | 0a 20 20 20 20 20 20 20 | must be|. |
|00001e30| 20 20 20 20 20 72 65 76 | 65 72 73 65 64 2e 0a 0a | rev|ersed...|
|00001e40| 20 20 20 20 20 20 20 20 | 20 32 2e 20 55 73 69 6e | | 2. Usin|
|00001e50| 67 20 63 6f 6d 70 69 6c | 65 2d 74 69 6d 65 2d 6b |g compil|e-time-k|
|00001e60| 6e 6f 77 6e 20 62 6f 75 | 6e 64 73 20 66 6f 72 20 |nown bou|nds for |
|00001e70| 61 72 72 61 79 73 20 69 | 6e 20 46 6f 72 74 72 61 |arrays i|n Fortra|
|00001e80| 6e 2c 20 61 6e 64 0a 20 | 20 20 20 20 20 20 20 20 |n, and. | |
|00001e90| 20 20 20 75 73 69 6e 67 | 20 75 6e 63 6f 6e 73 74 | using| unconst|
|00001ea0| 72 61 69 6e 65 64 20 61 | 72 72 61 79 73 20 69 6e |rained a|rrays in|
|00001eb0| 20 74 68 65 20 41 64 61 | 20 63 6f 64 65 2e 20 4b | the Ada| code. K|
|00001ec0| 6e 6f 77 69 6e 67 20 74 | 68 65 20 65 78 61 63 74 |nowing t|he exact|
|00001ed0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 76 61 6c |. | val|
|00001ee0| 75 65 73 20 6f 66 20 74 | 68 65 20 64 69 6d 65 6e |ues of t|he dimen|
|00001ef0| 73 69 6f 6e 73 20 61 74 | 20 63 6f 6d 70 69 6c 65 |sions at| compile|
|00001f00| 2d 74 69 6d 65 20 72 65 | 73 75 6c 74 73 20 69 6e |-time re|sults in|
|00001f10| 20 6d 75 63 68 0a 20 20 | 20 20 20 20 20 20 20 20 | much. | |
|00001f20| 20 20 62 65 74 74 65 72 | 20 63 6f 64 65 2e 0a 0a | better| code...|
|00001f30| 20 20 20 20 20 20 20 20 | 20 33 2e 20 4e 6f 74 20 | | 3. Not |
|00001f40| 73 75 70 70 72 65 73 73 | 69 6e 67 20 61 6c 6c 20 |suppress|ing all |
|00001f50| 74 68 65 20 72 75 6e 74 | 69 6d 65 20 63 68 65 63 |the runt|ime chec|
|00001f60| 6b 73 20 69 6e 20 41 64 | 61 2e 20 54 68 65 20 46 |ks in Ad|a. The F|
|00001f70| 6f 72 74 72 61 6e 0a 20 | 20 20 20 20 20 20 20 20 |ortran. | |
|00001f80| 20 20 20 63 6f 6d 70 69 | 6c 65 72 20 61 73 73 75 | compi|ler assu|
|00001f90| 6d 65 73 20 61 6c 6c 20 | 61 72 72 61 79 20 62 6f |mes all |array bo|
|00001fa0| 75 6e 64 73 20 61 72 65 | 20 69 6e 20 72 61 6e 67 |unds are| in rang|
|00001fb0| 65 2c 20 61 6e 64 20 61 | 6c 6c 0a 20 20 20 20 20 |e, and a|ll. |
|00001fc0| 20 20 20 20 20 20 20 61 | 72 69 74 68 6d 65 74 69 | a|rithmeti|
|00001fd0| 63 20 6f 70 65 72 61 74 | 69 6f 6e 73 20 64 6f 20 |c operat|ions do |
|00001fe0| 6e 6f 74 20 6f 76 65 72 | 66 6c 6f 77 2e 20 59 6f |not over|flow. Yo|
|00001ff0| 75 20 6d 75 73 74 20 75 | 73 65 20 61 20 70 72 61 |u must u|se a pra|
|00002000| 67 6d 61 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |gma. | |
|00002010| 53 75 70 70 72 65 73 73 | 20 74 6f 20 74 65 6c 6c |Suppress| to tell|
|00002020| 20 74 68 69 73 20 74 6f | 20 74 68 65 20 41 64 61 | this to| the Ada|
|00002030| 20 63 6f 6d 70 69 6c 65 | 72 20 61 73 20 77 65 6c | compile|r as wel|
|00002040| 6c 2e 0a 0a 20 20 20 20 | 20 20 20 20 20 34 2e 20 |l... | 4. |
|00002050| 44 6f 6e 27 74 20 75 73 | 65 20 61 72 72 61 79 73 |Don't us|e arrays|
|00002060| 20 6f 66 20 41 64 61 20 | 42 6f 6f 6c 65 61 6e 73 | of Ada |Booleans|
|00002070| 20 74 6f 20 6d 61 74 63 | 68 20 61 72 72 61 79 73 | to matc|h arrays|
|00002080| 20 6f 66 20 46 6f 72 74 | 72 61 6e 0a 20 20 20 20 | of Fort|ran. |
|00002090| 20 20 20 20 20 20 20 20 | 49 6e 74 65 67 65 72 73 | |Integers|
|000020a0| 2c 20 62 65 63 61 75 73 | 65 20 61 63 63 65 73 73 |, becaus|e access|
|000020b0| 69 6e 67 20 62 79 74 65 | 73 20 6f 6e 20 61 20 52 |ing byte|s on a R|
|000020c0| 49 53 43 20 73 79 73 74 | 65 6d 20 6d 69 67 68 74 |ISC syst|em might|
|000020d0| 20 62 65 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 | be. | |
|000020e0| 6d 75 63 68 20 77 6f 72 | 73 65 20 74 68 61 6e 20 |much wor|se than |
|000020f0| 61 63 63 65 73 73 69 6e | 67 20 66 75 6c 6c 77 6f |accessin|g fullwo|
|00002100| 72 64 73 2e 0a 0a 0a 20 | 20 20 28 63 29 20 44 69 |rds.... | (c) Di|
|00002110| 66 66 65 72 65 6e 63 65 | 73 20 64 75 65 20 74 6f |fference|s due to|
|00002120| 20 74 68 65 20 62 69 6e | 64 69 6e 67 73 0a 0a 20 | the bin|dings.. |
|00002130| 20 20 54 68 65 20 62 69 | 67 67 65 73 74 20 62 69 | The bi|ggest bi|
|00002140| 6e 64 69 6e 67 73 20 64 | 69 66 66 65 72 65 6e 63 |ndings d|ifferenc|
|00002150| 65 73 20 61 72 65 20 72 | 65 6c 61 74 65 64 20 74 |es are r|elated t|
|00002160| 6f 20 46 6f 72 74 72 61 | 6e 27 73 20 62 75 69 6c |o Fortra|n's buil|
|00002170| 74 2d 69 6e 0a 20 20 20 | 20 20 20 20 73 75 70 70 |t-in. | supp|
|00002180| 6f 72 74 20 66 6f 72 20 | 63 6f 6d 70 6c 65 78 20 |ort for |complex |
|00002190| 74 79 70 65 73 2c 20 61 | 6e 64 20 66 6f 72 20 76 |types, a|nd for v|
|000021a0| 61 72 69 6f 75 73 20 6d | 61 74 68 20 72 6f 75 74 |arious m|ath rout|
|000021b0| 69 6e 65 73 20 73 75 63 | 68 20 61 73 0a 20 20 20 |ines suc|h as. |
|000021c0| 20 20 20 20 53 51 52 54 | 20 61 6e 64 20 53 49 4e | SQRT| and SIN|
|000021d0| 2c 20 63 6f 6d 70 61 72 | 65 64 20 77 69 74 68 20 |, compar|ed with |
|000021e0| 41 64 61 20 63 6f 64 65 | 20 74 68 61 74 20 6f 66 |Ada code| that of|
|000021f0| 74 65 6e 20 75 73 65 73 | 20 68 61 6e 64 2d 63 6f |ten uses| hand-co|
|00002200| 64 65 64 20 6f 72 0a 20 | 20 20 20 20 20 20 49 53 |ded or. | IS|
|00002210| 4f 20 73 74 61 6e 64 61 | 72 64 69 73 65 64 20 76 |O standa|rdised v|
|00002220| 65 72 73 69 6f 6e 73 20 | 6f 66 20 74 68 65 73 65 |ersions |of these|
|00002230| 20 66 75 6e 63 74 69 6f | 6e 73 20 77 69 74 68 20 | functio|ns with |
|00002240| 64 69 66 66 65 72 65 6e | 74 0a 20 20 20 20 20 20 |differen|t. |
|00002250| 20 72 65 71 75 69 72 65 | 6d 65 6e 74 73 20 74 68 | require|ments th|
|00002260| 61 6e 20 61 72 65 20 69 | 6d 70 6f 73 65 64 20 6f |an are i|mposed o|
|00002270| 6e 20 74 68 65 20 46 6f | 72 74 72 61 6e 20 76 65 |n the Fo|rtran ve|
|00002280| 72 73 69 6f 6e 73 2e 0a | 0a 20 20 20 20 20 20 20 |rsions..|. |
|00002290| 44 45 43 20 41 64 61 20 | 68 61 73 20 62 75 69 6c |DEC Ada |has buil|
|000022a0| 74 2d 69 6e 20 73 75 70 | 70 6f 72 74 20 66 6f 72 |t-in sup|port for|
|000022b0| 20 63 6f 6d 70 6c 65 78 | 20 74 79 70 65 73 2c 20 | complex| types, |
|000022c0| 61 6e 64 20 61 6c 73 6f | 20 68 61 73 0a 20 20 20 |and also| has. |
|000022d0| 20 20 20 20 62 69 6e 64 | 69 6e 67 73 20 64 69 72 | bind|ings dir|
|000022e0| 65 63 74 6c 79 20 74 6f | 20 74 68 65 20 73 61 6d |ectly to| the sam|
|000022f0| 65 20 70 72 69 6d 69 74 | 69 76 65 73 20 74 68 61 |e primit|ives tha|
|00002300| 74 20 46 6f 72 74 72 61 | 6e 20 75 73 65 73 20 66 |t Fortra|n uses f|
|00002310| 6f 72 20 69 74 73 0a 20 | 20 20 20 20 20 20 6d 61 |or its. | ma|
|00002320| 74 68 20 72 6f 75 74 69 | 6e 65 73 20 61 6e 64 20 |th routi|nes and |
|00002330| 73 6f 20 67 65 74 73 20 | 74 68 65 20 73 61 6d 65 |so gets |the same|
|00002340| 20 70 65 72 66 6f 72 6d | 61 6e 63 65 20 61 73 20 | perform|ance as |
|00002350| 46 6f 72 74 72 61 6e 20 | 64 6f 65 73 2e 0a 0a 0a |Fortran |does....|
|00002360| 20 20 20 28 64 29 20 44 | 69 66 66 65 72 65 6e 63 | (d) D|ifferenc|
|00002370| 65 73 20 64 75 65 20 74 | 6f 20 74 68 65 20 61 75 |es due t|o the au|
|00002380| 74 68 6f 72 0a 0a 20 20 | 20 54 68 65 20 75 73 65 |thor.. | The use|
|00002390| 20 6f 66 20 67 6f 6f 64 | 20 41 64 61 20 61 6e 64 | of good| Ada and|
|000023a0| 20 46 6f 72 74 72 61 6e | 20 73 74 79 6c 65 20 63 | Fortran| style c|
|000023b0| 61 6e 20 61 6c 73 6f 20 | 65 66 66 65 63 74 20 74 |an also |effect t|
|000023c0| 68 65 20 67 65 6e 65 72 | 61 74 65 64 0a 20 20 20 |he gener|ated. |
|000023d0| 20 20 20 20 63 6f 64 65 | 2e 20 50 72 6f 76 69 64 | code|. Provid|
|000023e0| 65 64 20 74 68 65 20 61 | 75 74 68 6f 72 20 77 72 |ed the a|uthor wr|
|000023f0| 69 74 65 73 20 69 6e 20 | 67 6f 6f 64 20 41 64 61 |ites in |good Ada|
|00002400| 20 73 74 79 6c 65 2c 20 | 61 6e 64 20 66 6f 6c 6c | style, |and foll|
|00002410| 6f 77 73 0a 20 20 20 20 | 20 20 20 74 68 65 20 61 |ows. | the a|
|00002420| 62 6f 76 65 20 67 75 69 | 64 65 6c 69 6e 65 73 2c |bove gui|delines,|
|00002430| 20 74 68 65 20 67 65 6e | 65 72 61 74 65 64 20 63 | the gen|erated c|
|00002440| 6f 64 65 20 73 68 6f 75 | 6c 64 20 64 6f 20 61 73 |ode shou|ld do as|
|00002450| 20 77 65 6c 6c 20 61 73 | 0a 20 20 20 20 20 20 20 | well as|. |
|00002460| 46 6f 72 74 72 61 6e 2e | 0a 0a 0a 20 20 20 20 54 |Fortran.|... T|
|00002470| 68 65 20 41 64 61 20 50 | 65 72 66 6f 72 6d 61 6e |he Ada P|erforman|
|00002480| 63 65 20 42 65 6e 63 68 | 6d 61 72 6b 0a 0a 20 20 |ce Bench|mark.. |
|00002490| 20 41 20 44 45 43 20 41 | 64 61 20 63 75 73 74 6f | A DEC A|da custo|
|000024a0| 6d 65 72 20 68 61 64 20 | 61 20 46 6f 72 74 72 61 |mer had |a Fortra|
|000024b0| 6e 20 62 65 6e 63 68 6d | 61 72 6b 20 74 68 61 74 |n benchm|ark that|
|000024c0| 20 68 61 64 20 62 65 65 | 6e 20 74 72 61 6e 73 6c | had bee|n transl|
|000024d0| 61 74 65 64 0a 20 20 20 | 69 6e 74 6f 20 41 64 61 |ated. |into Ada|
|000024e0| 20 77 69 74 68 6f 75 74 | 20 61 77 61 72 65 6e 65 | without| awarene|
|000024f0| 73 73 20 6f 66 20 74 68 | 65 20 61 62 6f 76 65 20 |ss of th|e above |
|00002500| 69 73 73 75 65 73 2c 20 | 61 6e 64 20 77 61 73 20 |issues, |and was |
|00002510| 72 75 6e 6e 69 6e 67 0a | 20 20 20 73 75 62 73 74 |running.| subst|
|00002520| 61 6e 74 69 61 6c 6c 79 | 20 73 6c 6f 77 65 72 20 |antially| slower |
|00002530| 77 69 74 68 20 44 45 43 | 20 41 64 61 20 74 68 61 |with DEC| Ada tha|
|00002540| 6e 20 74 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 77 |n the or|iginal w|
|00002550| 61 73 20 77 69 74 68 20 | 44 45 43 0a 20 20 20 46 |as with |DEC. F|
|00002560| 6f 72 74 72 61 6e 2e 0a | 0a 20 20 20 42 65 76 69 |ortran..|. Bevi|
|00002570| 6e 20 42 72 65 74 74 2c | 20 61 20 44 45 43 20 41 |n Brett,| a DEC A|
|00002580| 64 61 20 74 65 61 6d 20 | 6d 65 6d 62 65 72 2c 20 |da team |member, |
|00002590| 64 65 76 65 6c 6f 70 65 | 64 20 74 68 65 20 61 62 |develope|d the ab|
|000025a0| 6f 76 65 20 67 75 69 64 | 65 6c 69 6e 65 73 20 69 |ove guid|elines i|
|000025b0| 6e 0a 20 20 20 74 68 65 | 20 70 72 6f 63 65 73 73 |n. the| process|
|000025c0| 20 6f 66 20 72 65 74 72 | 61 6e 73 6c 61 74 69 6e | of retr|anslatin|
|000025d0| 67 20 74 68 65 20 63 6f | 64 65 20 69 6e 74 6f 20 |g the co|de into |
|000025e0| 41 64 61 2e 0a 0a 20 20 | 20 50 6f 72 74 69 6f 6e |Ada... | Portion|
|000025f0| 73 20 6f 66 20 74 68 69 | 73 20 74 72 61 6e 73 6c |s of thi|s transl|
|00002600| 61 74 69 6f 6e 20 61 72 | 65 20 73 68 6f 77 6e 20 |ation ar|e shown |
|00002610| 68 65 72 65 20 28 61 29 | 20 61 73 20 61 6e 20 69 |here (a)| as an i|
|00002620| 6c 6c 75 73 74 72 61 74 | 69 6f 6e 20 6f 66 0a 20 |llustrat|ion of. |
|00002630| 20 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f | the ap|plicatio|
|00002640| 6e 20 6f 66 20 74 68 65 | 20 61 62 6f 76 65 20 72 |n of the| above r|
|00002650| 75 6c 65 73 2c 20 61 6e | 64 20 28 62 29 20 61 73 |ules, an|d (b) as|
|00002660| 20 61 6e 20 69 6c 6c 75 | 73 74 72 61 74 69 6f 6e | an illu|stration|
|00002670| 20 6f 66 20 74 68 65 0a | 20 20 20 6b 69 6e 64 20 | of the.| kind |
|00002680| 6f 66 20 6f 70 65 72 61 | 74 69 6f 6e 73 20 74 68 |of opera|tions th|
|00002690| 61 74 20 77 65 72 65 20 | 70 72 65 73 65 6e 74 20 |at were |present |
|000026a0| 69 6e 20 74 68 65 20 62 | 65 6e 63 68 6d 61 72 6b |in the b|enchmark|
|000026b0| 2e 0a 0a 20 20 20 54 68 | 65 20 77 68 6f 6c 65 20 |... Th|e whole |
|000026c0| 62 65 6e 63 68 6d 61 72 | 6b 20 68 61 73 20 6e 6f |benchmar|k has no|
|000026d0| 74 20 62 65 65 6e 20 70 | 72 6f 76 69 64 65 64 20 |t been p|rovided |
|000026e0| 74 6f 20 61 76 6f 69 64 | 20 70 6f 73 73 69 62 6c |to avoid| possibl|
|000026f0| 65 20 69 73 73 75 65 73 | 20 6f 66 0a 20 20 20 6f |e issues| of. o|
|00002700| 77 6e 65 72 73 68 69 70 | 2e 0a 0a 20 20 20 54 68 |wnership|... Th|
|00002710| 65 20 72 65 73 75 6c 74 | 69 6e 67 20 41 64 61 20 |e result|ing Ada |
|00002720| 62 65 6e 63 68 6d 61 72 | 6b 20 63 6f 6d 70 6f 6e |benchmar|k compon|
|00002730| 65 6e 74 73 20 65 61 63 | 68 20 72 61 6e 20 77 69 |ents eac|h ran wi|
|00002740| 74 68 69 6e 20 61 20 66 | 65 77 20 70 65 72 63 65 |thin a f|ew perce|
|00002750| 6e 74 0a 20 20 20 6f 66 | 20 74 68 65 69 72 20 46 |nt. of| their F|
|00002760| 6f 72 74 72 61 6e 20 63 | 6f 75 6e 74 65 72 70 61 |ortran c|ounterpa|
|00002770| 72 74 73 2e 20 54 68 65 | 20 41 64 61 20 63 6f 64 |rts. The| Ada cod|
|00002780| 65 20 69 73 20 61 76 61 | 69 6c 61 62 6c 65 20 62 |e is ava|ilable b|
|00002790| 79 20 46 54 50 2c 20 69 | 6e 0a 20 20 20 66 69 6c |y FTP, i|n. fil|
|000027a0| 65 20 66 74 70 3a 2f 2f | 6c 67 6c 66 74 70 2e 65 |e ftp://|lglftp.e|
|000027b0| 70 66 6c 2e 63 68 2f 70 | 75 62 2f 41 64 61 2f 46 |pfl.ch/p|ub/Ada/F|
|000027c0| 41 51 2f 61 64 61 2d 76 | 73 2d 66 6f 72 74 72 61 |AQ/ada-v|s-fortra|
|000027d0| 6e 2e 61 64 61 0a 0a 0a | 39 2e 34 3a 20 49 73 6e |n.ada...|9.4: Isn|
|000027e0| 27 74 20 41 64 61 20 6c | 65 73 73 20 22 65 6c 65 |'t Ada l|ess "ele|
|000027f0| 67 61 6e 74 22 20 74 68 | 61 6e 20 45 69 66 66 65 |gant" th|an Eiffe|
|00002800| 6c 3f 0a 0a 20 20 20 57 | 68 69 6c 65 20 69 74 20 |l?.. W|hile it |
|00002810| 69 73 20 74 72 75 65 20 | 74 68 61 74 20 70 72 6f |is true |that pro|
|00002820| 67 72 61 6d 6d 69 6e 67 | 2d 6c 61 6e 67 75 61 67 |gramming|-languag|
|00002830| 65 20 73 75 70 70 6f 72 | 74 20 66 6f 72 20 22 61 |e suppor|t for "a|
|00002840| 73 73 65 72 74 69 6f 6e | 73 22 0a 20 20 20 69 73 |ssertion|s". is|
|00002850| 20 61 6e 20 69 6d 70 6f | 72 74 61 6e 74 20 63 6f | an impo|rtant co|
|00002860| 6e 74 72 69 62 75 74 69 | 6f 6e 20 6f 66 20 45 69 |ntributi|on of Ei|
|00002870| 66 66 65 6c 20 74 6f 20 | 73 6f 66 74 77 61 72 65 |ffel to |software|
|00002880| 20 63 6f 6e 73 74 72 75 | 63 74 69 6f 6e 2c 20 74 | constru|ction, t|
|00002890| 68 69 73 0a 20 20 20 69 | 73 20 6e 6f 74 20 61 6e |his. i|s not an|
|000028a0| 20 69 73 73 75 65 20 6f | 66 20 22 65 6c 65 67 61 | issue o|f "elega|
|000028b0| 6e 63 65 22 2c 20 61 6e | 64 20 74 68 65 72 65 20 |nce", an|d there |
|000028c0| 61 72 65 20 6d 61 6e 79 | 20 6f 74 68 65 72 20 69 |are many| other i|
|000028d0| 6d 70 6f 72 74 61 6e 74 | 0a 20 20 20 66 61 63 74 |mportant|. fact|
|000028e0| 6f 72 73 20 74 6f 20 63 | 6f 6e 73 69 64 65 72 2e |ors to c|onsider.|
|000028f0| 0a 0a 20 20 20 4e 6f 74 | 65 20 61 6c 73 6f 20 74 |.. Not|e also t|
|00002900| 68 61 74 20 70 72 65 63 | 6f 6e 64 69 74 69 6f 6e |hat prec|ondition|
|00002910| 73 20 61 6e 64 20 70 6f | 73 74 63 6f 6e 64 69 74 |s and po|stcondit|
|00002920| 69 6f 6e 73 20 63 61 6e | 20 62 65 20 66 61 69 72 |ions can| be fair|
|00002930| 6c 79 20 65 61 73 69 6c | 79 0a 20 20 20 61 6e 64 |ly easil|y. and|
|00002940| 20 65 66 66 69 63 69 65 | 6e 74 6c 79 20 69 6e 63 | efficie|ntly inc|
|00002950| 6c 75 64 65 64 20 69 6e | 20 41 64 61 20 63 6f 64 |luded in| Ada cod|
|00002960| 65 2e 20 49 6e 76 61 72 | 69 61 6e 74 73 20 73 65 |e. Invar|iants se|
|00002970| 65 6d 20 64 69 66 66 69 | 63 75 6c 74 20 74 6f 0a |em diffi|cult to.|
|00002980| 20 20 20 65 6d 75 6c 61 | 74 65 20 64 69 72 65 63 | emula|te direc|
|00002990| 74 6c 79 20 69 6e 20 41 | 64 61 2e 20 49 66 20 79 |tly in A|da. If y|
|000029a0| 6f 75 27 72 65 20 72 65 | 61 6c 6c 79 20 69 6e 74 |ou're re|ally int|
|000029b0| 65 72 65 73 74 65 64 20 | 69 6e 20 74 68 65 20 66 |erested |in the f|
|000029c0| 6f 72 6d 61 6c 20 75 73 | 65 0a 20 20 20 6f 66 20 |ormal us|e. of |
|000029d0| 61 73 73 65 72 74 69 6f | 6e 73 20 77 69 74 68 20 |assertio|ns with |
|000029e0| 41 64 61 2c 20 6d 61 79 | 62 65 20 41 6e 6e 61 20 |Ada, may|be Anna |
|000029f0| 69 73 20 61 20 73 6f 6c | 75 74 69 6f 6e 20 66 6f |is a sol|ution fo|
|00002a00| 72 20 79 6f 75 2e 0a 0a | 20 20 20 28 54 75 63 6b |r you...| (Tuck|
|00002a10| 65 72 20 54 61 66 74 20 | 63 6f 6d 6d 65 6e 74 73 |er Taft |comments|
|00002a20| 29 0a 0a 20 20 20 49 20 | 67 75 65 73 73 20 6f 6e |).. I |guess on|
|00002a30| 65 20 74 68 69 6e 67 20 | 74 68 61 74 20 62 6f 74 |e thing |that bot|
|00002a40| 68 65 72 73 20 6d 65 20 | 61 20 6c 69 74 74 6c 65 |hers me |a little|
|00002a50| 20 69 73 20 74 68 61 74 | 20 70 65 6f 70 6c 65 20 | is that| people |
|00002a60| 61 72 65 20 71 75 69 63 | 6b 20 74 6f 0a 20 20 20 |are quic|k to. |
|00002a70| 73 61 79 20 74 68 61 74 | 20 45 69 66 66 65 6c 20 |say that| Eiffel |
|00002a80| 69 73 20 22 65 6c 65 67 | 61 6e 74 22 20 77 69 74 |is "eleg|ant" wit|
|00002a90| 68 6f 75 74 20 72 65 61 | 6c 6c 79 20 6c 6f 6f 6b |hout rea|lly look|
|00002aa0| 69 6e 67 20 61 74 20 69 | 74 2e 20 49 20 66 65 61 |ing at i|t. I fea|
|00002ab0| 72 20 74 68 61 74 0a 20 | 20 20 73 75 63 68 20 73 |r that. | such s|
|00002ac0| 74 61 74 65 6d 65 6e 74 | 73 20 77 69 6c 6c 20 62 |tatement|s will b|
|00002ad0| 65 63 6f 6d 65 20 73 65 | 6c 66 2d 66 75 6c 66 69 |ecome se|lf-fulfi|
|00002ae0| 6c 6c 69 6e 67 20 70 72 | 6f 70 68 65 63 69 65 73 |lling pr|ophecies|
|00002af0| 2c 20 77 69 74 68 20 74 | 68 6f 73 65 0a 20 20 20 |, with t|hose. |
|00002b00| 70 72 6f 67 72 61 6d 6d | 65 72 73 20 69 6e 74 65 |programm|ers inte|
|00002b10| 72 65 73 74 65 64 20 69 | 6e 20 65 6c 65 67 61 6e |rested i|n elegan|
|00002b20| 63 65 20 6d 69 67 72 61 | 74 69 6e 67 20 6f 76 65 |ce migra|ting ove|
|00002b30| 72 20 74 6f 20 45 69 66 | 66 65 6c 20 72 61 74 68 |r to Eif|fel rath|
|00002b40| 65 72 0a 20 20 20 74 68 | 61 6e 20 73 74 69 63 6b |er. th|an stick|
|00002b50| 69 6e 67 20 77 69 74 68 | 20 41 64 61 2e 0a 0a 20 |ing with| Ada... |
|00002b60| 20 20 49 6e 20 70 61 72 | 74 69 63 75 6c 61 72 2c | In par|ticular,|
|00002b70| 20 61 6c 74 68 6f 75 67 | 68 20 49 20 6c 69 6b 65 | althoug|h I like|
|00002b80| 20 74 68 65 20 61 73 73 | 65 72 74 69 6f 6e 20 73 | the ass|ertion s|
|00002b90| 74 75 66 66 20 69 6e 20 | 45 69 66 66 65 6c 2c 20 |tuff in |Eiffel, |
|00002ba0| 49 20 74 68 69 6e 6b 0a | 20 20 20 74 68 65 20 6c |I think.| the l|
|00002bb0| 61 6e 67 75 61 67 65 20 | 68 61 73 20 61 20 6e 75 |anguage |has a nu|
|00002bc0| 6d 62 65 72 20 6f 66 20 | 22 69 6e 65 6c 65 67 61 |mber of |"inelega|
|00002bd0| 6e 74 22 20 61 73 70 65 | 63 74 73 2e 20 46 6f 72 |nt" aspe|cts. For|
|00002be0| 20 65 78 61 6d 70 6c 65 | 3a 0a 0a 20 20 20 20 31 | example|:.. 1|
|00002bf0| 2e 20 65 78 63 65 70 74 | 69 6f 6e 20 68 61 6e 64 |. except|ion hand|
|00002c00| 6c 65 72 73 20 6f 6e 6c | 79 20 61 74 20 74 68 65 |lers onl|y at the|
|00002c10| 20 74 6f 70 20 6c 65 76 | 65 6c 20 6f 66 20 61 20 | top lev|el of a |
|00002c20| 72 6f 75 74 69 6e 65 2c | 20 77 69 74 68 20 74 68 |routine,| with th|
|00002c30| 65 0a 20 20 20 20 20 20 | 20 6f 6e 6c 79 20 77 61 |e. | only wa|
|00002c40| 79 20 74 6f 20 22 68 61 | 6e 64 6c 65 22 20 61 6e |y to "ha|ndle" an|
|00002c50| 20 65 78 63 65 70 74 69 | 6f 6e 20 62 65 69 6e 67 | excepti|on being|
|00002c60| 20 62 79 20 72 65 74 72 | 79 69 6e 67 20 74 68 65 | by retr|ying the|
|00002c70| 20 77 68 6f 6c 65 0a 20 | 20 20 20 20 20 20 72 6f | whole. | ro|
|00002c80| 75 74 69 6e 65 2e 0a 0a | 20 20 20 20 32 2e 20 4e |utine...| 2. N|
|00002c90| 6f 20 77 61 79 20 74 6f | 20 72 65 74 75 72 6e 20 |o way to| return |
|00002ca0| 66 72 6f 6d 20 61 20 72 | 6f 75 74 69 6e 65 20 69 |from a r|outine i|
|00002cb0| 6e 20 74 68 65 20 6d 69 | 64 64 6c 65 2e 20 54 68 |n the mi|ddle. Th|
|00002cc0| 69 73 20 6d 61 6b 65 73 | 20 69 74 20 61 0a 20 20 |is makes| it a. |
|00002cd0| 20 20 20 20 20 70 61 69 | 6e 20 69 6e 20 74 68 65 | pai|n in the|
|00002ce0| 20 6e 65 63 6b 20 74 6f | 20 73 65 61 72 63 68 20 | neck to| search |
|00002cf0| 74 68 72 6f 75 67 68 20 | 61 20 6c 69 73 74 20 66 |through |a list f|
|00002d00| 6f 72 20 73 6f 6d 65 74 | 68 69 6e 67 20 69 6e 20 |or somet|hing in |
|00002d10| 61 20 6c 6f 6f 70 2c 0a | 20 20 20 20 20 20 20 61 |a loop,.| a|
|00002d20| 6e 64 20 74 68 65 6e 20 | 72 65 74 75 72 6e 20 69 |nd then |return i|
|00002d30| 6d 6d 65 64 69 61 74 65 | 6c 79 20 77 68 65 6e 20 |mmediate|ly when |
|00002d40| 79 6f 75 20 66 69 6e 64 | 20 77 68 61 74 20 79 6f |you find| what yo|
|00002d50| 75 20 77 61 6e 74 2e 20 | 28 49 20 68 61 76 65 0a |u want. |(I have.|
|00002d60| 20 20 20 20 20 20 20 6e | 65 76 65 72 20 66 6f 75 | n|ever fou|
|00002d70| 6e 64 20 74 68 65 20 61 | 64 64 69 74 69 6f 6e 20 |nd the a|ddition |
|00002d80| 6f 66 20 65 78 74 72 61 | 20 62 6f 6f 6c 65 61 6e |of extra| boolean|
|00002d90| 20 63 6f 6e 74 72 6f 6c | 20 76 61 72 69 61 62 6c | control| variabl|
|00002da0| 65 20 61 20 68 65 6c 70 | 0a 20 20 20 20 20 20 20 |e a help|. |
|00002db0| 74 6f 20 74 68 65 20 75 | 6e 64 65 72 73 74 61 6e |to the u|nderstan|
|00002dc0| 64 69 6e 67 20 6f 66 20 | 61 6e 20 61 6c 67 6f 72 |ding of |an algor|
|00002dd0| 69 74 68 6d 2e 29 0a 0a | 20 20 20 20 33 2e 20 4e |ithm.)..| 3. N|
|00002de0| 61 6d 65 73 70 61 63 65 | 20 63 6f 6e 74 72 6f 6c |amespace| control|
|00002df0| 20 68 61 6e 64 6c 65 64 | 20 62 79 20 61 20 73 65 | handled| by a se|
|00002e00| 70 61 72 61 74 65 20 73 | 75 62 6c 61 6e 67 75 61 |parate s|ublangua|
|00002e10| 67 65 2c 20 61 6e 64 20 | 6e 6f 20 72 65 61 6c 0a |ge, and |no real.|
|00002e20| 20 20 20 20 20 20 20 68 | 69 67 68 65 72 20 6c 65 | h|igher le|
|00002e30| 76 65 6c 20 63 6f 6e 63 | 65 70 74 20 6f 66 20 22 |vel conc|ept of "|
|00002e40| 6d 6f 64 75 6c 65 22 20 | 6f 72 20 22 73 75 62 73 |module" |or "subs|
|00002e50| 79 73 74 65 6d 2e 22 0a | 0a 20 20 20 20 34 2e 20 |ystem.".|. 4. |
|00002e60| 41 6e 20 6f 62 73 63 75 | 72 65 20 6e 6f 74 61 74 |An obscu|re notat|
|00002e70| 69 6f 6e 20 6c 69 6b 65 | 20 22 21 21 22 20 62 65 |ion like| "!!" be|
|00002e80| 69 6e 67 20 75 73 65 64 | 20 66 6f 72 20 61 6e 20 |ing used| for an |
|00002e90| 69 6d 70 6f 72 74 61 6e | 74 20 61 6e 64 0a 20 20 |importan|t and. |
|00002ea0| 20 20 20 20 20 66 72 65 | 71 75 65 6e 74 20 6f 70 | fre|quent op|
|00002eb0| 65 72 61 74 69 6f 6e 20 | 28 63 6f 6e 73 74 72 75 |eration |(constru|
|00002ec0| 63 74 69 6f 6e 29 2e 0a | 0a 20 20 20 20 35 2e 20 |ction)..|. 5. |
|00002ed0| 4e 6f 20 77 61 79 20 74 | 6f 20 63 6f 6e 76 65 6e |No way t|o conven|
|00002ee0| 69 65 6e 74 6c 79 20 22 | 75 73 65 22 20 61 6e 6f |iently "|use" ano|
|00002ef0| 74 68 65 72 20 61 62 73 | 74 72 61 63 74 69 6f 6e |ther abs|traction|
|00002f00| 20 77 69 74 68 6f 75 74 | 0a 20 20 20 20 20 20 20 | without|. |
|00002f10| 69 6e 68 65 72 69 74 69 | 6e 67 20 66 72 6f 6d 20 |inheriti|ng from |
|00002f20| 69 74 2e 0a 0a 20 20 20 | 20 36 2e 20 4e 6f 20 73 |it... | 6. No s|
|00002f30| 74 72 6f 6e 67 20 64 69 | 73 74 69 6e 63 74 69 6f |trong di|stinctio|
|00002f40| 6e 73 20 62 65 74 77 65 | 65 6e 20 69 6e 74 65 67 |ns betwe|en integ|
|00002f50| 65 72 20 74 79 70 65 73 | 20 75 73 65 64 20 66 6f |er types| used fo|
|00002f60| 72 20 61 72 72 61 79 0a | 20 20 20 20 20 20 20 69 |r array.| i|
|00002f70| 6e 64 65 78 69 6e 67 2e | 0a 0a 20 20 20 20 37 2e |ndexing.|.. 7.|
|00002f80| 20 55 73 69 6e 67 20 74 | 68 65 20 73 61 6d 65 20 | Using t|he same |
|00002f90| 6f 70 65 72 61 74 6f 72 | 20 22 3a 3d 22 20 66 6f |operator| ":=" fo|
|00002fa0| 72 20 62 6f 74 68 20 28 | 61 6c 69 61 73 69 6e 67 |r both (|aliasing|
|00002fb0| 29 20 70 6f 69 6e 74 65 | 72 0a 20 20 20 20 20 20 |) pointe|r. |
|00002fc0| 20 61 73 73 69 67 6e 6d | 65 6e 74 2c 20 61 6e 64 | assignm|ent, and|
|00002fd0| 20 66 6f 72 20 76 61 6c | 75 65 20 61 73 73 69 67 | for val|ue assig|
|00002fe0| 6e 6d 65 6e 74 2c 20 64 | 65 70 65 6e 64 69 6e 67 |nment, d|epending|
|00002ff0| 20 6f 6e 20 77 68 65 74 | 68 65 72 20 74 68 65 0a | on whet|her the.|
|00003000| 20 20 20 20 20 20 20 74 | 79 70 65 20 69 73 20 22 | t|ype is "|
|00003010| 65 78 70 61 6e 64 65 64 | 2e 22 20 28 53 69 6d 75 |expanded|." (Simu|
|00003020| 6c 61 27 73 20 73 6f 6c | 75 74 69 6f 6e 20 77 61 |la's sol|ution wa|
|00003030| 73 20 66 61 72 20 70 72 | 65 66 65 72 61 62 6c 65 |s far pr|eferable|
|00003040| 2c 20 49 4d 48 4f 29 2e | 0a 0a 20 20 20 20 41 6e |, IMHO).|.. An|
|00003050| 64 20 6d 6f 73 74 20 63 | 72 69 74 69 63 61 6c 6c |d most c|riticall|
|00003060| 79 3a 0a 0a 0a 20 20 20 | 20 38 2e 20 4e 6f 20 73 |y:... | 8. No s|
|00003070| 65 70 61 72 61 74 65 20 | 69 6e 74 65 72 66 61 63 |eparate |interfac|
|00003080| 65 20 66 6f 72 20 61 6e | 20 61 62 73 74 72 61 63 |e for an| abstrac|
|00003090| 74 69 6f 6e 2e 20 59 6f | 75 20 63 61 6e 20 76 69 |tion. Yo|u can vi|
|000030a0| 65 77 20 61 20 69 6e 74 | 65 72 66 61 63 65 0a 20 |ew a int|erface. |
|000030b0| 20 20 20 20 20 20 62 79 | 20 72 75 6e 6e 69 6e 67 | by| running|
|000030c0| 20 61 20 74 6f 6f 6c 2c | 20 62 75 74 20 74 68 69 | a tool,| but thi|
|000030d0| 73 20 6d 69 73 73 65 73 | 20 63 6f 6d 70 6c 65 74 |s misses| complet|
|000030e0| 65 6c 79 20 74 68 65 20 | 69 6d 70 6f 72 74 61 6e |ely the |importan|
|000030f0| 63 65 20 6f 66 0a 20 20 | 20 20 20 20 20 68 61 76 |ce of. | hav|
|00003100| 69 6e 67 20 61 20 70 68 | 79 73 69 63 61 6c 20 6d |ing a ph|ysical m|
|00003110| 6f 64 75 6c 65 20 74 68 | 61 74 20 72 65 70 72 65 |odule th|at repre|
|00003120| 73 65 6e 74 73 20 74 68 | 65 20 69 6e 74 65 72 66 |sents th|e interf|
|00003130| 61 63 65 2c 20 61 6e 64 | 20 61 63 74 73 0a 20 20 |ace, and| acts. |
|00003140| 20 20 20 20 20 61 73 20 | 61 20 63 6f 6e 74 72 61 | as |a contra|
|00003150| 63 74 20 62 65 74 77 65 | 65 6e 20 74 68 65 20 73 |ct betwe|en the s|
|00003160| 70 65 63 69 66 69 65 72 | 20 6f 72 20 75 73 65 72 |pecifier| or user|
|00003170| 20 6f 66 20 61 6e 20 61 | 62 73 74 72 61 63 74 69 | of an a|bstracti|
|00003180| 6f 6e 20 61 6e 64 0a 20 | 20 20 20 20 20 20 69 74 |on and. | it|
|00003190| 73 20 69 6d 70 6c 65 6d | 65 6e 74 6f 72 2e 20 49 |s implem|entor. I|
|000031a0| 6e 20 45 69 66 66 65 6c | 2c 20 6f 6e 65 20 6d 69 |n Eiffel|, one mi|
|000031b0| 67 68 74 20 6e 6f 74 20 | 65 76 65 6e 20 62 65 20 |ght not |even be |
|000031c0| 74 72 75 6c 79 20 61 77 | 61 72 65 20 77 68 65 6e |truly aw|are when|
|000031d0| 0a 20 20 20 20 20 20 20 | 6f 6e 65 20 69 73 20 63 |. |one is c|
|000031e0| 68 61 6e 67 69 6e 67 20 | 74 68 65 20 69 6e 74 65 |hanging |the inte|
|000031f0| 72 66 61 63 65 20 74 6f | 20 61 6e 20 61 62 73 74 |rface to| an abst|
|00003200| 72 61 63 74 69 6f 6e 2c | 20 62 65 63 61 75 73 65 |raction,| because|
|00003210| 20 74 68 65 72 65 20 69 | 73 0a 20 20 20 20 20 20 | there i|s. |
|00003220| 20 6e 6f 20 70 61 72 74 | 69 63 75 6c 61 72 20 70 | no part|icular p|
|00003230| 68 79 73 69 63 61 6c 20 | 73 65 70 61 72 61 74 69 |hysical |separati|
|00003240| 6f 6e 20 62 65 74 77 65 | 65 6e 20 69 6e 74 65 72 |on betwe|en inter|
|00003250| 66 61 63 65 20 61 6e 64 | 0a 20 20 20 20 20 20 20 |face and|. |
|00003260| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 2e 0a |implemen|tation..|
|00003270| 0a 0a 20 20 20 49 20 63 | 6f 6e 73 69 64 65 72 20 |.. I c|onsider |
|00003280| 6d 61 6e 79 20 6f 66 20 | 74 68 65 20 61 62 6f 76 |many of |the abov|
|00003290| 65 20 70 72 6f 62 6c 65 | 6d 73 20 71 75 69 74 65 |e proble|ms quite|
|000032a0| 20 73 65 72 69 6f 75 73 | 2c 20 77 69 74 68 20 73 | serious|, with s|
|000032b0| 6f 6d 65 20 6f 66 20 74 | 68 65 6d 0a 20 20 20 62 |ome of t|hem. b|
|000032c0| 65 69 6e 67 20 72 65 61 | 6c 20 74 68 72 6f 77 62 |eing rea|l throwb|
|000032d0| 61 63 6b 73 20 74 6f 20 | 74 68 65 20 6f 6c 64 20 |acks to |the old |
|000032e0| 73 74 79 6c 65 20 6f 66 | 20 70 72 6f 67 72 61 6d |style of| program|
|000032f0| 6d 69 6e 67 20 6c 61 6e | 67 75 61 67 65 73 20 77 |ming lan|guages w|
|00003300| 68 65 72 65 0a 20 20 20 | 74 68 65 72 65 20 77 65 |here. |there we|
|00003310| 72 65 20 6e 6f 20 77 65 | 6c 6c 20 64 65 66 69 6e |re no we|ll defin|
|00003320| 65 64 20 69 6e 74 65 72 | 66 61 63 65 73 20 6f 72 |ed inter|faces or|
|00003330| 20 6d 6f 64 75 6c 65 73 | 2e 0a 0a 20 20 20 48 65 | modules|... He|
|00003340| 6e 63 65 2c 20 49 20 63 | 72 69 6e 67 65 20 61 20 |nce, I c|ringe a |
|00003350| 62 69 74 20 77 68 65 6e | 20 70 65 6f 70 6c 65 20 |bit when| people |
|00003360| 73 61 79 20 74 68 61 74 | 20 45 69 66 66 65 6c 20 |say that| Eiffel |
|00003370| 69 73 20 74 68 65 20 22 | 6d 6f 73 74 0a 20 20 20 |is the "|most. |
|00003380| 65 6c 65 67 61 6e 74 22 | 20 4f 4f 50 20 61 6e 64 |elegant"| OOP and|
|00003390| 20 74 68 61 74 20 74 68 | 65 79 20 77 6f 75 6c 64 | that th|ey would|
|000033a0| 20 75 73 65 20 69 74 20 | 69 66 20 6f 6e 6c 79 20 | use it |if only |
|000033b0| 69 74 20 77 65 72 65 20 | 70 72 61 63 74 69 63 61 |it were |practica|
|000033c0| 6c 20 74 6f 0a 20 20 20 | 64 6f 20 73 6f 2e 20 49 |l to. |do so. I|
|000033d0| 6e 20 6d 61 6e 79 20 77 | 61 79 73 2c 20 49 20 74 |n many w|ays, I t|
|000033e0| 68 69 6e 6b 20 41 64 61 | 20 69 73 20 6d 75 63 68 |hink Ada| is much|
|000033f0| 20 62 65 74 74 65 72 20 | 68 75 6d 61 6e 2d 65 6e | better |human-en|
|00003400| 67 69 6e 65 65 72 65 64 | 20 74 68 61 6e 0a 20 20 |gineered| than. |
|00003410| 20 45 69 66 66 65 6c 2c | 20 77 69 74 68 20 69 6d | Eiffel,| with im|
|00003420| 70 6f 72 74 61 6e 74 20 | 74 68 69 6e 67 73 20 6c |portant |things l|
|00003430| 69 6b 65 20 72 61 6e 67 | 65 20 63 6f 6e 73 74 72 |ike rang|e constr|
|00003440| 61 69 6e 74 73 20 62 75 | 69 6c 74 20 69 6e 74 6f |aints bu|ilt into|
|00003450| 20 74 68 65 0a 20 20 20 | 6c 61 6e 67 75 61 67 65 | the. |language|
|00003460| 20 69 6e 20 61 20 77 61 | 79 20 74 68 61 74 20 6d | in a wa|y that m|
|00003470| 61 6b 65 73 20 74 68 65 | 6d 20 63 6f 6e 76 65 6e |akes the|m conven|
|00003480| 69 65 6e 74 20 74 6f 20 | 75 73 65 2e 20 41 6c 74 |ient to |use. Alt|
|00003490| 68 6f 75 67 68 20 67 65 | 6e 65 72 61 6c 0a 20 20 |hough ge|neral. |
|000034a0| 20 61 73 73 65 72 74 69 | 6f 6e 73 20 61 72 65 20 | asserti|ons are |
|000034b0| 6e 69 63 65 2c 20 74 68 | 65 79 20 64 6f 6e 27 74 |nice, th|ey don't|
|000034c0| 20 67 69 76 65 20 79 6f | 75 20 74 68 65 20 6b 69 | give yo|u the ki|
|000034d0| 6e 64 20 6f 66 20 6c 69 | 6e 65 2d 62 79 2d 6c 69 |nd of li|ne-by-li|
|000034e0| 6e 65 0a 20 20 20 63 6f | 6e 73 69 73 74 65 6e 63 |ne. co|nsistenc|
|000034f0| 79 20 63 68 65 63 6b 73 | 20 74 68 61 74 20 41 64 |y checks| that Ad|
|00003500| 61 20 63 61 6e 20 67 69 | 76 65 20 79 6f 75 2e 0a |a can gi|ve you..|
|00003510| 0a 20 20 20 54 6f 20 73 | 75 6d 6d 61 72 69 7a 65 |. To s|ummarize|
|00003520| 20 2d 2d 0a 20 20 20 41 | 6c 74 68 6f 75 67 68 20 | --. A|lthough |
|00003530| 45 69 66 66 65 6c 20 63 | 65 72 74 61 69 6e 6c 79 |Eiffel c|ertainly|
|00003540| 20 68 61 73 20 61 20 6e | 75 6d 62 65 72 20 6f 66 | has a n|umber of|
|00003550| 20 6e 69 63 65 20 66 65 | 61 74 75 72 65 73 2c 20 | nice fe|atures, |
|00003560| 49 20 64 6f 6e 27 74 0a | 20 20 20 63 6f 6e 73 69 |I don't.| consi|
|00003570| 64 65 72 20 69 74 20 72 | 65 61 64 79 20 66 6f 72 |der it r|eady for|
|00003580| 20 70 72 69 6d 65 20 74 | 69 6d 65 20 61 73 20 66 | prime t|ime as f|
|00003590| 61 72 20 61 73 20 62 75 | 69 6c 64 69 6e 67 20 61 |ar as bu|ilding a|
|000035a0| 6e 64 20 6d 61 69 6e 74 | 61 69 6e 69 6e 67 0a 20 |nd maint|aining. |
|000035b0| 20 20 6c 61 72 67 65 20 | 73 79 73 74 65 6d 73 20 | large |systems |
|000035c0| 77 69 74 68 20 6c 61 72 | 67 65 20 6e 75 6d 62 65 |with lar|ge numbe|
|000035d0| 72 73 20 6f 66 20 70 72 | 6f 67 72 61 6d 6d 65 72 |rs of pr|ogrammer|
|000035e0| 73 2e 20 41 6e 64 20 66 | 72 6f 6d 20 61 20 68 75 |s. And f|rom a hu|
|000035f0| 6d 61 6e 0a 20 20 20 65 | 6e 67 69 6e 65 65 72 69 |man. e|ngineeri|
|00003600| 6e 67 20 70 6f 69 6e 74 | 20 6f 66 20 76 69 65 77 |ng point| of view|
|00003610| 2c 20 49 20 74 68 69 6e | 6b 20 41 64 61 20 69 73 |, I thin|k Ada is|
|00003620| 20 73 69 67 6e 69 66 69 | 63 61 6e 74 6c 79 20 62 | signifi|cantly b|
|00003630| 65 74 74 65 72 2e 0a 0a | 0a 39 2e 35 3a 20 41 72 |etter...|.9.5: Ar|
|00003640| 65 20 74 68 65 72 65 20 | 61 6e 79 20 70 61 70 65 |e there |any pape|
|00003650| 72 73 20 64 65 74 61 69 | 6c 69 6e 67 20 74 68 65 |rs detai|ling the|
|00003660| 20 64 69 66 66 65 72 65 | 6e 63 65 73 20 62 65 74 | differe|nces bet|
|00003670| 77 65 65 6e 20 41 64 61 | 20 61 6e 64 20 43 2b 2b |ween Ada| and C++|
|00003680| 3f 0a 0a 20 20 20 42 65 | 6c 6f 77 20 61 72 65 20 |?.. Be|low are |
|00003690| 74 77 6f 20 72 65 66 65 | 72 65 6e 63 65 73 2e 20 |two refe|rences. |
|000036a0| 42 65 61 72 20 69 6e 20 | 6d 69 6e 64 20 74 68 61 |Bear in |mind tha|
|000036b0| 74 20 69 74 20 69 73 20 | 64 69 66 66 69 63 75 6c |t it is |difficul|
|000036c0| 74 20 74 6f 20 6d 61 6b | 65 0a 20 20 20 73 75 63 |t to mak|e. suc|
|000036d0| 68 20 61 20 63 6f 6d 70 | 61 72 69 73 6f 6e 20 77 |h a comp|arison w|
|000036e0| 69 74 68 6f 75 74 20 65 | 78 70 6f 73 69 6e 67 20 |ithout e|xposing |
|000036f0| 62 69 61 73 65 73 2e 20 | 48 6f 77 65 76 65 72 2c |biases. |However,|
|00003700| 20 74 68 65 20 74 77 6f | 20 70 61 70 65 72 73 0a | the two| papers.|
|00003710| 20 20 20 62 65 6c 6f 77 | 20 61 72 65 20 77 65 6c | below| are wel|
|00003720| 6c 20 77 6f 72 74 68 20 | 72 65 61 64 69 6e 67 2e |l worth |reading.|
|00003730| 0a 0a 20 20 20 22 41 20 | 43 6f 6d 70 61 72 69 73 |.. "A |Comparis|
|00003740| 6f 6e 20 6f 66 20 74 68 | 65 20 4f 4f 20 66 65 61 |on of th|e OO fea|
|00003750| 74 75 72 65 73 20 6f 66 | 20 41 64 61 39 78 20 61 |tures of| Ada9x a|
|00003760| 6e 64 20 43 2b 2b 22 20 | 69 6e 20 53 70 72 69 6e |nd C++" |in Sprin|
|00003770| 67 65 72 20 4c 65 63 74 | 75 72 65 0a 20 20 20 4e |ger Lect|ure. N|
|00003780| 6f 74 65 73 20 69 6e 20 | 43 53 3a 20 22 41 64 61 |otes in |CS: "Ada|
|00003790| 20 45 75 72 6f 70 65 20 | 39 33 22 20 70 70 2e 31 | Europe |93" pp.1|
|000037a0| 32 35 2d 31 34 31 20 28 | 73 68 6f 72 74 20 70 61 |25-141 (|short pa|
|000037b0| 70 65 72 2c 20 67 6f 6f | 64 20 72 65 61 64 69 6e |per, goo|d readin|
|000037c0| 67 2c 0a 20 20 20 65 6e | 6c 69 67 68 74 65 6e 73 |g,. en|lightens|
|000037d0| 20 69 64 69 6f 6d 73 29 | 0a 0a 20 20 20 66 74 70 | idioms)|.. ftp|
|000037e0| 20 61 6a 70 6f 2e 73 65 | 69 2e 63 6d 75 2e 65 64 | ajpo.se|i.cmu.ed|
|000037f0| 75 20 69 6e 20 64 69 72 | 65 63 74 6f 72 79 3a 20 |u in dir|ectory: |
|00003800| 2f 70 75 62 6c 69 63 2f | 61 64 61 39 78 2c 20 64 |/public/|ada9x, d|
|00003810| 6f 63 75 6d 65 6e 74 3a | 0a 20 20 20 39 78 5f 63 |ocument:|. 9x_c|
|00003820| 70 6c 75 73 2e 68 6c 70 | 0a 0a 0a 39 2e 36 3a 20 |plus.hlp|...9.6: |
|00003830| 49 20 6b 65 65 70 20 68 | 65 61 72 69 6e 67 20 74 |I keep h|earing t|
|00003840| 68 61 74 20 41 64 61 20 | 69 73 20 61 20 22 73 74 |hat Ada |is a "st|
|00003850| 72 6f 6e 67 6c 79 20 74 | 79 70 65 64 20 6c 61 6e |rongly t|yped lan|
|00003860| 67 75 61 67 65 22 2c 20 | 62 75 74 20 69 74 20 73 |guage", |but it s|
|00003870| 65 65 6d 73 0a 64 69 66 | 66 65 72 65 6e 74 20 66 |eems.dif|ferent f|
|00003880| 72 6f 6d 20 77 68 61 74 | 27 73 20 6d 65 61 6e 74 |rom what|'s meant|
|00003890| 20 69 6e 20 43 2b 2b 2e | 20 41 72 65 20 74 68 65 | in C++.| Are the|
|000038a0| 79 20 64 69 66 66 65 72 | 65 6e 74 3f 0a 0a 20 20 |y differ|ent?.. |
|000038b0| 20 28 54 75 63 6b 65 72 | 20 54 61 66 74 20 72 65 | (Tucker| Taft re|
|000038c0| 73 70 6f 6e 64 73 29 0a | 0a 20 20 20 49 20 63 65 |sponds).|. I ce|
|000038d0| 72 74 61 69 6e 6c 79 20 | 61 67 72 65 65 20 74 68 |rtainly |agree th|
|000038e0| 61 74 20 41 4e 53 49 20 | 43 20 61 6e 64 20 43 2b |at ANSI |C and C+|
|000038f0| 2b 20 61 72 65 20 73 74 | 61 74 69 63 61 6c 6c 79 |+ are st|atically|
|00003900| 20 74 79 70 65 64 20 6c | 61 6e 67 75 61 67 65 73 | typed l|anguages|
|00003910| 2c 0a 20 20 20 62 75 74 | 20 49 20 77 6f 75 6c 64 |,. but| I would|
|00003920| 20 64 65 62 61 74 65 20 | 74 68 65 20 22 73 74 72 | debate |the "str|
|00003930| 65 6e 67 74 68 22 20 6f | 66 20 74 68 65 69 72 20 |ength" o|f their |
|00003940| 74 79 70 69 6e 67 2e 0a | 0a 20 20 20 45 73 73 65 |typing..|. Esse|
|00003950| 6e 74 69 61 6c 6c 79 20 | 61 6e 79 20 73 75 70 70 |ntially |any supp|
|00003960| 6f 72 74 20 66 6f 72 20 | 69 6d 70 6c 69 63 69 74 |ort for |implicit|
|00003970| 20 63 6f 6e 76 65 72 73 | 69 6f 6e 20 28 69 6d 70 | convers|ion (imp|
|00003980| 6c 69 63 69 74 20 22 63 | 61 73 74 69 6e 67 2c 22 |licit "c|asting,"|
|00003990| 0a 20 20 20 22 70 72 6f | 6d 6f 74 69 6f 6e 22 2c |. "pro|motion",|
|000039a0| 20 22 75 73 75 61 6c 22 | 20 61 72 69 74 68 6d 65 | "usual"| arithme|
|000039b0| 74 69 63 20 63 6f 6e 76 | 65 72 73 69 6f 6e 73 2c |tic conv|ersions,|
|000039c0| 20 65 74 63 2e 29 20 22 | 77 65 61 6b 65 6e 73 22 | etc.) "|weakens"|
|000039d0| 20 61 20 74 79 70 65 0a | 20 20 20 73 79 73 74 65 | a type.| syste|
|000039e0| 6d 20 28 62 75 74 20 61 | 6c 73 6f 20 6d 61 6b 65 |m (but a|lso make|
|000039f0| 73 20 69 74 20 22 66 72 | 69 65 6e 64 6c 69 65 72 |s it "fr|iendlier|
|00003a00| 22 20 69 6e 20 73 6f 6d | 65 20 77 61 79 73 29 2e |" in som|e ways).|
|00003a10| 0a 0a 20 20 20 43 20 61 | 6c 6c 6f 77 73 20 69 6d |.. C a|llows im|
|00003a20| 70 6c 69 63 69 74 20 63 | 6f 6e 76 65 72 73 69 6f |plicit c|onversio|
|00003a30| 6e 20 62 65 74 77 65 65 | 6e 20 61 6c 6c 20 69 6e |n betwee|n all in|
|00003a40| 74 65 67 65 72 20 74 79 | 70 65 73 20 61 6e 64 20 |teger ty|pes and |
|00003a50| 61 6c 6c 0a 20 20 20 65 | 6e 75 6d 65 72 61 74 69 |all. e|numerati|
|00003a60| 6f 6e 20 74 79 70 65 73 | 2e 20 43 2b 2b 20 61 74 |on types|. C++ at|
|00003a70| 20 6c 65 61 73 74 20 63 | 75 74 73 20 6f 66 66 20 | least c|uts off |
|00003a80| 69 6d 70 6c 69 63 69 74 | 20 63 6f 6e 76 65 72 73 |implicit| convers|
|00003a90| 69 6f 6e 20 74 6f 0a 20 | 20 20 65 6e 75 6d 65 72 |ion to. | enumer|
|00003aa0| 61 74 69 6f 6e 20 74 79 | 70 65 73 2c 20 62 75 74 |ation ty|pes, but|
|00003ab0| 20 72 65 74 61 69 6e 73 | 20 69 6d 70 6c 69 63 69 | retains| implici|
|00003ac0| 74 20 63 6f 6e 76 65 72 | 73 69 6f 6e 20 61 6d 6f |t conver|sion amo|
|00003ad0| 6e 67 20 61 6c 6c 20 69 | 6e 74 65 67 65 72 0a 20 |ng all i|nteger. |
|00003ae0| 20 20 28 61 6e 64 20 66 | 6c 6f 61 74 69 6e 67 2d | (and f|loating-|
|00003af0| 70 6f 69 6e 74 29 20 74 | 79 70 65 73 2e 20 41 6c |point) t|ypes. Al|
|00003b00| 73 6f 2c 20 69 6e 20 62 | 6f 74 68 20 43 20 61 6e |so, in b|oth C an|
|00003b10| 64 20 43 2b 2b 2c 20 74 | 79 70 65 64 65 66 73 20 |d C++, t|ypedefs |
|00003b20| 66 6f 72 0a 20 20 20 70 | 6f 69 6e 74 65 72 2f 61 |for. p|ointer/a|
|00003b30| 72 72 61 79 20 74 79 70 | 65 73 20 61 72 65 20 65 |rray typ|es are e|
|00003b40| 73 73 65 6e 74 69 61 6c | 6c 79 20 22 6d 61 63 72 |ssential|ly "macr|
|00003b50| 6f 73 22 3b 20 61 6c 6c | 20 70 6f 69 6e 74 65 72 |os"; all| pointer|
|00003b60| 20 74 79 70 65 73 20 77 | 69 74 68 0a 20 20 20 74 | types w|ith. t|
|00003b70| 68 65 20 73 61 6d 65 20 | 74 61 72 67 65 74 20 74 |he same |target t|
|00003b80| 79 70 65 20 61 72 65 20 | 69 6d 70 6c 69 63 69 74 |ype are |implicit|
|00003b90| 6c 79 20 69 6e 74 65 72 | 63 6f 6e 76 65 72 74 69 |ly inter|converti|
|00003ba0| 62 6c 65 2e 0a 0a 20 20 | 20 46 69 6e 61 6c 6c 79 |ble... | Finally|
|00003bb0| 20 43 2b 2b 20 61 6c 6c | 6f 77 73 20 74 68 65 20 | C++ all|ows the |
|00003bc0| 75 73 65 72 20 74 6f 20 | 64 65 66 69 6e 65 20 61 |user to |define a|
|00003bd0| 20 6e 75 6d 62 65 72 20 | 6f 66 20 74 68 65 69 72 | number |of their|
|00003be0| 20 6f 77 6e 20 69 6d 70 | 6c 69 63 69 74 0a 20 20 | own imp|licit. |
|00003bf0| 20 63 6f 6e 76 65 72 73 | 69 6f 6e 20 6f 70 65 72 | convers|ion oper|
|00003c00| 61 74 6f 72 73 2c 20 77 | 68 69 63 68 20 62 61 73 |ators, w|hich bas|
|00003c10| 69 63 61 6c 6c 79 20 61 | 6c 6c 6f 77 73 20 74 68 |ically a|llows th|
|00003c20| 65 20 75 73 65 72 20 74 | 6f 20 22 77 65 61 6b 65 |e user t|o "weake|
|00003c30| 6e 22 20 74 68 65 0a 20 | 20 20 74 79 70 65 20 73 |n" the. | type s|
|00003c40| 79 73 74 65 6d 20 61 73 | 20 74 68 65 79 20 73 65 |ystem as| they se|
|00003c50| 65 20 66 69 74 2e 0a 0a | 20 20 20 4f 66 20 63 6f |e fit...| Of co|
|00003c60| 75 72 73 65 2c 20 61 6c | 6c 20 6f 66 20 74 68 69 |urse, al|l of thi|
|00003c70| 73 20 69 6d 70 6c 69 63 | 69 74 20 63 6f 6e 76 65 |s implic|it conve|
|00003c80| 72 73 69 6f 6e 20 73 65 | 72 76 65 73 20 61 20 70 |rsion se|rves a p|
|00003c90| 75 72 70 6f 73 65 2c 20 | 62 75 74 20 69 74 0a 20 |urpose, |but it. |
|00003ca0| 20 20 64 6f 65 73 20 74 | 65 6e 64 20 74 6f 20 6d | does t|end to m|
|00003cb0| 6f 76 65 20 43 2f 43 2b | 2b 20 74 6f 77 61 72 64 |ove C/C+|+ toward|
|00003cc0| 20 74 68 65 20 22 77 65 | 61 6b 65 72 22 20 65 6e | the "we|aker" en|
|00003cd0| 64 20 6f 66 20 74 68 65 | 20 77 65 61 6b 20 76 73 |d of the| weak vs|
|00003ce0| 2e 20 73 74 72 6f 6e 67 | 0a 20 20 20 74 79 70 69 |. strong|. typi|
|00003cf0| 6e 67 20 73 70 65 63 74 | 72 75 6d 2e 0a 0a 20 20 |ng spect|rum... |
|00003d00| 20 4e 6f 74 65 20 74 68 | 61 74 20 74 68 65 20 22 | Note th|at the "|
|00003d10| 73 74 72 6f 6e 67 22 20 | 64 69 73 74 69 6e 63 74 |strong" |distinct|
|00003d20| 69 6f 6e 73 20 62 65 74 | 77 65 65 6e 20 69 6e 74 |ions bet|ween int|
|00003d30| 65 67 65 72 20 74 79 70 | 65 73 20 68 65 6c 70 73 |eger typ|es helps|
|00003d40| 0a 20 20 20 64 72 61 6d | 61 74 69 63 61 6c 6c 79 |. dram|atically|
|00003d50| 20 69 6e 20 63 61 74 63 | 68 69 6e 67 20 28 61 74 | in catc|hing (at|
|00003d60| 20 63 6f 6d 70 69 6c 65 | 2d 74 69 6d 65 29 20 61 | compile|-time) a|
|00003d70| 72 72 61 79 20 69 6e 64 | 65 78 69 6e 67 20 65 72 |rray ind|exing er|
|00003d80| 72 6f 72 73 20 69 6e 0a | 20 20 20 41 64 61 20 70 |rors in.| Ada p|
|00003d90| 72 6f 67 72 61 6d 73 2c | 20 62 79 20 6d 61 6b 69 |rograms,| by maki|
|00003da0| 6e 67 20 73 75 72 65 20 | 74 68 61 74 20 69 66 20 |ng sure |that if |
|00003db0| 79 6f 75 20 68 61 76 65 | 20 61 6e 20 61 72 72 61 |you have| an arra|
|00003dc0| 79 20 69 6e 64 65 78 65 | 64 20 62 79 20 61 0a 20 |y indexe|d by a. |
|00003dd0| 20 20 63 6f 75 6e 74 20 | 6f 66 20 61 70 70 6c 65 | count |of apple|
|00003de0| 73 2c 20 79 6f 75 20 64 | 6f 6e 27 74 20 69 6e 64 |s, you d|on't ind|
|00003df0| 65 78 20 69 6e 74 6f 20 | 69 74 20 77 69 74 68 20 |ex into |it with |
|00003e00| 61 20 63 6f 75 6e 74 20 | 6f 66 20 6f 72 61 6e 67 |a count |of orang|
|00003e10| 65 73 0a 20 20 20 28 77 | 69 74 68 6f 75 74 20 61 |es. (w|ithout a|
|00003e20| 6e 20 2a 65 78 70 6c 69 | 63 69 74 2a 20 63 6f 6e |n *expli|cit* con|
|00003e30| 76 65 72 73 69 6f 6e 29 | 2e 20 54 68 65 20 61 64 |version)|. The ad|
|00003e40| 76 61 6e 74 61 67 65 73 | 20 6f 66 20 22 73 74 72 |vantages| of "str|
|00003e50| 6f 6e 67 6c 79 22 0a 20 | 20 20 64 69 73 74 69 6e |ongly". | distin|
|00003e60| 67 75 69 73 68 69 6e 67 | 20 65 6e 75 6d 65 72 61 |guishing| enumera|
|00003e70| 74 69 6f 6e 20 74 79 70 | 65 73 20 69 73 20 65 76 |tion typ|es is ev|
|00003e80| 65 6e 20 6d 6f 72 65 20 | 6f 62 76 69 6f 75 73 20 |en more |obvious |
|00003e90| 28 61 6e 64 20 74 68 65 | 0a 20 20 20 64 65 73 69 |(and the|. desi|
|00003ea0| 67 6e 65 72 73 20 6f 66 | 20 43 2b 2b 20 72 65 63 |gners of| C++ rec|
|00003eb0| 6f 67 6e 69 7a 65 64 20 | 74 68 69 73 29 2e 0a 0a |ognized |this)...|
|00003ec0| 20 20 20 54 68 65 20 73 | 74 72 6f 6e 67 20 64 69 | The s|trong di|
|00003ed0| 73 74 69 6e 63 74 69 6f | 6e 73 20 62 65 74 77 65 |stinctio|ns betwe|
|00003ee0| 65 6e 20 61 63 63 65 73 | 73 20 74 79 70 65 73 20 |en acces|s types |
|00003ef0| 28 70 6f 69 6e 74 65 72 | 20 74 79 70 65 73 29 20 |(pointer| types) |
|00003f00| 69 6e 20 41 64 61 0a 20 | 20 20 61 6c 73 6f 20 68 |in Ada. | also h|
|00003f10| 61 73 20 61 64 76 61 6e | 74 61 67 65 73 2c 20 61 |as advan|tages, a|
|00003f20| 6c 6c 6f 77 69 6e 67 20 | 61 63 63 65 73 73 20 74 |llowing |access t|
|00003f30| 79 70 65 73 20 74 6f 20 | 62 65 20 72 65 70 72 65 |ypes to |be repre|
|00003f40| 73 65 6e 74 65 64 20 61 | 73 0a 20 20 20 6f 66 66 |sented a|s. off|
|00003f50| 73 65 74 73 20 77 69 74 | 68 69 6e 20 74 68 65 69 |sets wit|hin thei|
|00003f60| 72 20 73 74 6f 72 61 67 | 65 20 70 6f 6f 6c 20 72 |r storag|e pool r|
|00003f70| 61 74 68 65 72 20 74 68 | 61 6e 20 61 73 20 61 64 |ather th|an as ad|
|00003f80| 64 72 65 73 73 65 73 2c | 20 61 6e 64 20 67 69 76 |dresses,| and giv|
|00003f90| 69 6e 67 0a 20 20 20 6d | 6f 72 65 20 68 69 67 68 |ing. m|ore high|
|00003fa0| 2d 6c 65 76 65 6c 20 63 | 6f 6e 74 72 6f 6c 20 6f |-level c|ontrol o|
|00003fb0| 76 65 72 20 73 74 6f 72 | 61 67 65 20 6d 61 6e 61 |ver stor|age mana|
|00003fc0| 67 65 6d 65 6e 74 2e 0a | 0a 20 20 20 53 74 72 6f |gement..|. Stro|
|00003fd0| 6e 67 20 74 79 70 69 6e | 67 20 63 61 6e 20 62 65 |ng typin|g can be|
|00003fe0| 20 63 61 72 72 69 65 64 | 20 74 6f 6f 20 66 61 72 | carried| too far|
|00003ff0| 2c 20 61 6e 64 20 73 6f | 6d 65 20 61 6d 6f 75 6e |, and so|me amoun|
|00004000| 74 20 6f 66 20 69 6d 70 | 6c 69 63 69 74 0a 20 20 |t of imp|licit. |
|00004010| 20 63 6f 6e 76 65 72 73 | 69 6f 6e 20 69 73 20 65 | convers|ion is e|
|00004020| 73 73 65 6e 74 69 61 6c | 20 74 6f 20 6d 61 6b 65 |ssential| to make|
|00004030| 20 4f 4f 50 20 70 61 6c | 61 74 61 62 6c 65 2e 20 | OOP pal|atable. |
|00004040| 42 75 74 20 6e 6f 74 65 | 20 74 68 61 74 20 69 6e |But note| that in|
|00004050| 20 41 64 61 0a 20 20 20 | 39 58 2c 20 65 76 65 6e | Ada. |9X, even|
|00004060| 20 77 69 74 68 20 4f 4f | 50 2c 20 77 65 20 64 6f | with OO|P, we do|
|00004070| 6e 27 74 20 61 6c 6c 6f | 77 20 69 6d 70 6c 69 63 |n't allo|w implic|
|00004080| 69 74 20 63 6f 6e 76 65 | 72 73 69 6f 6e 73 20 74 |it conve|rsions t|
|00004090| 68 61 74 20 74 72 75 6e | 63 61 74 65 0a 20 20 20 |hat trun|cate. |
|000040a0| 74 68 65 20 65 78 74 65 | 6e 73 69 6f 6e 20 70 61 |the exte|nsion pa|
|000040b0| 72 74 20 6f 66 20 61 20 | 72 65 63 6f 72 64 20 28 |rt of a |record (|
|000040c0| 74 68 69 73 20 69 73 20 | 61 20 72 65 6c 61 74 69 |this is |a relati|
|000040d0| 76 65 6c 79 20 63 6f 6d | 6d 6f 6e 20 6d 69 73 74 |vely com|mon mist|
|000040e0| 61 6b 65 20 69 6e 0a 20 | 20 20 43 2b 2b 20 77 68 |ake in. | C++ wh|
|000040f0| 65 6e 20 70 61 73 73 69 | 6e 67 20 70 61 72 61 6d |en passi|ng param|
|00004100| 65 74 65 72 73 20 62 79 | 20 76 61 6c 75 65 29 2e |eters by| value).|
|00004110| 20 49 6e 73 74 65 61 64 | 2c 20 69 6e 20 41 64 61 | Instead|, in Ada|
|00004120| 20 39 58 2c 20 74 68 65 | 0a 20 20 20 6c 61 6e 67 | 9X, the|. lang|
|00004130| 75 61 67 65 20 64 69 73 | 74 69 6e 67 75 69 73 68 |uage dis|tinguish|
|00004140| 65 73 20 62 65 74 77 65 | 65 6e 20 61 20 73 70 65 |es betwe|en a spe|
|00004150| 63 69 66 69 63 20 74 79 | 70 65 20 54 20 61 6e 64 |cific ty|pe T and|
|00004160| 20 74 68 65 20 63 6c 61 | 73 73 2d 77 69 64 65 0a | the cla|ss-wide.|
|00004170| 20 20 20 74 79 70 65 20 | 54 27 43 6c 61 73 73 2c | type |T'Class,|
|00004180| 20 61 6e 64 20 61 6c 6c | 6f 77 73 20 69 6d 70 6c | and all|ows impl|
|00004190| 69 63 69 74 20 63 6f 6e | 76 65 72 73 69 6f 6e 73 |icit con|versions|
|000041a0| 20 74 6f 20 54 27 43 6c | 61 73 73 20 66 72 6f 6d | to T'Cl|ass from|
|000041b0| 20 54 20 6f 72 20 61 6e | 79 0a 20 20 20 6f 66 20 | T or an|y. of |
|000041c0| 69 74 73 20 64 65 72 69 | 76 61 74 69 76 65 73 2c |its deri|vatives,|
|000041d0| 20 62 75 74 20 6e 6f 74 | 20 74 6f 20 74 68 65 20 | but not| to the |
|000041e0| 73 70 65 63 69 66 69 63 | 20 74 79 70 65 20 54 2e |specific| type T.|
|000041f0| 20 43 6f 6e 76 65 72 73 | 69 6f 6e 73 20 74 6f 20 | Convers|ions to |
|00004200| 74 68 65 0a 20 20 20 63 | 6c 61 73 73 2d 77 69 64 |the. c|lass-wid|
|00004210| 65 20 74 79 70 65 20 6e | 65 76 65 72 20 69 6d 70 |e type n|ever imp|
|00004220| 6c 69 63 69 74 6c 79 20 | 74 72 75 6e 63 61 74 65 |licitly |truncate|
|00004230| 20 74 68 65 20 65 78 74 | 65 6e 73 69 6f 6e 20 70 | the ext|ension p|
|00004240| 61 72 74 2e 0a 20 20 20 | 43 6f 6e 76 65 72 73 69 |art.. |Conversi|
|00004250| 6f 6e 73 20 74 6f 20 61 | 20 73 70 65 63 69 66 69 |ons to a| specifi|
|00004260| 63 20 74 79 70 65 20 63 | 61 6e 20 74 72 75 6e 63 |c type c|an trunc|
|00004270| 61 74 65 2c 20 61 6e 64 | 20 68 65 6e 63 65 20 6d |ate, and| hence m|
|00004280| 75 73 74 20 62 65 0a 20 | 20 20 65 78 70 6c 69 63 |ust be. | explic|
|00004290| 69 74 2e 0a 0a 20 20 20 | 4e 6f 74 65 20 61 6c 73 |it... |Note als|
|000042a0| 6f 20 74 68 61 74 20 69 | 6e 20 41 64 61 20 74 68 |o that i|n Ada th|
|000042b0| 65 72 65 20 61 72 65 20 | 74 68 72 65 65 20 64 69 |ere are |three di|
|000042c0| 73 74 69 6e 63 74 20 6b | 69 6e 64 73 20 6f 66 20 |stinct k|inds of |
|000042d0| 63 6f 6e 76 65 72 73 69 | 6f 6e 73 2c 0a 20 20 20 |conversi|ons,. |
|000042e0| 69 6d 70 6c 69 63 69 74 | 20 6f 6e 65 73 2c 20 65 |implicit| ones, e|
|000042f0| 78 70 6c 69 63 69 74 20 | 6f 6e 65 73 2c 20 61 6e |xplicit |ones, an|
|00004300| 64 20 75 6e 63 68 65 63 | 6b 65 64 20 6f 6e 65 73 |d unchec|ked ones|
|00004310| 2e 20 4f 6e 6c 79 20 74 | 68 65 20 75 6e 63 68 65 |. Only t|he unche|
|00004320| 63 6b 65 64 0a 20 20 20 | 6f 6e 65 73 20 61 72 65 |cked. |ones are|
|00004330| 20 70 6f 74 65 6e 74 69 | 61 6c 6c 79 20 75 6e 73 | potenti|ally uns|
|00004340| 61 66 65 2e 20 54 68 65 | 20 65 78 70 6c 69 63 69 |afe. The| explici|
|00004350| 74 20 6f 6e 65 73 20 61 | 72 65 20 73 61 66 65 2c |t ones a|re safe,|
|00004360| 20 77 69 74 68 20 65 69 | 74 68 65 72 0a 20 20 20 | with ei|ther. |
|00004370| 63 6f 6d 70 69 6c 65 2d | 74 69 6d 65 20 6f 72 20 |compile-|time or |
|00004380| 72 75 6e 2d 74 69 6d 65 | 20 63 68 65 63 6b 73 20 |run-time| checks |
|00004390| 74 6f 20 65 6e 73 75 72 | 65 20 74 68 61 74 2e 20 |to ensur|e that. |
|000043a0| 49 6e 20 43 20 74 68 65 | 72 65 20 61 72 65 20 6f |In C the|re are o|
|000043b0| 6e 6c 79 0a 20 20 20 69 | 6d 70 6c 69 63 69 74 20 |nly. i|mplicit |
|000043c0| 61 6e 64 20 65 78 70 6c | 69 63 69 74 2f 75 6e 63 |and expl|icit/unc|
|000043d0| 68 65 63 6b 65 64 20 63 | 6f 6e 76 65 72 73 69 6f |hecked c|onversio|
|000043e0| 6e 73 2e 20 43 2b 2b 20 | 68 61 73 20 72 65 63 65 |ns. C++ |has rece|
|000043f0| 6e 74 6c 79 20 61 64 64 | 65 64 20 61 0a 20 20 20 |ntly add|ed a. |
|00004400| 63 68 65 63 6b 65 64 2c | 20 65 78 70 6c 69 63 69 |checked,| explici|
|00004410| 74 20 22 64 79 6e 61 6d | 69 63 22 20 63 61 73 74 |t "dynam|ic" cast|
|00004420| 2c 20 62 75 74 20 73 74 | 69 6c 6c 20 69 74 20 77 |, but st|ill it w|
|00004430| 69 6c 6c 20 62 65 20 63 | 6f 6d 6d 6f 6e 20 74 6f |ill be c|ommon to|
|00004440| 20 75 73 65 0a 20 20 20 | 22 6e 6f 72 6d 61 6c 22 | use. |"normal"|
|00004450| 20 65 78 70 6c 69 63 69 | 74 20 63 61 73 74 73 20 | explici|t casts |
|00004460| 66 6f 72 20 62 6f 74 68 | 20 63 68 65 63 6b 65 64 |for both| checked|
|00004470| 20 61 6e 64 20 75 6e 63 | 68 65 63 6b 65 64 20 63 | and unc|hecked c|
|00004480| 6f 6e 76 65 72 73 69 6f | 6e 73 2c 0a 20 20 20 74 |onversio|ns,. t|
|00004490| 68 65 72 65 62 79 20 6d | 61 6b 69 6e 67 20 69 74 |hereby m|aking it|
|000044a0| 20 6d 6f 72 65 20 64 69 | 66 66 69 63 75 6c 74 20 | more di|fficult |
|000044b0| 74 6f 20 69 64 65 6e 74 | 69 66 79 20 70 6c 61 63 |to ident|ify plac|
|000044c0| 65 73 20 77 68 65 72 65 | 20 74 68 65 20 74 79 70 |es where| the typ|
|000044d0| 65 0a 20 20 20 73 79 73 | 74 65 6d 20 6d 69 67 68 |e. sys|tem migh|
|000044e0| 74 20 62 65 20 63 6f 6d | 70 72 6f 6d 69 73 65 64 |t be com|promised|
|000044f0| 2e 0a 0a 20 20 20 48 65 | 6e 63 65 2c 20 74 68 65 |... He|nce, the|
|00004500| 20 62 6f 74 74 6f 6d 20 | 6c 69 6e 65 20 69 73 20 | bottom |line is |
|00004510| 74 68 61 74 20 74 68 65 | 20 74 79 70 65 20 63 68 |that the| type ch|
|00004520| 65 63 6b 69 6e 67 20 69 | 73 20 28 6f 62 6a 65 63 |ecking i|s (objec|
|00004530| 74 69 76 65 6c 79 29 0a | 20 20 20 22 73 74 72 6f |tively).| "stro|
|00004540| 6e 67 65 72 22 20 69 6e | 20 41 64 61 20 74 68 61 |nger" in| Ada tha|
|00004550| 6e 20 43 2f 43 2b 2b 2c | 20 74 68 6f 75 67 68 20 |n C/C++,| though |
|00004560| 74 68 61 74 20 64 6f 65 | 73 6e 27 74 20 6e 65 63 |that doe|sn't nec|
|00004570| 65 73 73 61 72 69 6c 79 | 20 6d 65 61 6e 0a 20 20 |essarily| mean. |
|00004580| 20 22 62 65 74 74 65 72 | 22 20 2d 2d 20 77 68 65 | "better|" -- whe|
|00004590| 74 68 65 72 20 6f 6e 65 | 20 69 73 20 22 62 65 74 |ther one| is "bet|
|000045a0| 74 65 72 22 20 66 6f 72 | 20 61 20 70 61 72 74 69 |ter" for| a parti|
|000045b0| 63 75 6c 61 72 20 73 74 | 79 6c 65 20 6f 66 0a 20 |cular st|yle of. |
|000045c0| 20 20 70 72 6f 67 72 61 | 6d 6d 69 6e 67 20 74 68 | progra|mming th|
|000045d0| 61 6e 20 74 68 65 20 6f | 74 68 65 72 20 69 73 20 |an the o|ther is |
|000045e0| 61 20 22 72 65 6c 69 67 | 69 6f 75 73 22 20 69 73 |a "relig|ious" is|
|000045f0| 73 75 65 20 49 4d 48 4f | 2e 20 49 20 6b 6e 6f 77 |sue IMHO|. I know|
|00004600| 20 6d 79 0a 20 20 20 72 | 65 6c 69 67 69 6f 6e 20 | my. r|eligion |
|00004610| 63 75 72 72 65 6e 74 6c | 79 20 66 61 76 6f 72 73 |currentl|y favors|
|00004620| 20 74 68 65 20 73 74 72 | 6f 6e 67 65 72 20 63 68 | the str|onger ch|
|00004630| 65 63 6b 69 6e 67 20 6f | 66 20 41 64 61 20 69 6e |ecking o|f Ada in|
|00004640| 20 6d 6f 73 74 20 63 61 | 73 65 73 0a 20 20 20 5b | most ca|ses. [|
|00004650| 65 78 63 65 70 74 20 70 | 65 72 68 61 70 73 20 66 |except p|erhaps f|
|00004660| 6f 72 20 6d 75 6c 74 69 | 70 6c 79 2f 64 69 76 69 |or multi|ply/divi|
|00004670| 64 65 2c 20 77 68 65 72 | 65 20 49 20 70 65 72 73 |de, wher|e I pers|
|00004680| 6f 6e 61 6c 6c 79 20 62 | 65 6c 69 65 76 65 20 74 |onally b|elieve t|
|00004690| 68 65 0a 20 20 20 63 68 | 65 63 6b 69 6e 67 20 73 |he. ch|ecking s|
|000046a0| 68 6f 75 6c 64 20 65 69 | 74 68 65 72 20 62 65 20 |hould ei|ther be |
|000046b0| 77 65 61 6b 65 72 2c 20 | 6f 72 20 64 69 72 65 63 |weaker, |or direc|
|000046c0| 74 6c 79 20 73 75 70 70 | 6f 72 74 20 74 68 65 20 |tly supp|ort the |
|000046d0| 63 6f 6e 63 65 70 74 20 | 6f 66 0a 20 20 20 22 75 |concept |of. "u|
|000046e0| 6e 69 74 73 22 2f 22 64 | 69 6d 65 6e 73 69 6f 6e |nits"/"d|imension|
|000046f0| 73 22 5d 2e 0a 0a 0a 39 | 2e 37 3a 20 49 27 6d 20 |s"]....9|.7: I'm |
|00004700| 74 6f 6c 64 20 41 64 61 | 20 64 6f 65 73 20 61 6c |told Ada| does al|
|00004710| 6c 20 73 6f 72 74 73 20 | 6f 66 20 73 74 61 74 69 |l sorts |of stati|
|00004720| 63 20 74 79 70 65 20 63 | 68 65 63 6b 69 6e 67 2c |c type c|hecking,|
|00004730| 20 62 75 74 20 63 61 6e | 27 74 20 79 6f 75 20 67 | but can|'t you g|
|00004740| 65 74 0a 74 68 65 20 73 | 61 6d 65 20 65 66 66 65 |et.the s|ame effe|
|00004750| 63 74 20 75 73 69 6e 67 | 20 61 20 74 6f 6f 6c 20 |ct using| a tool |
|00004760| 6c 69 6b 65 20 22 6c 69 | 6e 74 22 20 77 69 74 68 |like "li|nt" with|
|00004770| 20 43 3f 0a 0a 20 20 20 | 4e 6f 2c 20 68 65 72 65 | C?.. |No, here|
|00004780| 20 61 72 65 20 61 20 66 | 65 77 20 72 65 61 73 6f | are a f|ew reaso|
|00004790| 6e 73 20 77 68 79 20 28 | 74 68 69 73 20 6c 69 73 |ns why (|this lis|
|000047a0| 74 20 69 73 20 62 79 20 | 6e 6f 20 6d 65 61 6e 73 |t is by |no means|
|000047b0| 20 63 6f 6d 70 6c 65 74 | 65 29 3a 0a 0a 20 20 20 | complet|e):.. |
|000047c0| 28 53 75 62 6d 69 74 74 | 65 64 20 62 79 20 4e 6f |(Submitt|ed by No|
|000047d0| 72 6d 20 43 6f 68 65 6e | 29 0a 20 20 20 20 20 2a |rm Cohen|). *|
|000047e0| 20 52 75 6e 6e 69 6e 67 | 20 62 6f 74 68 20 4c 69 | Running| both Li|
|000047f0| 6e 74 20 61 6e 64 20 61 | 20 43 20 63 6f 6d 70 69 |nt and a| C compi|
|00004800| 6c 65 72 20 72 65 71 75 | 69 72 65 73 20 74 68 65 |ler requ|ires the|
|00004810| 20 70 72 6f 67 72 61 6d | 20 74 65 78 74 20 74 6f | program| text to|
|00004820| 20 62 65 0a 20 20 20 20 | 20 20 20 70 61 72 73 65 | be. | parse|
|00004830| 64 20 61 6e 64 20 73 65 | 6d 61 6e 74 69 63 61 6c |d and se|mantical|
|00004840| 6c 79 20 61 6e 61 6c 79 | 7a 65 64 20 74 77 69 63 |ly analy|zed twic|
|00004850| 65 2e 20 54 68 65 20 72 | 65 73 75 6c 74 73 20 6f |e. The r|esults o|
|00004860| 66 20 61 6e 20 41 64 61 | 0a 20 20 20 20 20 20 20 |f an Ada|. |
|00004870| 63 6f 6d 70 69 6c 65 72 | 27 73 20 70 61 72 73 65 |compiler|'s parse|
|00004880| 20 61 6e 64 20 73 65 6d | 61 6e 74 69 63 20 61 6e | and sem|antic an|
|00004890| 61 6c 79 73 69 73 20 61 | 72 65 20 75 73 65 64 20 |alysis a|re used |
|000048a0| 64 69 72 65 63 74 6c 79 | 20 69 6e 0a 20 20 20 20 |directly| in. |
|000048b0| 20 20 20 70 65 72 66 6f | 72 6d 69 6e 67 20 63 6f | perfo|rming co|
|000048c0| 6e 73 69 73 74 65 6e 63 | 79 20 63 68 65 63 6b 73 |nsistenc|y checks|
|000048d0| 2e 0a 0a 20 20 20 20 20 | 2a 20 54 68 65 20 72 75 |... |* The ru|
|000048e0| 6c 65 73 20 6f 66 20 41 | 64 61 20 70 72 6f 76 69 |les of A|da provi|
|000048f0| 64 65 20 74 68 65 20 6f | 70 70 6f 72 74 75 6e 69 |de the o|pportuni|
|00004900| 74 79 20 66 6f 72 20 73 | 74 72 6f 6e 67 65 72 20 |ty for s|tronger |
|00004910| 63 6f 6e 73 69 73 74 65 | 6e 63 79 0a 20 20 20 20 |consiste|ncy. |
|00004920| 20 20 20 63 68 65 63 6b | 73 20 74 68 61 6e 20 61 | check|s than a|
|00004930| 72 65 20 70 6f 73 73 69 | 62 6c 65 20 77 69 74 68 |re possi|ble with|
|00004940| 20 43 2e 20 46 6f 72 20 | 65 78 61 6d 70 6c 65 2c | C. For |example,|
|00004950| 20 61 6e 20 41 64 61 20 | 70 72 6f 67 72 61 6d 6d | an Ada |programm|
|00004960| 65 72 0a 20 20 20 20 20 | 20 20 63 61 6e 20 64 65 |er. | can de|
|00004970| 63 6c 61 72 65 20 64 69 | 73 74 69 6e 63 74 20 69 |clare di|stinct i|
|00004980| 6e 74 65 67 65 72 20 74 | 79 70 65 73 20 74 6f 20 |nteger t|ypes to |
|00004990| 72 65 70 72 65 73 65 6e | 74 20 64 69 73 74 69 6e |represen|t distin|
|000049a0| 63 74 0a 20 20 20 20 20 | 20 20 61 62 73 74 72 61 |ct. | abstra|
|000049b0| 63 74 69 6f 6e 73 2e 20 | 41 6e 20 41 64 61 20 63 |ctions. |An Ada c|
|000049c0| 6f 6d 70 69 6c 65 72 20 | 77 69 6c 6c 20 63 61 74 |ompiler |will cat|
|000049d0| 63 68 20 61 6e 20 69 6e | 61 64 76 65 72 74 65 6e |ch an in|adverten|
|000049e0| 74 0a 20 20 20 20 20 20 | 20 69 6e 74 65 72 6d 69 |t. | intermi|
|000049f0| 78 69 6e 67 20 6f 66 20 | 74 68 65 73 65 20 74 77 |xing of |these tw|
|00004a00| 6f 20 74 79 70 65 73 2c | 20 62 75 74 20 74 68 65 |o types,| but the|
|00004a10| 72 65 20 69 73 20 6e 6f | 20 77 61 79 20 61 0a 20 |re is no| way a. |
|00004a20| 20 20 20 20 20 20 63 6f | 72 72 65 73 70 6f 6e 64 | co|rrespond|
|00004a30| 69 6e 67 20 64 69 73 74 | 69 6e 63 74 69 6f 6e 20 |ing dist|inction |
|00004a40| 63 61 6e 20 62 65 20 6d | 61 64 65 20 69 6e 20 43 |can be m|ade in C|
|00004a50| 2c 20 73 6f 20 74 68 65 | 72 65 20 69 73 20 6e 6f |, so the|re is no|
|00004a60| 20 77 61 79 20 66 6f 72 | 0a 20 20 20 20 20 20 20 | way for|. |
|00004a70| 4c 69 6e 74 20 74 6f 20 | 70 65 72 66 6f 72 6d 20 |Lint to |perform |
|00004a80| 61 20 63 6f 72 72 65 73 | 70 6f 6e 64 69 6e 67 20 |a corres|ponding |
|00004a90| 63 68 65 63 6b 2e 20 53 | 69 6d 69 6c 61 72 6c 79 |check. S|imilarly|
|00004aa0| 2c 20 69 6e 20 43 2c 20 | 61 20 70 6f 69 6e 74 65 |, in C, |a pointe|
|00004ab0| 72 0a 20 20 20 20 20 20 | 20 74 6f 20 61 6e 20 6f |r. | to an o|
|00004ac0| 62 6a 65 63 74 20 6f 66 | 20 74 79 70 65 20 54 20 |bject of| type T |
|00004ad0| 69 73 20 69 6e 64 69 73 | 74 69 6e 67 75 69 73 68 |is indis|tinguish|
|00004ae0| 61 62 6c 65 20 66 72 6f | 6d 20 61 6e 20 61 72 72 |able fro|m an arr|
|00004af0| 61 79 20 6f 66 0a 20 20 | 20 20 20 20 20 6f 62 6a |ay of. | obj|
|00004b00| 65 63 74 73 20 6f 66 20 | 74 79 70 65 20 54 2e 0a |ects of |type T..|
|00004b10| 0a 20 20 20 20 20 2a 20 | 54 68 65 20 72 75 6c 65 |. * |The rule|
|00004b20| 73 20 6f 66 20 74 68 65 | 20 41 64 61 20 6c 61 6e |s of the| Ada lan|
|00004b30| 67 75 61 67 65 20 65 6e | 73 75 72 65 20 74 68 61 |guage en|sure tha|
|00004b40| 74 20 74 68 65 20 70 72 | 6f 67 72 61 6d 20 74 65 |t the pr|ogram te|
|00004b50| 78 74 0a 20 20 20 20 20 | 20 20 70 72 6f 76 69 64 |xt. | provid|
|00004b60| 65 73 20 69 6e 66 6f 72 | 6d 61 74 69 6f 6e 20 61 |es infor|mation a|
|00004b70| 6c 6c 6f 77 69 6e 67 20 | 50 52 45 43 49 53 45 20 |llowing |PRECISE |
|00004b80| 63 6f 6e 73 69 73 74 65 | 6e 63 79 20 63 68 65 63 |consiste|ncy chec|
|00004b90| 6b 73 2e 20 46 6f 72 0a | 20 20 20 20 20 20 20 65 |ks. For.| e|
|00004ba0| 78 61 6d 70 6c 65 2c 20 | 74 68 65 20 65 78 70 72 |xample, |the expr|
|00004bb0| 65 73 73 69 6f 6e 20 69 | 6e 20 61 6e 20 41 64 61 |ession i|n an Ada|
|00004bc0| 20 63 61 73 65 20 73 74 | 61 74 65 6d 65 6e 74 20 | case st|atement |
|00004bd0| 63 61 6e 20 62 65 20 77 | 72 69 74 74 65 6e 20 74 |can be w|ritten t|
|00004be0| 6f 0a 20 20 20 20 20 20 | 20 68 61 76 65 20 61 20 |o. | have a |
|00004bf0| 73 74 61 74 69 63 20 73 | 75 62 74 79 70 65 2c 20 |static s|ubtype, |
|00004c00| 61 6c 6c 6f 77 69 6e 67 | 20 74 68 65 20 63 6f 6d |allowing| the com|
|00004c10| 70 69 6c 65 72 20 74 6f | 20 61 73 63 65 72 74 61 |piler to| ascerta|
|00004c20| 69 6e 20 74 68 61 74 20 | 61 6c 6c 0a 20 20 20 20 |in that |all. |
|00004c30| 20 20 20 70 6f 73 73 69 | 62 6c 65 20 76 61 6c 75 | possi|ble valu|
|00004c40| 65 73 20 68 61 76 65 20 | 62 65 65 6e 20 63 6f 76 |es have |been cov|
|00004c50| 65 72 65 64 20 77 69 74 | 68 6f 75 74 20 72 65 73 |ered wit|hout res|
|00004c60| 6f 72 74 69 6e 67 20 74 | 6f 20 61 20 64 65 66 61 |orting t|o a defa|
|00004c70| 75 6c 74 0a 20 20 20 20 | 20 20 20 28 77 68 65 6e |ult. | (when|
|00004c80| 20 6f 74 68 65 72 73 29 | 20 61 72 6d 2e 0a 0a 20 | others)| arm... |
|00004c90| 20 20 20 20 2a 20 57 69 | 74 68 20 6c 61 63 6b 20 | * Wi|th lack |
|00004ca0| 6f 66 20 70 72 65 63 69 | 73 65 20 69 6e 66 6f 72 |of preci|se infor|
|00004cb0| 6d 61 74 69 6f 6e 2c 20 | 4c 69 6e 74 20 68 61 73 |mation, |Lint has|
|00004cc0| 20 6e 6f 20 63 68 6f 69 | 63 65 20 62 75 74 20 74 | no choi|ce but t|
|00004cd0| 6f 20 62 65 0a 20 20 20 | 20 20 20 20 6f 76 65 72 |o be. | over|
|00004ce0| 6c 79 20 70 65 73 73 69 | 6d 69 73 74 69 63 20 6f |ly pessi|mistic o|
|00004cf0| 72 2c 20 77 69 74 68 20 | 64 69 66 66 65 72 65 6e |r, with |differen|
|00004d00| 74 20 73 65 74 74 69 6e | 67 73 20 66 6f 72 20 61 |t settin|gs for a|
|00004d10| 20 63 6f 6d 70 6c 69 63 | 61 74 65 64 0a 20 20 20 | complic|ated. |
|00004d20| 20 20 20 20 73 65 74 20 | 6f 66 20 6f 70 74 69 6f | set |of optio|
|00004d30| 6e 73 2c 20 6f 76 65 72 | 6c 79 20 6f 70 74 69 6d |ns, over|ly optim|
|00004d40| 69 73 74 69 63 2e 20 57 | 68 65 6e 20 69 74 20 69 |istic. W|hen it i|
|00004d50| 73 20 6f 76 65 72 6c 79 | 20 70 65 73 73 69 6d 69 |s overly| pessimi|
|00004d60| 73 74 69 63 2c 0a 20 20 | 20 20 20 20 20 74 68 65 |stic,. | the|
|00004d70| 20 75 73 65 72 20 73 65 | 65 73 20 74 6f 6f 20 6d | user se|es too m|
|00004d80| 61 6e 79 20 22 66 61 6c | 73 65 20 61 6c 61 72 6d |any "fal|se alarm|
|00004d90| 73 22 20 61 6e 64 20 6d | 61 79 20 65 6e 64 20 75 |s" and m|ay end u|
|00004da0| 70 20 69 67 6e 6f 72 69 | 6e 67 0a 20 20 20 20 20 |p ignori|ng. |
|00004db0| 20 20 76 61 6c 69 64 20 | 77 61 72 6e 69 6e 67 73 | valid |warnings|
|00004dc0| 2e 20 57 68 65 6e 20 69 | 74 20 69 73 20 6f 76 65 |. When i|t is ove|
|00004dd0| 72 6c 79 20 6f 70 74 69 | 6d 69 73 74 69 63 2c 20 |rly opti|mistic, |
|00004de0| 4c 69 6e 74 20 6f 76 65 | 72 6c 6f 6f 6b 73 0a 20 |Lint ove|rlooks. |
|00004df0| 20 20 20 20 20 20 63 65 | 72 74 61 69 6e 20 65 72 | ce|rtain er|
|00004e00| 72 6f 72 73 2e 0a 0a 20 | 20 20 20 20 2a 20 49 74 |rors... | * It|
|00004e10| 20 69 73 20 69 6d 70 6f | 73 73 69 62 6c 65 20 74 | is impo|ssible t|
|00004e20| 6f 20 66 6f 72 67 65 74 | 20 74 6f 20 72 75 6e 20 |o forget| to run |
|00004e30| 63 6f 6e 73 69 73 74 65 | 6e 63 79 20 63 68 65 63 |consiste|ncy chec|
|00004e40| 6b 73 20 77 68 65 6e 20 | 75 73 69 6e 67 20 61 6e |ks when |using an|
|00004e50| 0a 20 20 20 20 20 20 20 | 41 64 61 20 63 6f 6d 70 |. |Ada comp|
|00004e60| 69 6c 65 72 2e 20 28 4f | 66 20 63 6f 75 72 73 65 |iler. (O|f course|
|00004e70| 20 61 20 43 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 | a C pro|gramming|
|00004e80| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 20 63 6f 75 | environ|ment cou|
|00004e90| 6c 64 20 62 65 20 73 65 | 74 0a 20 20 20 20 20 20 |ld be se|t. |
|00004ea0| 20 75 70 20 73 6f 20 74 | 68 61 74 20 74 68 65 20 | up so t|hat the |
|00004eb0| 43 20 63 6f 6d 70 69 6c | 65 72 20 63 6f 75 6c 64 |C compil|er could|
|00004ec0| 20 6f 6e 6c 79 20 62 65 | 20 69 6e 76 6f 6b 65 64 | only be| invoked|
|00004ed0| 20 66 72 6f 6d 20 61 20 | 73 63 72 69 70 74 20 74 | from a |script t|
|00004ee0| 68 61 74 0a 20 20 20 20 | 20 20 20 61 6c 73 6f 20 |hat. | also |
|00004ef0| 69 6e 76 6f 6b 65 73 20 | 4c 69 6e 74 2e 29 0a 0a |invokes |Lint.)..|
|00004f00| 20 20 20 20 20 2a 20 41 | 20 63 6f 6d 70 69 6c 61 | * A| compila|
|00004f10| 74 69 6f 6e 20 74 68 61 | 74 20 66 61 69 6c 73 20 |tion tha|t fails |
|00004f20| 41 64 61 20 63 6f 6e 73 | 69 73 74 65 6e 63 79 20 |Ada cons|istency |
|00004f30| 63 68 65 63 6b 73 20 69 | 73 20 72 65 6a 65 63 74 |checks i|s reject|
|00004f40| 65 64 2e 20 41 0a 20 20 | 20 20 20 20 20 63 6f 6d |ed. A. | com|
|00004f50| 70 69 6c 61 74 69 6f 6e | 20 74 68 61 74 20 66 61 |pilation| that fa|
|00004f60| 69 6c 73 20 4c 69 6e 74 | 20 63 6f 6e 73 69 73 74 |ils Lint| consist|
|00004f70| 65 6e 63 79 20 63 68 65 | 63 6b 73 20 6d 61 79 20 |ency che|cks may |
|00004f80| 73 74 69 6c 6c 20 62 65 | 0a 20 20 20 20 20 20 20 |still be|. |
|00004f90| 63 6f 6d 70 69 6c 65 64 | 2c 20 61 6e 64 20 69 74 |compiled|, and it|
|00004fa0| 73 20 6f 62 6a 65 63 74 | 20 66 69 6c 65 20 75 73 |s object| file us|
|00004fb0| 65 64 20 28 69 6e 74 65 | 6e 74 69 6f 6e 61 6c 6c |ed (inte|ntionall|
|00004fc0| 79 20 6f 72 20 61 63 63 | 69 64 65 6e 74 6c 79 29 |y or acc|idently)|
|00004fd0| 0a 20 20 20 20 20 20 20 | 69 6e 20 62 75 69 6c 64 |. |in build|
|00004fe0| 69 6e 67 20 74 68 65 20 | 73 79 73 74 65 6d 2e 20 |ing the |system. |
|00004ff0| 28 4f 6e 65 20 63 61 6e | 6e 6f 74 20 61 75 74 6f |(One can|not auto|
|00005000| 6d 61 74 65 20 74 68 65 | 20 72 65 6a 65 63 74 69 |mate the| rejecti|
|00005010| 6f 6e 20 6f 66 0a 20 20 | 20 20 20 20 20 70 72 6f |on of. | pro|
|00005020| 67 72 61 6d 73 20 74 68 | 61 74 20 66 61 69 6c 20 |grams th|at fail |
|00005030| 4c 69 6e 74 20 75 6e 6c | 65 73 73 20 6f 6e 65 20 |Lint unl|ess one |
|00005040| 69 73 20 63 65 72 74 61 | 69 6e 20 74 68 61 74 20 |is certa|in that |
|00005050| 74 68 65 72 65 20 77 69 | 6c 6c 0a 20 20 20 20 20 |there wi|ll. |
|00005060| 20 20 6e 65 76 65 72 20 | 62 65 20 61 6e 79 20 66 | never |be any f|
|00005070| 61 6c 73 65 20 77 61 72 | 6e 69 6e 67 73 2e 29 0a |alse war|nings.).|
|00005080| 0a 20 20 20 20 20 2a 20 | 41 64 61 20 65 6e 66 6f |. * |Ada enfo|
|00005090| 72 63 65 73 20 63 6f 6e | 73 69 73 74 65 6e 63 79 |rces con|sistency|
|000050a0| 20 61 6d 6f 6e 67 20 73 | 65 70 61 72 61 74 65 6c | among s|eparatel|
|000050b0| 79 20 63 6f 6d 70 69 6c | 65 64 20 75 6e 69 74 73 |y compil|ed units|
|000050c0| 2e 0a 0a 0a 20 20 20 4f | 66 20 63 6f 75 72 73 65 |.... O|f course|
|000050d0| 20 65 76 65 6e 20 73 74 | 72 6f 6e 67 65 72 20 61 | even st|ronger a|
|000050e0| 72 67 75 6d 65 6e 74 73 | 20 63 61 6e 20 62 65 20 |rguments| can be |
|000050f0| 6d 61 64 65 20 61 62 6f | 75 74 20 41 64 61 27 73 |made abo|ut Ada's|
|00005100| 20 52 55 4e 2d 54 49 4d | 45 0a 20 20 20 63 68 65 | RUN-TIM|E. che|
|00005110| 63 6b 73 20 28 77 68 69 | 63 68 20 63 61 6e 20 62 |cks (whi|ch can b|
|00005120| 65 20 75 73 65 64 20 77 | 69 74 68 20 6c 69 74 74 |e used w|ith litt|
|00005130| 6c 65 20 61 64 64 69 74 | 69 6f 6e 61 6c 20 6f 76 |le addit|ional ov|
|00005140| 65 72 68 65 61 64 20 62 | 65 63 61 75 73 65 20 74 |erhead b|ecause t|
|00005150| 68 65 0a 20 20 20 69 6e | 66 6f 72 6d 61 74 69 6f |he. in|formatio|
|00005160| 6e 20 63 6f 6e 74 61 69 | 6e 65 64 20 69 6e 20 61 |n contai|ned in a|
|00005170| 6e 20 41 64 61 20 70 72 | 6f 67 72 61 6d 20 61 6e |n Ada pr|ogram an|
|00005180| 64 20 74 68 65 20 6b 6e | 6f 77 6c 65 64 67 65 20 |d the kn|owledge |
|00005190| 74 68 61 74 20 74 68 65 | 0a 20 20 20 70 72 6f 67 |that the|. prog|
|000051a0| 72 61 6d 20 68 61 73 20 | 70 61 73 73 65 64 20 63 |ram has |passed c|
|000051b0| 6f 6d 70 69 6c 65 2d 74 | 69 6d 65 20 63 6f 6e 73 |ompile-t|ime cons|
|000051c0| 69 73 74 65 6e 63 79 20 | 63 68 65 63 6b 73 20 6d |istency |checks m|
|000051d0| 61 6b 65 20 69 74 20 70 | 6f 73 73 69 62 6c 65 20 |ake it p|ossible |
|000051e0| 74 6f 0a 20 20 20 6f 70 | 74 69 6d 69 7a 65 20 61 |to. op|timize a|
|000051f0| 77 61 79 20 74 68 65 20 | 6d 61 6a 6f 72 69 74 79 |way the |majority|
|00005200| 20 6f 66 20 74 68 65 20 | 63 68 65 63 6b 73 29 2e | of the |checks).|
|00005210| 20 54 68 65 73 65 20 63 | 68 65 63 6b 73 2c 20 77 | These c|hecks, w|
|00005220| 68 69 63 68 20 61 72 65 | 0a 20 20 20 61 62 73 65 |hich are|. abse|
|00005230| 6e 74 20 69 6e 20 43 2c | 20 74 65 6e 64 20 74 6f |nt in C,| tend to|
|00005240| 20 73 6d 6f 6b 65 20 6f | 75 74 20 65 72 72 6f 72 | smoke o|ut error|
|00005250| 73 20 65 61 72 6c 79 20 | 62 79 20 64 65 74 65 63 |s early |by detec|
|00005260| 74 69 6e 67 20 69 6e 74 | 65 72 6e 61 6c 0a 20 20 |ting int|ernal. |
|00005270| 20 69 6e 63 6f 6e 73 69 | 73 74 65 6e 63 69 65 73 | inconsi|stencies|
|00005280| 20 74 68 61 74 20 6d 69 | 67 68 74 20 6e 6f 74 20 | that mi|ght not |
|00005290| 6f 74 68 65 72 77 69 73 | 65 20 62 65 20 64 65 74 |otherwis|e be det|
|000052a0| 65 63 74 65 64 20 64 75 | 72 69 6e 67 20 74 65 73 |ected du|ring tes|
|000052b0| 74 69 6e 67 2e 0a 20 20 | 20 54 68 69 73 20 72 65 |ting.. | This re|
|000052c0| 64 75 63 65 73 20 74 68 | 65 20 6c 69 6b 65 6c 69 |duces th|e likeli|
|000052d0| 68 6f 6f 64 20 6f 66 20 | 66 69 65 6c 64 69 6e 67 |hood of |fielding|
|000052e0| 20 61 20 73 79 73 74 65 | 6d 20 74 68 61 74 20 61 | a syste|m that a|
|000052f0| 70 70 65 61 72 73 20 74 | 6f 20 77 6f 72 6b 0a 20 |ppears t|o work. |
|00005300| 20 20 77 65 6c 6c 20 64 | 75 72 69 6e 67 20 74 65 | well d|uring te|
|00005310| 73 74 69 6e 67 20 62 75 | 74 20 66 61 69 6c 73 20 |sting bu|t fails |
|00005320| 69 6e 20 6f 70 65 72 61 | 74 69 6f 6e 61 6c 20 75 |in opera|tional u|
|00005330| 73 65 2e 0a 0a 0a 39 2e | 38 3a 20 44 6f 65 73 20 |se....9.|8: Does |
|00005340| 41 64 61 20 68 61 76 65 | 20 73 6f 6d 65 74 68 69 |Ada have| somethi|
|00005350| 6e 67 20 6c 69 6b 65 20 | 74 68 65 20 53 74 61 6e |ng like |the Stan|
|00005360| 64 61 72 64 20 54 65 6d | 70 6c 61 74 65 20 4c 69 |dard Tem|plate Li|
|00005370| 62 72 61 72 79 20 28 53 | 54 4c 29 20 69 6e 20 43 |brary (S|TL) in C|
|00005380| 2b 2b 2c 0a 6f 72 20 63 | 6f 6d 70 6f 6e 65 6e 74 |++,.or c|omponent|
|00005390| 73 20 6c 69 6b 65 20 79 | 6f 75 20 66 69 6e 64 20 |s like y|ou find |
|000053a0| 69 6e 20 53 6d 61 6c 6c | 74 61 6c 6b 20 65 6e 76 |in Small|talk env|
|000053b0| 69 72 6f 6e 6d 65 6e 74 | 73 3f 0a 0a 20 20 20 59 |ironment|s?.. Y|
|000053c0| 65 73 2c 20 69 6e 20 76 | 61 72 69 6f 75 73 20 77 |es, in v|arious w|
|000053d0| 61 79 73 2e 0a 0a 20 20 | 20 46 65 77 20 63 6f 6d |ays... | Few com|
|000053e0| 70 6f 6e 65 6e 74 73 20 | 61 72 65 20 70 61 72 74 |ponents |are part|
|000053f0| 20 6f 66 20 74 68 65 20 | 49 53 4f 20 73 74 61 6e | of the |ISO stan|
|00005400| 64 61 72 64 2e 20 41 64 | 61 20 39 35 20 68 61 73 |dard. Ad|a 95 has|
|00005410| 20 61 6e 20 65 78 70 61 | 6e 64 65 64 0a 20 20 20 | an expa|nded. |
|00005420| 73 65 74 20 6f 66 20 70 | 72 65 64 65 66 69 6e 65 |set of p|redefine|
|00005430| 64 20 6c 69 62 72 61 72 | 79 20 75 6e 69 74 73 2c |d librar|y units,|
|00005440| 20 63 6f 76 65 72 69 6e | 67 20 65 2e 67 2e 20 73 | coverin|g e.g. s|
|00005450| 74 72 69 6e 67 73 20 6f | 66 20 76 61 72 79 69 6e |trings o|f varyin|
|00005460| 67 2d 20 6f 72 0a 20 20 | 20 64 79 6e 61 6d 69 63 |g- or. | dynamic|
|00005470| 2d 6c 65 6e 67 74 68 2c | 20 65 6c 65 6d 65 6e 74 |-length,| element|
|00005480| 61 72 79 20 6e 75 6d 65 | 72 69 63 61 6c 20 66 75 |ary nume|rical fu|
|00005490| 6e 63 74 69 6f 6e 73 2c | 20 72 61 6e 64 6f 6d 20 |nctions,| random |
|000054a0| 6e 75 6d 62 65 72 0a 20 | 20 20 67 65 6e 65 72 61 |number. | genera|
|000054b0| 74 6f 72 73 2c 20 63 6f | 6d 70 6c 65 78 20 6e 75 |tors, co|mplex nu|
|000054c0| 6d 62 65 72 73 2c 20 61 | 6e 64 20 6d 6f 72 65 3b |mbers, a|nd more;|
|000054d0| 20 69 6e 20 61 64 64 69 | 74 69 6f 6e 2c 20 74 68 | in addi|tion, th|
|000054e0| 65 20 53 70 65 63 69 61 | 6c 20 4e 65 65 64 73 0a |e Specia|l Needs.|
|000054f0| 20 20 20 41 6e 6e 65 78 | 65 73 20 73 74 61 6e 64 | Annex|es stand|
|00005500| 61 72 64 69 7a 65 20 6d | 61 6e 79 20 61 64 76 61 |ardize m|any adva|
|00005510| 6e 63 65 64 20 73 65 72 | 76 69 63 65 73 20 77 68 |nced ser|vices wh|
|00005520| 69 63 68 20 68 61 76 65 | 20 63 6f 6d 6d 6f 6e 6c |ich have| commonl|
|00005530| 79 20 62 65 65 6e 0a 20 | 20 20 70 72 6f 76 69 64 |y been. | provid|
|00005540| 65 64 20 62 79 20 73 65 | 70 61 72 61 74 65 20 63 |ed by se|parate c|
|00005550| 6f 6d 70 6f 6e 65 6e 74 | 73 20 69 6e 20 74 68 65 |omponent|s in the|
|00005560| 20 70 61 73 74 2e 0a 0a | 20 20 20 41 20 6c 6f 74 | past...| A lot|
|00005570| 20 6f 66 20 66 72 65 65 | 20 41 64 61 20 73 6f 66 | of free| Ada sof|
|00005580| 74 77 61 72 65 20 63 6f | 6d 70 6f 6e 65 6e 74 73 |tware co|mponents|
|00005590| 20 61 72 65 20 61 76 61 | 69 6c 61 62 6c 65 20 66 | are ava|ilable f|
|000055a0| 72 6f 6d 20 61 6e 6f 6e | 79 6d 6f 75 73 20 46 54 |rom anon|ymous FT|
|000055b0| 50 0a 20 20 20 73 69 74 | 65 73 2e 20 54 68 65 72 |P. sit|es. Ther|
|000055c0| 65 20 69 73 20 61 6c 73 | 6f 20 61 6e 20 75 70 63 |e is als|o an upc|
|000055d0| 6f 6d 69 6e 67 20 72 65 | 6c 65 61 73 65 20 6f 66 |oming re|lease of|
|000055e0| 20 74 68 65 20 42 6f 6f | 63 68 20 43 6f 6d 70 6f | the Boo|ch Compo|
|000055f0| 6e 65 6e 74 73 20 66 6f | 72 0a 20 20 20 41 64 61 |nents fo|r. Ada|
|00005600| 20 39 35 20 75 6e 64 65 | 72 20 74 68 65 20 47 4e | 95 unde|r the GN|
|00005610| 55 20 4c 69 62 72 61 72 | 79 20 47 65 6e 65 72 61 |U Librar|y Genera|
|00005620| 6c 20 50 75 62 6c 69 63 | 20 4c 69 63 65 6e 73 65 |l Public| License|
|00005630| 20 28 4c 47 50 4c 29 3b | 20 74 68 69 73 20 77 69 | (LGPL);| this wi|
|00005640| 6c 6c 0a 20 20 20 67 69 | 76 65 20 79 6f 75 20 74 |ll. gi|ve you t|
|00005650| 68 65 20 61 62 69 6c 69 | 74 79 20 74 6f 20 66 72 |he abili|ty to fr|
|00005660| 65 65 6c 79 20 69 6e 63 | 6c 75 64 65 20 74 68 65 |eely inc|lude the|
|00005670| 20 6c 69 62 72 61 72 79 | 20 63 6f 6d 70 6f 6e 65 | library| compone|
|00005680| 6e 74 73 20 69 6e 20 79 | 6f 75 72 0a 20 20 20 61 |nts in y|our. a|
|00005690| 70 70 6c 69 63 61 74 69 | 6f 6e 20 77 69 74 68 6f |pplicati|on witho|
|000056a0| 75 74 20 61 6e 79 20 63 | 6f 73 74 20 6f 72 20 6f |ut any c|ost or o|
|000056b0| 62 6c 69 67 61 74 69 6f | 6e 2e 20 28 43 6f 6e 74 |bligatio|n. (Cont|
|000056c0| 61 63 74 20 64 77 65 6c | 6c 65 72 40 64 66 77 2e |act dwel|ler@dfw.|
|000056d0| 6e 65 74 0a 20 20 20 66 | 6f 72 20 6d 6f 72 65 20 |net. f|or more |
|000056e0| 64 65 74 61 69 6c 73 2e | 29 0a 0a 20 20 20 20 57 |details.|).. W|
|000056f0| 68 61 74 20 61 62 6f 75 | 74 20 53 54 4c 20 61 6e |hat abou|t STL an|
|00005700| 64 20 74 68 65 20 53 6d | 61 6c 6c 74 61 6c 6b 20 |d the Sm|alltalk |
|00005710| 6c 69 62 72 61 72 79 3f | 0a 0a 20 20 20 54 68 65 |library?|.. The|
|00005720| 20 43 2b 2b 20 53 54 4c | 20 64 6f 65 73 6e 27 74 | C++ STL| doesn't|
|00005730| 20 63 6f 6e 74 61 69 6e | 20 6d 75 63 68 2e 20 52 | contain| much. R|
|00005740| 65 61 6c 6c 79 2e 20 42 | 72 65 61 6b 69 6e 67 20 |eally. B|reaking |
|00005750| 69 74 73 20 73 6f 75 72 | 63 65 20 63 6f 64 65 0a |its sour|ce code.|
|00005760| 20 20 20 64 6f 77 6e 2c | 20 69 74 20 63 6f 6e 74 | down,| it cont|
|00005770| 61 69 6e 73 20 6c 65 73 | 73 20 74 68 61 6e 20 33 |ains les|s than 3|
|00005780| 30 30 30 20 73 65 6d 69 | 63 6f 6c 6f 6e 73 20 28 |000 semi|colons (|
|00005790| 7e 37 30 30 30 20 74 6f | 74 61 6c 20 6c 69 6e 65 |~7000 to|tal line|
|000057a0| 73 29 2e 20 54 68 65 0a | 20 20 20 65 6e 74 69 72 |s). The.| entir|
|000057b0| 65 20 6c 69 62 72 61 72 | 79 20 65 78 69 73 74 73 |e librar|y exists|
|000057c0| 20 69 6e 20 43 2b 2b 20 | 68 65 61 64 65 72 20 66 | in C++ |header f|
|000057d0| 69 6c 65 73 20 61 73 20 | 69 6e 6c 69 6e 65 61 62 |iles as |inlineab|
|000057e0| 6c 65 20 63 6f 64 65 0a | 20 20 20 28 73 75 70 70 |le code.| (supp|
|000057f0| 6f 73 65 64 6c 79 20 77 | 69 74 68 69 6e 20 61 20 |osedly w|ithin a |
|00005800| 66 65 77 20 70 65 72 63 | 65 6e 74 20 6f 66 20 74 |few perc|ent of t|
|00005810| 68 65 20 65 66 66 69 63 | 69 65 6e 63 79 20 6f 66 |he effic|iency of|
|00005820| 20 68 61 6e 64 2d 6f 70 | 74 69 6d 69 7a 65 64 0a | hand-op|timized.|
|00005830| 20 20 20 63 6f 64 65 29 | 2e 0a 0a 20 20 20 53 54 | code)|... ST|
|00005840| 4c 20 63 6c 61 73 73 20 | 68 69 65 72 61 72 63 68 |L class |hierarch|
|00005850| 79 0a 0a 20 20 20 20 20 | 62 6f 6f 6c 2c 20 68 65 |y.. |bool, he|
|00005860| 61 70 20 20 20 20 20 2d | 2d 20 6f 66 20 63 6f 75 |ap -|- of cou|
|00005870| 72 73 65 20 41 64 61 20 | 64 6f 65 73 20 6e 6f 74 |rse Ada |does not|
|00005880| 20 6e 65 65 64 20 61 20 | 62 6f 6f 6c 20 63 6c 61 | need a |bool cla|
|00005890| 73 73 21 0a 20 20 20 20 | 20 20 5c 20 66 75 6e 63 |ss!. | \ func|
|000058a0| 74 69 6f 6e 2c 20 70 61 | 69 72 2c 20 73 74 61 63 |tion, pa|ir, stac|
|000058b0| 6b 0a 20 20 20 20 20 20 | 20 20 20 5c 20 69 74 65 |k. | \ ite|
|000058c0| 72 61 74 6f 72 2c 20 74 | 65 6d 70 62 75 66 2c 20 |rator, t|empbuf, |
|000058d0| 70 72 6f 6a 65 63 74 69 | 6f 6e 0a 20 20 20 20 20 |projecti|on. |
|000058e0| 20 20 20 20 20 20 20 5c | 20 61 6c 67 6f 62 61 73 | \| algobas|
|000058f0| 65 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |e. | |
|00005900| 20 5c 20 61 6c 67 6f 72 | 69 74 68 6d 73 2c 20 62 | \ algor|ithms, b|
|00005910| 69 74 76 65 63 74 6f 72 | 2c 20 64 65 71 75 65 2c |itvector|, deque,|
|00005920| 20 6c 69 73 74 2c 20 74 | 72 65 65 2c 20 76 65 63 | list, t|ree, vec|
|00005930| 74 6f 72 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |tor. | |
|00005940| 20 20 20 20 20 20 5c 20 | 6d 61 70 2c 20 6d 75 6c | \ |map, mul|
|00005950| 74 69 6d 61 70 2c 20 73 | 65 74 2c 20 6d 75 6c 74 |timap, s|et, mult|
|00005960| 69 73 65 74 0a 0a 0a 20 | 20 20 54 68 65 20 6d 61 |iset... | The ma|
|00005970| 69 6e 20 61 75 74 68 6f | 72 20 6f 66 20 74 68 65 |in autho|r of the|
|00005980| 20 6c 69 62 72 61 72 79 | 2c 20 41 6c 65 78 61 6e | library|, Alexan|
|00005990| 64 65 72 20 53 74 65 70 | 61 6e 6f 76 2c 20 63 72 |der Step|anov, cr|
|000059a0| 65 61 74 65 64 20 74 68 | 65 20 41 64 61 0a 20 20 |eated th|e Ada. |
|000059b0| 20 47 65 6e 65 72 69 63 | 20 4c 69 62 72 61 72 79 | Generic| Library|
|000059c0| 20 69 6e 20 74 68 65 20 | 31 39 38 30 27 73 20 2d | in the |1980's -|
|000059d0| 2d 20 61 6e 64 20 6c 61 | 74 65 72 20 62 6f 72 72 |- and la|ter borr|
|000059e0| 6f 77 65 64 20 66 72 6f | 6d 20 74 68 69 73 20 74 |owed fro|m this t|
|000059f0| 6f 0a 20 20 20 63 72 65 | 61 74 65 20 53 54 4c 2e |o. cre|ate STL.|
|00005a00| 20 28 54 68 65 72 65 20 | 69 73 20 61 6e 20 69 6e | (There |is an in|
|00005a10| 74 65 72 76 69 65 77 20 | 77 69 74 68 20 53 74 65 |terview |with Ste|
|00005a20| 70 61 6e 6f 76 20 69 6e | 20 74 68 65 20 4d 61 72 |panov in| the Mar|
|00005a30| 63 68 20 31 39 39 35 0a | 20 20 20 69 73 73 75 65 |ch 1995.| issue|
|00005a40| 20 6f 66 20 44 72 2e 20 | 44 6f 62 62 27 73 20 4a | of Dr. |Dobb's J|
|00005a50| 6f 75 72 6e 61 6c 20 2d | 2d 20 69 6e 20 74 68 65 |ournal -|- in the|
|00005a60| 20 43 20 50 72 6f 67 72 | 61 6d 6d 69 6e 67 20 63 | C Progr|amming c|
|00005a70| 6f 6c 75 6d 6e 20 62 65 | 67 69 6e 6e 69 6e 67 0a |olumn be|ginning.|
|00005a80| 20 20 20 6f 6e 20 70 61 | 67 65 20 31 31 35 2e 20 | on pa|ge 115. |
|00005a90| 53 74 65 70 61 6e 6f 76 | 20 65 78 70 6c 61 69 6e |Stepanov| explain|
|00005aa0| 73 20 74 68 61 74 20 74 | 68 65 73 65 20 63 6f 6d |s that t|hese com|
|00005ab0| 70 6f 6e 65 6e 74 73 20 | 77 65 72 65 20 66 69 72 |ponents |were fir|
|00005ac0| 73 74 20 64 6f 6e 65 0a | 20 20 20 69 6e 20 41 64 |st done.| in Ad|
|00005ad0| 61 2e 29 0a 0a 20 20 20 | 54 68 65 20 53 6d 61 6c |a.).. |The Smal|
|00005ae0| 6c 74 61 6c 6b 20 6c 69 | 62 72 61 72 79 20 69 73 |ltalk li|brary is|
|00005af0| 20 71 75 69 74 65 20 65 | 63 6c 65 63 74 69 63 2e | quite e|clectic.|
|00005b00| 20 49 74 20 63 6f 76 65 | 72 73 20 65 76 65 72 79 | It cove|rs every|
|00005b10| 74 68 69 6e 67 20 66 72 | 6f 6d 0a 20 20 20 42 6f |thing fr|om. Bo|
|00005b20| 6f 6c 65 61 6e 20 74 6f | 20 62 69 74 6d 61 70 73 |olean to| bitmaps|
|00005b30| 2c 20 64 69 63 74 69 6f | 6e 61 72 69 65 73 20 61 |, dictio|naries a|
|00005b40| 6e 64 20 6f 74 68 65 72 | 20 63 6f 6c 6c 65 63 74 |nd other| collect|
|00005b50| 69 6f 6e 73 2e 20 50 61 | 72 74 73 20 6f 66 20 69 |ions. Pa|rts of i|
|00005b60| 74 0a 20 20 20 68 61 76 | 65 20 64 69 72 65 63 74 |t. hav|e direct|
|00005b70| 20 65 71 75 69 76 61 6c | 65 6e 74 73 20 69 6e 20 | equival|ents in |
|00005b80| 41 64 61 20 39 35 2c 20 | 70 61 72 74 73 20 61 72 |Ada 95, |parts ar|
|00005b90| 65 20 61 6c 72 65 61 64 | 79 20 61 76 61 69 6c 61 |e alread|y availa|
|00005ba0| 62 6c 65 20 69 6e 0a 20 | 20 20 63 6f 6d 70 6f 6e |ble in. | compon|
|00005bb0| 65 6e 74 73 20 66 72 6f | 6d 20 61 6e 6f 6e 79 6d |ents fro|m anonym|
|00005bc0| 6f 75 73 20 46 54 50 20 | 73 69 74 65 73 20 61 6e |ous FTP |sites an|
|00005bd0| 64 2f 6f 72 20 77 69 6c | 6c 20 62 65 20 69 6e 20 |d/or wil|l be in |
|00005be0| 74 68 65 20 42 6f 6f 63 | 68 20 41 64 61 20 39 35 |the Booc|h Ada 95|
|00005bf0| 0a 20 20 20 63 6f 6d 70 | 6f 6e 65 6e 74 73 2c 20 |. comp|onents, |
|00005c00| 61 6e 64 20 6f 74 68 65 | 72 20 70 61 72 74 73 20 |and othe|r parts |
|00005c10| 61 72 65 20 61 76 61 69 | 6c 61 62 6c 65 20 66 72 |are avai|lable fr|
|00005c20| 6f 6d 20 63 6f 6d 6d 65 | 72 63 69 61 6c 20 41 64 |om comme|rcial Ad|
|00005c30| 61 0a 20 20 20 63 6f 6d | 70 6f 6e 65 6e 74 20 73 |a. com|ponent s|
|00005c40| 75 70 70 6c 69 65 72 73 | 2e 0a 0a 0a 39 2e 39 3a |uppliers|....9.9:|
|00005c50| 20 57 68 65 72 65 20 63 | 61 6e 20 49 20 66 69 6e | Where c|an I fin|
|00005c60| 64 20 74 68 65 20 65 71 | 75 69 76 61 6c 65 6e 74 |d the eq|uivalent|
|00005c70| 20 6f 66 20 22 70 72 69 | 6e 74 66 22 20 69 6e 20 | of "pri|ntf" in |
|00005c80| 41 64 61 3f 0a 0a 20 20 | 20 57 68 69 6c 65 20 74 |Ada?.. | While t|
|00005c90| 68 65 20 73 74 61 6e 64 | 61 72 64 20 70 61 63 6b |he stand|ard pack|
|00005ca0| 61 67 65 20 54 65 78 74 | 5f 49 4f 20 70 72 6f 76 |age Text|_IO prov|
|00005cb0| 69 64 65 73 20 6d 61 6e | 79 20 66 65 61 74 75 72 |ides man|y featur|
|00005cc0| 65 73 2c 20 74 68 65 0a | 20 20 20 72 65 71 75 65 |es, the.| reque|
|00005cd0| 73 74 20 66 6f 72 20 61 | 20 70 72 69 6e 74 66 2d |st for a| printf-|
|00005ce0| 6c 69 6b 65 20 66 75 6e | 63 74 69 6f 6e 20 69 73 |like fun|ction is|
|00005cf0| 20 6e 6f 74 20 75 6e 75 | 73 75 61 6c 2e 0a 0a 20 | not unu|sual... |
|00005d00| 20 20 28 73 6f 6c 75 74 | 69 6f 6e 20 62 61 73 65 | (solut|ion base|
|00005d10| 64 20 6f 6e 20 61 20 73 | 75 67 67 65 73 74 69 6f |d on a s|uggestio|
|00005d20| 6e 20 62 79 20 54 75 63 | 6b 65 72 20 54 61 66 74 |n by Tuc|ker Taft|
|00005d30| 29 0a 0a 20 20 20 49 74 | 20 69 73 20 70 6f 73 73 |).. It| is poss|
|00005d40| 69 62 6c 65 20 74 6f 20 | 70 72 6f 64 75 63 65 20 |ible to |produce |
|00005d50| 61 20 70 72 69 6e 74 66 | 2d 6c 69 6b 65 20 63 61 |a printf|-like ca|
|00005d60| 70 61 62 69 6c 69 74 79 | 20 62 79 20 6f 76 65 72 |pability| by over|
|00005d70| 6c 6f 61 64 69 6e 67 20 | 74 68 65 0a 20 20 20 22 |loading |the. "|
|00005d80| 26 22 20 6f 70 65 72 61 | 74 6f 72 20 74 6f 20 74 |&" opera|tor to t|
|00005d90| 61 6b 65 20 61 6e 20 6f | 62 6a 65 63 74 20 6f 66 |ake an o|bject of|
|00005da0| 20 74 79 70 65 20 46 6f | 72 6d 61 74 20 61 6e 64 | type Fo|rmat and|
|00005db0| 20 61 6e 20 6f 62 6a 65 | 63 74 20 6f 66 20 73 6f | an obje|ct of so|
|00005dc0| 6d 65 0a 20 20 20 74 79 | 70 65 20 61 6e 64 20 72 |me. ty|pe and r|
|00005dd0| 65 74 75 72 6e 20 74 68 | 65 20 46 6f 72 6d 61 74 |eturn th|e Format|
|00005de0| 2c 20 70 72 6f 70 65 72 | 6c 79 20 61 64 76 61 6e |, proper|ly advan|
|00005df0| 63 65 64 2c 20 61 66 74 | 65 72 20 68 61 76 69 6e |ced, aft|er havin|
|00005e00| 67 20 70 65 72 66 6f 72 | 6d 65 64 0a 20 20 20 74 |g perfor|med. t|
|00005e10| 68 65 20 61 70 70 72 6f | 70 72 69 61 74 65 20 6f |he appro|priate o|
|00005e20| 75 74 70 75 74 2e 20 54 | 68 65 20 72 65 6d 61 69 |utput. T|he remai|
|00005e30| 6e 69 6e 67 20 66 6f 72 | 6d 61 74 20 63 61 6e 20 |ning for|mat can |
|00005e40| 62 65 20 63 6f 6e 76 65 | 72 74 65 64 20 62 61 63 |be conve|rted bac|
|00005e50| 6b 20 74 6f 0a 20 20 20 | 61 20 73 74 72 69 6e 67 |k to. |a string|
|00005e60| 2d 2d 65 2e 67 2e 20 74 | 6f 20 65 78 61 6d 69 6e |--e.g. t|o examin|
|00005e70| 65 20 77 68 61 74 20 69 | 73 20 6c 65 66 74 20 61 |e what i|s left a|
|00005e80| 74 20 74 68 65 20 65 6e | 64 20 6f 66 20 74 68 65 |t the en|d of the|
|00005e90| 20 66 6f 72 6d 61 74 0a | 20 20 20 73 74 72 69 6e | format.| strin|
|00005ea0| 67 2d 2d 20 6f 72 20 73 | 69 6d 70 6c 79 20 70 72 |g-- or s|imply pr|
|00005eb0| 69 6e 74 65 64 20 74 6f | 20 64 69 73 70 6c 61 79 |inted to| display|
|00005ec0| 20 77 68 61 74 65 76 65 | 72 20 72 65 6d 61 69 6e | whateve|r remain|
|00005ed0| 73 20 61 74 20 74 68 65 | 20 65 6e 64 2e 20 46 6f |s at the| end. Fo|
|00005ee0| 72 0a 20 20 20 65 78 61 | 6d 70 6c 65 3a 0a 0a 20 |r. exa|mple:.. |
|00005ef0| 20 20 20 20 77 69 74 68 | 20 54 65 78 74 5f 49 4f | with| Text_IO|
|00005f00| 3b 0a 20 20 20 20 20 70 | 61 63 6b 61 67 65 20 46 |;. p|ackage F|
|00005f10| 6f 72 6d 61 74 74 65 64 | 5f 4f 75 74 70 75 74 20 |ormatted|_Output |
|00005f20| 69 73 0a 20 20 20 20 20 | 20 20 74 79 70 65 20 46 |is. | type F|
|00005f30| 6f 72 6d 61 74 20 69 73 | 0a 20 20 20 20 20 20 20 |ormat is|. |
|00005f40| 20 20 6c 69 6d 69 74 65 | 64 20 70 72 69 76 61 74 | limite|d privat|
|00005f50| 65 3b 0a 0a 20 20 20 20 | 20 20 20 66 75 6e 63 74 |e;.. | funct|
|00005f60| 69 6f 6e 20 46 6d 74 20 | 28 53 74 72 20 3a 20 53 |ion Fmt |(Str : S|
|00005f70| 74 72 69 6e 67 29 0a 20 | 20 20 20 20 20 20 20 20 |tring). | |
|00005f80| 72 65 74 75 72 6e 20 46 | 6f 72 6d 61 74 3b 0a 0a |return F|ormat;..|
|00005f90| 20 20 20 20 20 20 20 66 | 75 6e 63 74 69 6f 6e 20 | f|unction |
|00005fa0| 22 26 22 20 28 4c 65 66 | 74 20 3a 20 46 6f 72 6d |"&" (Lef|t : Form|
|00005fb0| 61 74 3b 20 52 69 67 68 | 74 20 3a 20 49 6e 74 65 |at; Righ|t : Inte|
|00005fc0| 67 65 72 29 0a 20 20 20 | 20 20 20 20 20 20 72 65 |ger). | re|
|00005fd0| 74 75 72 6e 20 46 6f 72 | 6d 61 74 3b 0a 20 20 20 |turn For|mat;. |
|00005fe0| 20 20 20 20 66 75 6e 63 | 74 69 6f 6e 20 22 26 22 | func|tion "&"|
|00005ff0| 20 28 4c 65 66 74 20 3a | 20 46 6f 72 6d 61 74 3b | (Left :| Format;|
|00006000| 20 52 69 67 68 74 20 3a | 20 46 6c 6f 61 74 29 0a | Right :| Float).|
|00006010| 20 20 20 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 | | return |
|00006020| 46 6f 72 6d 61 74 3b 0a | 20 20 20 20 20 20 20 66 |Format;.| f|
|00006030| 75 6e 63 74 69 6f 6e 20 | 22 26 22 20 28 4c 65 66 |unction |"&" (Lef|
|00006040| 74 20 3a 20 46 6f 72 6d | 61 74 3b 20 52 69 67 68 |t : Form|at; Righ|
|00006050| 74 20 3a 20 53 74 72 69 | 6e 67 29 0a 20 20 20 20 |t : Stri|ng). |
|00006060| 20 20 20 20 20 72 65 74 | 75 72 6e 20 46 6f 72 6d | ret|urn Form|
|00006070| 61 74 3b 0a 20 20 20 20 | 20 20 20 2e 2e 2e 20 2d |at;. | ... -|
|00006080| 2d 20 6f 74 68 65 72 20 | 6f 76 65 72 6c 6f 61 64 |- other |overload|
|00006090| 69 6e 67 73 20 6f 66 20 | 22 26 22 0a 0a 20 20 20 |ings of |"&".. |
|000060a0| 20 20 20 20 70 72 6f 63 | 65 64 75 72 65 20 50 72 | proc|edure Pr|
|000060b0| 69 6e 74 20 28 46 6d 74 | 20 3a 20 46 6f 72 6d 61 |int (Fmt| : Forma|
|000060c0| 74 29 3b 0a 0a 20 20 20 | 20 20 20 20 66 75 6e 63 |t);.. | func|
|000060d0| 74 69 6f 6e 20 54 6f 5f | 53 74 72 69 6e 67 20 28 |tion To_|String (|
|000060e0| 46 6d 74 20 3a 20 46 6f | 72 6d 61 74 29 0a 20 20 |Fmt : Fo|rmat). |
|000060f0| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 53 74 | r|eturn St|
|00006100| 72 69 6e 67 3b 0a 0a 20 | 20 20 20 20 70 72 69 76 |ring;.. | priv|
|00006110| 61 74 65 0a 20 20 20 20 | 20 20 20 2e 2e 2e 0a 20 |ate. | .... |
|00006120| 20 20 20 20 65 6e 64 20 | 46 6f 72 6d 61 74 74 65 | end |Formatte|
|00006130| 64 5f 4f 75 74 70 75 74 | 3b 0a 0a 20 20 20 20 20 |d_Output|;.. |
|00006140| 77 69 74 68 20 46 6f 72 | 6d 61 74 74 65 64 5f 4f |with For|matted_O|
|00006150| 75 74 70 75 74 3b 20 75 | 73 65 20 46 6f 72 6d 61 |utput; u|se Forma|
|00006160| 74 74 65 64 5f 4f 75 74 | 70 75 74 3b 0a 20 20 20 |tted_Out|put;. |
|00006170| 20 20 70 72 6f 63 65 64 | 75 72 65 20 54 65 73 74 | proced|ure Test|
|00006180| 20 69 73 0a 20 20 20 20 | 20 20 20 58 2c 20 59 20 | is. | X, Y |
|00006190| 3a 20 46 6c 6f 61 74 3b | 0a 20 20 20 20 20 62 65 |: Float;|. be|
|000061a0| 67 69 6e 0a 20 20 20 20 | 20 20 20 50 72 69 6e 74 |gin. | Print|
|000061b0| 20 28 46 6d 74 28 22 25 | 64 20 2a 20 25 64 20 3d | (Fmt("%|d * %d =|
|000061c0| 20 25 64 5c 6e 22 29 20 | 26 20 58 20 26 20 59 20 | %d\n") |& X & Y |
|000061d0| 26 20 58 2a 59 29 3b 0a | 20 20 20 20 20 65 6e 64 |& X*Y);.| end|
|000061e0| 20 54 65 73 74 3b 0a 0a | 20 20 20 54 68 65 20 70 | Test;..| The p|
|000061f0| 72 69 76 61 74 65 20 70 | 61 72 74 20 61 6e 64 20 |rivate p|art and |
|00006200| 62 6f 64 79 20 6f 66 20 | 46 6f 72 6d 61 74 74 65 |body of |Formatte|
|00006210| 64 5f 4f 75 74 70 75 74 | 20 61 72 65 20 6c 65 66 |d_Output| are lef|
|00006220| 74 20 61 73 20 61 6e 20 | 65 78 65 72 63 69 73 65 |t as an |exercise|
|00006230| 0a 20 20 20 66 6f 72 20 | 74 68 65 20 72 65 61 64 |. for |the read|
|00006240| 65 72 20 3b 2d 29 2e 0a | 0a 20 20 20 41 20 22 46 |er ;-)..|. A "F|
|00006250| 69 6c 65 20 3a 20 46 69 | 6c 65 5f 54 79 70 65 22 |ile : Fi|le_Type"|
|00006260| 20 70 61 72 61 6d 65 74 | 65 72 20 63 6f 75 6c 64 | paramet|er could|
|00006270| 20 62 65 20 61 64 64 65 | 64 20 74 6f 20 61 6e 20 | be adde|d to an |
|00006280| 6f 76 65 72 6c 6f 61 64 | 69 6e 67 20 6f 66 20 46 |overload|ing of F|
|00006290| 6d 74 0a 20 20 20 69 66 | 20 64 65 73 69 72 65 64 |mt. if| desired|
|000062a0| 20 28 74 6f 20 63 72 65 | 61 74 65 20 73 6f 6d 65 | (to cre|ate some|
|000062b0| 74 68 69 6e 67 20 61 6e | 61 6c 6f 67 6f 75 73 20 |thing an|alogous |
|000062c0| 74 6f 20 66 70 72 69 6e | 74 66 29 2e 0a 0a 20 20 |to fprin|tf)... |
|000062d0| 20 54 68 69 73 20 63 61 | 70 61 62 69 6c 69 74 79 | This ca|pability|
|000062e0| 20 69 73 20 61 6e 61 6c | 6f 67 6f 75 73 20 74 6f | is anal|ogous to|
|000062f0| 20 74 68 61 74 20 70 72 | 6f 76 69 64 65 64 20 62 | that pr|ovided b|
|00006300| 79 20 74 68 65 20 22 3c | 3c 22 20 73 74 72 65 61 |y the "<|<" strea|
|00006310| 6d 0a 20 20 20 6f 70 65 | 72 61 74 6f 72 20 6f 66 |m. ope|rator of|
|00006320| 20 43 2b 2b 2e 0a 0a 20 | 20 20 20 20 5f 5f 5f 5f | C++... | ____|
|00006330| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00006340| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00006350| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00006360| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 0a 0a 0a |________|_____...|
|00006370| 31 30 3a 20 49 6e 74 65 | 72 66 61 63 69 6e 67 20 |10: Inte|rfacing |
|00006380| 77 69 74 68 20 41 64 61 | 0a 0a 0a 31 30 2e 31 3a |with Ada|...10.1:|
|00006390| 20 49 20 61 6d 20 77 72 | 69 74 69 6e 67 20 73 6f | I am wr|iting so|
|000063a0| 66 74 77 61 72 65 20 74 | 68 61 74 20 75 73 65 64 |ftware t|hat used|
|000063b0| 20 74 68 65 20 44 69 73 | 74 72 69 62 75 74 65 64 | the Dis|tributed|
|000063c0| 20 49 6e 74 65 72 61 63 | 74 69 76 65 20 53 69 6d | Interac|tive Sim|
|000063d0| 75 6c 61 74 69 6f 6e 0a | 28 44 49 53 29 20 69 6e |ulation.|(DIS) in|
|000063e0| 74 65 72 66 61 63 65 2c | 20 64 6f 65 73 20 61 6e |terface,| does an|
|000063f0| 20 69 6e 74 65 72 66 61 | 63 65 20 65 78 69 73 74 | interfa|ce exist|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.