home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news, ISO-8859 text, with CRLF line terminators
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: Plain text[CRLF]
| default
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 73 65 | 6e 61 74 6f 72 2d 62 65 |Path: se|nator-be|
|00000010| 64 66 65 6c 6c 6f 77 2e | 6d 69 74 2e 65 64 75 21 |dfellow.|mit.edu!|
|00000020| 62 6c 6f 6f 6d 2d 62 65 | 61 63 6f 6e 2e 6d 69 74 |bloom-be|acon.mit|
|00000030| 2e 65 64 75 21 74 72 69 | 62 75 6e 65 2e 6d 65 69 |.edu!tri|bune.mei|
|00000040| 74 63 61 2e 63 6f 6d 21 | 75 6c 6f 77 65 6c 6c 2e |tca.com!|ulowell.|
|00000050| 75 6d 6c 2e 65 64 75 21 | 65 75 72 6f 70 61 2e 63 |uml.edu!|europa.c|
|00000060| 68 6e 74 2e 67 74 65 67 | 73 63 2e 63 6f 6d 21 6e |hnt.gteg|sc.com!n|
|00000070| 65 77 73 2e 6d 73 66 63 | 2e 6e 61 73 61 2e 67 6f |ews.msfc|.nasa.go|
|00000080| 76 21 65 6c 72 6f 79 2e | 6a 70 6c 2e 6e 61 73 61 |v!elroy.|jpl.nasa|
|00000090| 2e 67 6f 76 21 73 77 72 | 69 6e 64 65 21 74 61 6e |.gov!swr|inde!tan|
|000000a0| 6b 2e 6e 65 77 73 2e 70 | 69 70 65 78 2e 6e 65 74 |k.news.p|ipex.net|
|000000b0| 21 70 69 70 65 78 21 6f | 6c 65 61 6e 65 21 69 6e |!pipex!o|leane!in|
|000000c0| 32 70 33 2e 66 72 21 73 | 77 69 64 69 72 2e 73 77 |2p3.fr!s|widir.sw|
|000000d0| 69 74 63 68 2e 63 68 21 | 65 70 66 6c 6e 65 77 73 |itch.ch!|epflnews|
|000000e0| 21 64 69 6e 65 77 73 2e | 65 70 66 6c 2e 63 68 21 |!dinews.|epfl.ch!|
|000000f0| 4d 61 67 6e 75 73 2e 4b | 65 6d 70 65 0d 0a 46 72 |Magnus.K|empe..Fr|
|00000100| 6f 6d 3a 20 4d 61 67 6e | 75 73 2e 4b 65 6d 70 65 |om: Magn|us.Kempe|
|00000110| 40 64 69 2e 65 70 66 6c | 2e 63 68 20 28 4d 61 67 |@di.epfl|.ch (Mag|
|00000120| 6e 75 73 20 4b 65 6d 70 | 65 29 0d 0a 4e 65 77 73 |nus Kemp|e)..News|
|00000130| 67 72 6f 75 70 73 3a 20 | 63 6f 6d 70 2e 6c 61 6e |groups: |comp.lan|
|00000140| 67 2e 61 64 61 2c 63 6f | 6d 70 2e 61 6e 73 77 65 |g.ada,co|mp.answe|
|00000150| 72 73 2c 6e 65 77 73 2e | 61 6e 73 77 65 72 73 0d |rs,news.|answers.|
|00000160| 0a 53 75 62 6a 65 63 74 | 3a 20 41 64 61 20 46 41 |.Subject|: Ada FA|
|00000170| 51 3a 20 50 72 6f 67 72 | 61 6d 6d 69 6e 67 20 77 |Q: Progr|amming w|
|00000180| 69 74 68 20 41 64 61 20 | 28 70 61 72 74 20 34 20 |ith Ada |(part 4 |
|00000190| 6f 66 20 34 29 0d 0a 46 | 6f 6c 6c 6f 77 75 70 2d |of 4)..F|ollowup-|
|000001a0| 54 6f 3a 20 70 6f 73 74 | 65 72 0d 0a 44 61 74 65 |To: post|er..Date|
|000001b0| 3a 20 31 37 20 4d 61 72 | 20 31 39 39 36 20 31 34 |: 17 Mar| 1996 14|
|000001c0| 3a 32 33 3a 31 31 20 47 | 4d 54 0d 0a 4f 72 67 61 |:23:11 G|MT..Orga|
|000001d0| 6e 69 7a 61 74 69 6f 6e | 3a 20 4e 6f 6e 65 0d 0a |nization|: None..|
|000001e0| 4c 69 6e 65 73 3a 20 38 | 36 39 0d 0a 53 65 6e 64 |Lines: 8|69..Send|
|000001f0| 65 72 3a 20 6d 61 67 6e | 75 73 40 6c 67 6c 73 75 |er: magn|us@lglsu|
|00000200| 6e 34 2e 65 70 66 6c 2e | 63 68 20 28 4d 61 67 6e |n4.epfl.|ch (Magn|
|00000210| 75 73 20 4b 65 6d 70 65 | 29 0d 0a 41 70 70 72 6f |us Kempe|)..Appro|
|00000220| 76 65 64 3a 20 6e 65 77 | 73 2d 61 6e 73 77 65 72 |ved: new|s-answer|
|00000230| 73 2d 72 65 71 75 65 73 | 74 40 4d 49 54 2e 45 44 |s-reques|t@MIT.ED|
|00000240| 55 0d 0a 44 69 73 74 72 | 69 62 75 74 69 6f 6e 3a |U..Distr|ibution:|
|00000250| 20 77 6f 72 6c 64 0d 0a | 4d 65 73 73 61 67 65 2d | world..|Message-|
|00000260| 49 44 3a 20 3c 34 69 68 | 37 38 66 24 66 71 32 40 |ID: <4ih|78f$fq2@|
|00000270| 64 69 73 75 6e 6d 73 2e | 65 70 66 6c 2e 63 68 3e |disunms.|epfl.ch>|
|00000280| 0d 0a 52 65 70 6c 79 2d | 54 6f 3a 20 4d 61 67 6e |..Reply-|To: Magn|
|00000290| 75 73 2e 4b 65 6d 70 65 | 40 64 69 2e 65 70 66 6c |us.Kempe|@di.epfl|
|000002a0| 2e 63 68 20 28 4d 61 67 | 6e 75 73 20 4b 65 6d 70 |.ch (Mag|nus Kemp|
|000002b0| 65 29 0d 0a 4e 4e 54 50 | 2d 50 6f 73 74 69 6e 67 |e)..NNTP|-Posting|
|000002c0| 2d 48 6f 73 74 3a 20 6c | 67 6c 73 75 6e 34 2e 65 |-Host: l|glsun4.e|
|000002d0| 70 66 6c 2e 63 68 0d 0a | 4d 69 6d 65 2d 56 65 72 |pfl.ch..|Mime-Ver|
|000002e0| 73 69 6f 6e 3a 20 31 2e | 30 0d 0a 43 6f 6e 74 65 |sion: 1.|0..Conte|
|000002f0| 6e 74 2d 54 79 70 65 3a | 20 74 65 78 74 2f 70 6c |nt-Type:| text/pl|
|00000300| 61 69 6e 3b 20 63 68 61 | 72 73 65 74 3d 69 73 6f |ain; cha|rset=iso|
|00000310| 2d 38 38 35 39 2d 31 0d | 0a 43 6f 6e 74 65 6e 74 |-8859-1.|.Content|
|00000320| 2d 54 72 61 6e 73 66 65 | 72 2d 45 6e 63 6f 64 69 |-Transfe|r-Encodi|
|00000330| 6e 67 3a 20 38 62 69 74 | 0d 0a 53 75 6d 6d 61 72 |ng: 8bit|..Summar|
|00000340| 79 3a 20 41 64 61 20 50 | 72 6f 67 72 61 6d 6d 65 |y: Ada P|rogramme|
|00000350| 72 27 73 20 46 72 65 71 | 75 65 6e 74 6c 79 20 41 |r's Freq|uently A|
|00000360| 73 6b 65 64 20 51 75 65 | 73 74 69 6f 6e 73 20 28 |sked Que|stions (|
|00000370| 61 6e 64 20 61 6e 73 77 | 65 72 73 29 2c 0d 0a 20 |and answ|ers),.. |
|00000380| 20 20 20 20 20 20 20 20 | 20 20 70 61 72 74 20 34 | | part 4|
|00000390| 20 6f 66 20 34 2e 0d 0a | 20 20 20 20 20 20 20 20 | of 4...| |
|000003a0| 20 50 6c 65 61 73 65 20 | 72 65 61 64 20 62 65 66 | Please |read bef|
|000003b0| 6f 72 65 20 70 6f 73 74 | 69 6e 67 2e 0d 0a 4b 65 |ore post|ing...Ke|
|000003c0| 79 77 6f 72 64 73 3a 20 | 61 64 76 61 6e 63 65 64 |ywords: |advanced|
|000003d0| 20 6c 61 6e 67 75 61 67 | 65 2c 20 61 72 74 69 66 | languag|e, artif|
|000003e0| 69 63 69 61 6c 20 6c 61 | 6e 67 75 61 67 65 73 2c |icial la|nguages,|
|000003f0| 20 63 6f 6d 70 75 74 65 | 72 20 73 6f 66 74 77 61 | compute|r softwa|
|00000400| 72 65 2c 0d 0a 20 20 20 | 20 20 20 20 20 20 20 64 |re,.. | d|
|00000410| 61 74 61 20 70 72 6f 63 | 65 73 73 69 6e 67 2c 20 |ata proc|essing, |
|00000420| 70 72 6f 67 72 61 6d 6d | 69 6e 67 20 6c 61 6e 67 |programm|ing lang|
|00000430| 75 61 67 65 73 2c 20 41 | 64 61 0d 0a 58 72 65 66 |uages, A|da..Xref|
|00000440| 3a 20 73 65 6e 61 74 6f | 72 2d 62 65 64 66 65 6c |: senato|r-bedfel|
|00000450| 6c 6f 77 2e 6d 69 74 2e | 65 64 75 20 63 6f 6d 70 |low.mit.|edu comp|
|00000460| 2e 6c 61 6e 67 2e 61 64 | 61 3a 34 32 34 36 35 20 |.lang.ad|a:42465 |
|00000470| 63 6f 6d 70 2e 61 6e 73 | 77 65 72 73 3a 31 37 36 |comp.ans|wers:176|
|00000480| 30 39 20 6e 65 77 73 2e | 61 6e 73 77 65 72 73 3a |09 news.|answers:|
|00000490| 36 37 31 36 39 0d 0a 0d | 0a 41 72 63 68 69 76 65 |67169...|.Archive|
|000004a0| 2d 6e 61 6d 65 3a 20 63 | 6f 6d 70 75 74 65 72 2d |-name: c|omputer-|
|000004b0| 6c 61 6e 67 2f 41 64 61 | 2f 70 72 6f 67 72 61 6d |lang/Ada|/program|
|000004c0| 6d 69 6e 67 2f 70 61 72 | 74 34 0d 0a 43 6f 6d 70 |ming/par|t4..Comp|
|000004d0| 2d 6c 61 6e 67 2d 61 64 | 61 2d 61 72 63 68 69 76 |-lang-ad|a-archiv|
|000004e0| 65 2d 6e 61 6d 65 3a 20 | 70 72 6f 67 72 61 6d 6d |e-name: |programm|
|000004f0| 69 6e 67 2f 70 61 72 74 | 34 0d 0a 50 6f 73 74 69 |ing/part|4..Posti|
|00000500| 6e 67 2d 46 72 65 71 75 | 65 6e 63 79 3a 20 6d 6f |ng-Frequ|ency: mo|
|00000510| 6e 74 68 6c 79 0d 0a 4c | 61 73 74 2d 6d 6f 64 69 |nthly..L|ast-modi|
|00000520| 66 69 65 64 3a 20 32 38 | 20 46 65 62 72 75 61 72 |fied: 28| Februar|
|00000530| 79 20 31 39 39 36 0d 0a | 4c 61 73 74 2d 70 6f 73 |y 1996..|Last-pos|
|00000540| 74 65 64 3a 20 32 36 20 | 4a 61 6e 75 61 72 79 20 |ted: 26 |January |
|00000550| 31 39 39 36 0d 0a 0d 0a | 20 20 20 20 20 20 20 20 |1996....| |
|00000560| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000570| 20 20 20 20 20 20 20 41 | 64 61 20 50 72 6f 67 72 | A|da Progr|
|00000580| 61 6d 6d 65 72 27 73 0d | 0a 20 20 20 20 20 20 20 |ammer's.|. |
|00000590| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000005a0| 46 72 65 71 75 65 6e 74 | 6c 79 20 41 73 6b 65 64 |Frequent|ly Asked|
|000005b0| 20 51 75 65 73 74 69 6f | 6e 73 20 28 46 41 51 29 | Questio|ns (FAQ)|
|000005c0| 0d 0a 0d 0a 20 20 20 49 | 4d 50 4f 52 54 41 4e 54 |.... I|MPORTANT|
|000005d0| 20 4e 4f 54 45 3a 20 4e | 6f 20 46 41 51 20 63 61 | NOTE: N|o FAQ ca|
|000005e0| 6e 20 73 75 62 73 74 69 | 74 75 74 65 20 66 6f 72 |n substi|tute for|
|000005f0| 20 72 65 61 6c 20 74 65 | 61 63 68 69 6e 67 20 61 | real te|aching a|
|00000600| 6e 64 0d 0a 20 20 20 64 | 6f 63 75 6d 65 6e 74 61 |nd.. d|ocumenta|
|00000610| 74 69 6f 6e 2e 20 54 68 | 65 72 65 20 69 73 20 61 |tion. Th|ere is a|
|00000620| 6e 20 61 6e 6e 6f 74 61 | 74 65 64 20 6c 69 73 74 |n annota|ted list|
|00000630| 20 6f 66 20 41 64 61 20 | 62 6f 6f 6b 73 20 69 6e | of Ada |books in|
|00000640| 20 74 68 65 0d 0a 20 20 | 20 63 6f 6d 70 61 6e 69 | the.. | compani|
|00000650| 6f 6e 20 63 6f 6d 70 2e | 6c 61 6e 67 2e 61 64 61 |on comp.|lang.ada|
|00000660| 20 46 41 51 2e 0d 0a 0d | 0a 54 68 69 73 20 69 73 | FAQ....|.This is|
|00000670| 20 70 61 72 74 20 34 20 | 6f 66 20 61 20 34 2d 70 | part 4 |of a 4-p|
|00000680| 61 72 74 20 70 6f 73 74 | 69 6e 67 2e 0d 0a 50 61 |art post|ing...Pa|
|00000690| 72 74 20 32 20 62 65 67 | 69 6e 73 20 77 69 74 68 |rt 2 beg|ins with|
|000006a0| 20 71 75 65 73 74 69 6f | 6e 20 35 2e 0d 0a 50 61 | questio|n 5...Pa|
|000006b0| 72 74 20 33 20 62 65 67 | 69 6e 73 20 77 69 74 68 |rt 3 beg|ins with|
|000006c0| 20 71 75 65 73 74 69 6f | 6e 20 36 2e 0d 0a 50 61 | questio|n 6...Pa|
|000006d0| 72 74 73 20 31 2c 20 32 | 2c 20 61 6e 64 20 33 20 |rts 1, 2|, and 3 |
|000006e0| 73 68 6f 75 6c 64 20 62 | 65 20 74 68 65 20 70 72 |should b|e the pr|
|000006f0| 65 76 69 6f 75 73 20 70 | 6f 73 74 69 6e 67 73 20 |evious p|ostings |
|00000700| 69 6e 20 74 68 69 73 20 | 74 68 72 65 61 64 2e 0d |in this |thread..|
|00000710| 0a 0d 0a 20 20 20 20 52 | 65 63 65 6e 74 20 63 68 |... R|ecent ch|
|00000720| 61 6e 67 65 73 20 74 6f | 20 74 68 69 73 20 46 41 |anges to| this FA|
|00000730| 51 20 61 72 65 20 6c 69 | 73 74 65 64 20 69 6e 20 |Q are li|sted in |
|00000740| 74 68 65 20 66 69 72 73 | 74 20 73 65 63 74 69 6f |the firs|t sectio|
|00000750| 6e 20 61 66 74 65 72 20 | 74 68 65 20 74 61 62 6c |n after |the tabl|
|00000760| 65 0d 0a 20 20 20 20 6f | 66 20 63 6f 6e 74 65 6e |e.. o|f conten|
|00000770| 74 73 20 28 69 6e 20 70 | 61 72 74 20 31 29 2e 20 |ts (in p|art 1). |
|00000780| 54 68 69 73 20 64 6f 63 | 75 6d 65 6e 74 20 69 73 |This doc|ument is|
|00000790| 20 75 6e 64 65 72 20 65 | 78 70 6c 69 63 69 74 20 | under e|xplicit |
|000007a0| 63 6f 70 79 72 69 67 68 | 74 2e 0d 0a 0d 0a 0d 0a |copyrigh|t.......|
|000007b0| 39 3a 20 41 64 61 20 61 | 6e 64 20 4f 74 68 65 72 |9: Ada a|nd Other|
|000007c0| 20 50 72 6f 67 72 61 6d | 6d 69 6e 67 20 4c 61 6e | Program|ming Lan|
|000007d0| 67 75 61 67 65 73 0d 0a | 0d 0a 0d 0a 39 2e 31 3a |guages..|....9.1:|
|000007e0| 20 57 68 65 72 65 20 63 | 61 6e 20 49 20 66 69 6e | Where c|an I fin|
|000007f0| 64 20 70 72 6f 67 72 61 | 6d 73 20 74 68 61 74 20 |d progra|ms that |
|00000800| 77 69 6c 6c 20 74 72 61 | 6e 73 6c 61 74 65 20 66 |will tra|nslate f|
|00000810| 72 6f 6d 20 5b 73 6f 6d | 65 20 6c 61 6e 67 75 61 |rom [som|e langua|
|00000820| 67 65 5d 20 74 6f 0d 0a | 41 64 61 3f 0d 0a 0d 0a |ge] to..|Ada?....|
|00000830| 20 20 20 49 74 20 69 73 | 20 67 65 6e 65 72 61 6c | It is| general|
|00000840| 6c 79 20 61 64 76 69 73 | 61 62 6c 65 20 74 6f 20 |ly advis|able to |
|00000850| 73 69 6d 70 6c 79 20 69 | 6e 74 65 72 66 61 63 65 |simply i|nterface|
|00000860| 20 66 72 6f 6d 20 41 64 | 61 20 74 6f 20 74 68 65 | from Ad|a to the|
|00000870| 0d 0a 20 20 20 65 78 69 | 73 74 69 6e 67 20 63 6f |.. exi|sting co|
|00000880| 64 65 20 73 65 67 6d 65 | 6e 74 73 20 74 68 61 74 |de segme|nts that|
|00000890| 20 28 73 68 6f 75 6c 64 | 29 20 61 6c 72 65 61 64 | (should|) alread|
|000008a0| 79 20 77 6f 72 6b 2e 20 | 4e 6f 74 65 20 74 68 61 |y work. |Note tha|
|000008b0| 74 20 41 64 61 20 28 39 | 35 29 0d 0a 20 20 20 6e |t Ada (9|5).. n|
|000008c0| 6f 77 20 68 61 73 20 61 | 6e 20 61 6e 6e 65 78 20 |ow has a|n annex |
|000008d0| 64 65 76 6f 74 65 64 20 | 74 6f 20 73 70 65 63 69 |devoted |to speci|
|000008e0| 66 79 69 6e 67 20 68 6f | 77 20 74 6f 20 69 6e 74 |fying ho|w to int|
|000008f0| 65 72 66 61 63 65 20 77 | 69 74 68 20 63 6f 64 65 |erface w|ith code|
|00000900| 0d 0a 20 20 20 77 72 69 | 74 74 65 6e 20 69 6e 20 |.. wri|tten in |
|00000910| 6f 74 68 65 72 20 70 72 | 6f 67 72 61 6d 6d 69 6e |other pr|ogrammin|
|00000920| 67 20 6c 61 6e 67 75 61 | 67 65 73 20 28 43 2c 20 |g langua|ges (C, |
|00000930| 46 6f 74 72 61 6e 2c 20 | 61 6e 64 20 43 6f 62 6f |Fotran, |and Cobo|
|00000940| 6c 29 2c 20 61 6e 64 0d | 0a 20 20 20 74 68 65 72 |l), and.|. ther|
|00000950| 65 20 61 72 65 20 61 6c | 72 65 61 64 79 20 69 6e |e are al|ready in|
|00000960| 74 65 72 66 61 63 65 73 | 20 74 6f 20 43 2b 2b 20 |terfaces| to C++ |
|00000970| 74 6f 6f 2e 0d 0a 0d 0a | 20 20 20 41 6e 6f 74 68 |too.....| Anoth|
|00000980| 65 72 20 6f 70 74 69 6f | 6e 20 69 73 20 74 6f 20 |er optio|n is to |
|00000990| 72 65 64 65 73 69 67 6e | 20 74 68 65 20 63 6f 64 |redesign| the cod|
|000009a0| 65 2c 20 74 61 6b 69 6e | 67 20 6f 66 20 63 6f 75 |e, takin|g of cou|
|000009b0| 72 73 65 20 61 64 76 61 | 6e 74 61 67 65 20 6f 66 |rse adva|ntage of|
|000009c0| 0d 0a 20 20 20 6f 6e 65 | 27 73 20 6b 6e 6f 77 6c |.. one|'s knowl|
|000009d0| 65 64 67 65 20 6f 66 20 | 74 68 65 20 63 75 72 72 |edge of |the curr|
|000009e0| 65 6e 74 20 73 79 73 74 | 65 6d 2e 20 46 6f 72 20 |ent syst|em. For |
|000009f0| 69 6e 73 74 61 6e 63 65 | 2c 20 4a 6f 62 a0 48 6f |instance|, Job.Ho|
|00000a00| 6e 69 67 0d 0a 20 20 20 | 72 65 70 6f 72 74 65 64 |nig.. |reported|
|00000a10| 20 74 68 61 74 20 68 65 | 20 64 69 64 20 74 68 69 | that he| did thi|
|00000a20| 73 20 74 77 69 63 65 2c | 20 6f 6e 63 65 20 66 6f |s twice,| once fo|
|00000a30| 72 20 43 6f 63 6f 2c 20 | 61 20 70 61 72 73 65 72 |r Coco, |a parser|
|00000a40| 20 67 65 6e 65 72 61 74 | 6f 72 20 66 6f 72 0d 0a | generat|or for..|
|00000a50| 20 20 20 4c 41 4c 52 20 | 6c 65 66 74 20 61 74 74 | LALR |left att|
|00000a60| 72 69 62 75 74 65 64 20 | 67 72 61 6d 6d 61 72 73 |ributed |grammars|
|00000a70| 2c 20 61 6e 64 20 6f 6e | 63 65 20 66 6f 72 20 46 |, and on|ce for F|
|00000a80| 6c 65 78 2c 20 74 68 65 | 20 77 65 6c 6c 20 6b 6e |lex, the| well kn|
|00000a90| 6f 77 6e 0d 0a 20 20 20 | 73 63 61 6e 6e 65 72 20 |own.. |scanner |
|00000aa0| 67 65 6e 65 72 61 74 6f | 72 2e 20 42 6f 74 68 20 |generato|r. Both |
|00000ab0| 61 74 74 65 6d 70 74 73 | 20 72 65 76 65 61 6c 65 |attempts| reveale|
|00000ac0| 64 20 65 72 72 6f 72 73 | 20 69 6e 20 74 68 65 20 |d errors| in the |
|00000ad0| 6f 72 69 67 69 6e 61 6c | 0d 0a 20 20 20 73 6f 66 |original|.. sof|
|00000ae0| 74 77 61 72 65 3b 20 74 | 68 65 79 20 77 65 72 65 |tware; t|hey were|
|00000af0| 20 75 6e 63 6f 76 65 72 | 65 64 20 62 79 20 64 65 | uncover|ed by de|
|00000b00| 73 69 67 6e 69 6e 67 20 | 74 68 65 20 6e 65 77 20 |signing |the new |
|00000b10| 73 79 73 74 65 6d 20 75 | 73 69 6e 67 20 74 68 65 |system u|sing the|
|00000b20| 0d 0a 20 20 20 68 69 67 | 68 65 72 20 61 62 73 74 |.. hig|her abst|
|00000b30| 72 61 63 74 69 6f 6e 20 | 6c 65 76 65 6c 20 61 6c |raction |level al|
|00000b40| 6c 6f 77 65 64 20 62 79 | 20 41 64 61 2e 2e 2e 0d |lowed by| Ada....|
|00000b50| 0a 0d 0a 20 20 20 53 6f | 20 74 68 65 72 65 20 69 |... So| there i|
|00000b60| 73 20 73 75 70 70 6f 72 | 74 20 66 6f 72 20 74 68 |s suppor|t for th|
|00000b70| 65 20 72 65 71 75 69 72 | 65 6d 65 6e 74 73 20 61 |e requir|ements a|
|00000b80| 6e 61 6c 79 73 69 73 20 | 28 74 72 61 6e 73 69 74 |nalysis |(transit|
|00000b90| 69 6f 6e 20 74 6f 20 41 | 64 61 29 2c 0d 0a 20 20 |ion to A|da),.. |
|00000ba0| 20 62 75 74 20 69 74 20 | 69 73 20 6e 6f 74 20 6f | but it |is not o|
|00000bb0| 62 76 69 6f 75 73 20 74 | 68 61 74 20 74 68 65 20 |bvious t|hat the |
|00000bc0| 70 72 6f 70 6f 73 65 64 | 20 69 6d 70 6c 65 6d 65 |proposed| impleme|
|00000bd0| 6e 74 61 74 69 6f 6e 20 | 28 75 73 69 6e 67 20 61 |ntation |(using a|
|00000be0| 20 73 6f 75 72 63 65 0d | 0a 20 20 20 63 6f 64 65 | source.|. code|
|00000bf0| 20 74 72 61 6e 73 6c 61 | 74 6f 72 29 20 69 73 20 | transla|tor) is |
|00000c00| 61 20 67 6f 6f 64 20 73 | 6f 6c 75 74 69 6f 6e 2e |a good s|olution.|
|00000c10| 0d 0a 0d 0a 20 20 20 53 | 74 69 6c 6c 2c 20 79 6f |.... S|till, yo|
|00000c20| 75 20 6d 61 79 20 68 61 | 76 65 20 63 6f 6d 70 65 |u may ha|ve compe|
|00000c30| 6c 6c 69 6e 67 20 72 65 | 61 73 6f 6e 73 20 74 6f |lling re|asons to|
|00000c40| 20 74 72 61 6e 73 6c 61 | 74 65 20 79 6f 75 72 20 | transla|te your |
|00000c50| 65 78 69 73 74 69 6e 67 | 0d 0a 20 20 20 73 6f 75 |existing|.. sou|
|00000c60| 72 63 65 20 74 6f 20 41 | 64 61 2e 20 49 6e 20 74 |rce to A|da. In t|
|00000c70| 68 61 74 20 63 61 73 65 | 2c 20 68 65 72 65 20 69 |hat case|, here i|
|00000c80| 73 20 61 20 6c 69 73 74 | 20 6f 66 20 61 76 61 69 |s a list| of avai|
|00000c90| 6c 61 62 6c 65 20 74 72 | 61 6e 73 6c 61 74 6f 72 |lable tr|anslator|
|00000ca0| 73 3a 0d 0a 0d 0a 20 20 | 20 20 20 2a 20 50 61 73 |s:.... | * Pas|
|00000cb0| 63 61 6c 20 74 6f 20 41 | 64 61 3a 0d 0a 0d 0a 20 |cal to A|da:.... |
|00000cc0| 20 20 20 20 20 20 52 2e | 52 2e 20 53 6f 66 74 77 | R.|R. Softw|
|00000cd0| 61 72 65 27 73 20 50 61 | 73 74 72 61 6e 20 70 72 |are's Pa|stran pr|
|00000ce0| 6f 67 72 61 6d 20 28 50 | 61 73 63 61 6c 20 74 6f |ogram (P|ascal to|
|00000cf0| 20 41 64 61 20 54 72 61 | 6e 73 6c 61 74 6f 72 29 | Ada Tra|nslator)|
|00000d00| 2e 0d 0a 0d 0a 20 20 20 | 20 20 20 20 54 6f 20 73 |..... | To s|
|00000d10| 65 65 20 74 68 65 20 64 | 69 66 66 65 72 65 6e 63 |ee the d|ifferenc|
|00000d20| 65 73 20 69 6e 20 70 72 | 6f 67 72 61 6d 6d 69 6e |es in pr|ogrammin|
|00000d30| 67 20 73 74 79 6c 65 2c | 20 73 65 65 20 22 41 64 |g style,| see "Ad|
|00000d40| 61 20 66 6f 72 0d 0a 20 | 20 20 20 20 20 20 45 78 |a for.. | Ex|
|00000d50| 70 65 72 69 65 6e 63 65 | 64 20 50 72 6f 67 72 61 |perience|d Progra|
|00000d60| 6d 6d 65 72 73 22 2c 20 | 62 79 20 41 2e 20 4e 69 |mmers", |by A. Ni|
|00000d70| 63 6f 20 48 61 62 65 72 | 6d 61 6e 6e 20 61 6e 64 |co Haber|mann and|
|00000d80| 20 44 65 77 61 79 6e 65 | 20 45 2e 0d 0a 20 20 20 | Dewayne| E... |
|00000d90| 20 20 20 20 50 65 72 72 | 79 20 28 41 64 64 69 73 | Perr|y (Addis|
|00000da0| 6f 6e 2d 57 65 73 6c 65 | 79 20 50 75 62 2e 20 43 |on-Wesle|y Pub. C|
|00000db0| 6f 2e 2c 20 52 65 61 64 | 69 6e 67 2c 20 4d 61 73 |o., Read|ing, Mas|
|00000dc0| 73 2e 2c 20 31 39 38 33 | 29 2e 20 43 6f 76 65 72 |s., 1983|). Cover|
|00000dd0| 73 20 41 64 61 0d 0a 20 | 20 20 20 20 20 20 61 6e |s Ada.. | an|
|00000de0| 64 20 50 61 73 63 61 6c | 2e 0d 0a 0d 0a 20 20 20 |d Pascal|..... |
|00000df0| 20 20 2a 20 46 6f 72 74 | 72 61 6e 20 74 6f 20 41 | * Fort|ran to A|
|00000e00| 64 61 3a 20 3f 3f 3f 0d | 0a 0d 0a 20 20 20 20 20 |da: ???.|... |
|00000e10| 2a 20 43 4f 42 4f 4c 20 | 74 6f 20 41 64 61 3a 20 |* COBOL |to Ada: |
|00000e20| 3f 3f 3f 0d 0a 0d 0a 20 | 20 20 20 20 2a 20 43 2b |???.... | * C+|
|00000e30| 2b 20 74 6f 20 41 64 61 | 3a 20 3f 3f 3f 0d 0a 0d |+ to Ada|: ???...|
|00000e40| 0a 20 20 20 20 20 2a 20 | 43 20 74 6f 20 41 64 61 |. * |C to Ada|
|00000e50| 3a 20 3f 3f 3f 0d 0a 0d | 0a 20 20 20 20 20 2a 20 |: ???...|. * |
|00000e60| 4d 6f 64 75 6c 61 2d 32 | 20 74 6f 20 41 64 61 3a |Modula-2| to Ada:|
|00000e70| 0d 0a 0d 0a 20 20 20 20 | 20 20 20 28 66 72 6f 6d |.... | (from|
|00000e80| 20 57 61 79 6e 65 20 52 | 2e 20 4c 61 77 74 6f 6e | Wayne R|. Lawton|
|00000e90| 29 0d 0a 20 20 20 20 20 | 20 20 54 68 65 20 49 64 |).. | The Id|
|00000ea0| 61 68 6f 20 4e 61 74 69 | 6f 6e 61 6c 20 45 6e 67 |aho Nati|onal Eng|
|00000eb0| 69 6e 65 65 72 69 6e 67 | 20 4c 61 62 6f 72 61 74 |ineering| Laborat|
|00000ec0| 6f 72 79 20 28 49 4e 45 | 4c 29 2c 20 61 20 44 65 |ory (INE|L), a De|
|00000ed0| 70 74 20 6f 66 20 45 6e | 65 72 67 79 0d 0a 20 20 |pt of En|ergy.. |
|00000ee0| 20 20 20 20 20 4c 61 62 | 20 68 61 73 20 61 20 62 | Lab| has a b|
|00000ef0| 61 73 69 63 20 63 61 70 | 61 62 69 6c 69 74 79 20 |asic cap|ability |
|00000f00| 66 6f 72 20 4d 6f 64 75 | 6c 61 2d 32 20 74 6f 20 |for Modu|la-2 to |
|00000f10| 41 64 61 2d 38 33 2e 20 | 54 68 65 20 74 6f 6f 6c |Ada-83. |The tool|
|00000f20| 20 69 73 0d 0a 20 20 20 | 20 20 20 20 22 72 65 73 | is.. | "res|
|00000f30| 65 61 72 63 68 20 67 72 | 61 64 65 22 20 71 75 61 |earch gr|ade" qua|
|00000f40| 6c 69 74 79 2c 20 62 75 | 74 20 6d 61 79 20 70 72 |lity, bu|t may pr|
|00000f50| 6f 76 69 64 65 20 61 20 | 73 74 61 72 74 69 6e 67 |ovide a |starting|
|00000f60| 20 70 6f 69 6e 74 20 66 | 6f 72 0d 0a 20 20 20 20 | point f|or.. |
|00000f70| 20 20 20 77 68 61 74 20 | 79 6f 75 20 6e 65 65 64 | what |you need|
|00000f80| 2e 20 54 68 69 73 20 69 | 73 20 74 68 65 20 73 61 |. This i|s the sa|
|00000f90| 6d 65 20 67 72 6f 75 70 | 20 6f 66 20 70 65 6f 70 |me group| of peop|
|00000fa0| 6c 65 20 77 68 6f 20 62 | 72 6f 75 67 68 74 20 79 |le who b|rought y|
|00000fb0| 6f 75 0d 0a 20 20 20 20 | 20 20 20 41 64 61 53 41 |ou.. | AdaSA|
|00000fc0| 47 45 2e 20 47 69 76 65 | 20 74 68 65 6d 20 61 20 |GE. Give| them a |
|00000fd0| 72 69 6e 67 20 61 74 20 | 28 32 30 38 29 20 35 32 |ring at |(208) 52|
|00000fe0| 36 2d 30 36 35 36 2e 20 | 54 68 69 73 20 69 73 20 |6-0656. |This is |
|00000ff0| 61 6e 20 61 6e 73 77 65 | 72 0d 0a 20 20 20 20 20 |an answe|r.. |
|00001000| 20 20 64 65 73 6b 20 68 | 6f 74 6c 69 6e 65 20 69 | desk h|otline i|
|00001010| 6e 20 74 68 65 20 73 65 | 63 74 69 6f 6e 20 74 68 |n the se|ction th|
|00001020| 61 74 20 77 72 6f 74 65 | 20 74 68 65 20 74 6f 6f |at wrote| the too|
|00001030| 6c 2e 0d 0a 0d 0a 20 20 | 20 20 20 20 20 49 66 20 |l..... | If |
|00001040| 79 6f 75 20 61 72 65 20 | 6c 6f 6f 6b 69 6e 67 20 |you are |looking |
|00001050| 66 6f 72 20 63 6f 6d 6d | 65 72 63 69 61 6c 20 71 |for comm|ercial q|
|00001060| 75 61 6c 69 74 79 2c 20 | 49 20 77 69 73 68 20 79 |uality, |I wish y|
|00001070| 6f 75 20 74 68 65 20 62 | 65 73 74 20 6f 66 0d 0a |ou the b|est of..|
|00001080| 20 20 20 20 20 20 20 6c | 75 63 6b 2e 20 49 66 20 | l|uck. If |
|00001090| 79 6f 75 20 6a 75 73 74 | 20 6e 65 65 64 20 73 6f |you just| need so|
|000010a0| 6d 65 74 68 69 6e 67 20 | 74 6f 20 70 65 72 66 6f |mething |to perfo|
|000010b0| 72 6d 20 38 30 25 20 6f | 66 20 74 68 65 20 67 72 |rm 80% o|f the gr|
|000010c0| 75 6e 74 20 63 6f 64 65 | 0d 0a 20 20 20 20 20 20 |unt code|.. |
|000010d0| 20 74 72 61 6e 73 6c 61 | 74 69 6f 6e 2c 20 49 20 | transla|tion, I |
|000010e0| 74 68 69 6e 6b 20 74 68 | 69 73 20 6d 69 67 68 74 |think th|is might|
|000010f0| 20 6d 65 65 74 20 79 6f | 75 72 20 6e 65 65 64 73 | meet yo|ur needs|
|00001100| 2e 20 49 20 6b 6e 6f 77 | 20 6f 66 20 74 77 6f 0d |. I know| of two.|
|00001110| 0a 20 20 20 20 20 20 20 | 73 79 73 74 65 6d 73 20 |. |systems |
|00001120| 63 6f 6d 70 72 69 73 69 | 6e 67 20 61 62 6f 75 74 |comprisi|ng about|
|00001130| 20 32 35 30 2c 30 30 30 | 20 6c 69 6e 65 73 20 6f | 250,000| lines o|
|00001140| 66 20 63 6f 64 65 20 74 | 68 61 74 20 77 65 72 65 |f code t|hat were|
|00001150| 0d 0a 20 20 20 20 20 20 | 20 6f 72 69 67 69 6e 61 |.. | origina|
|00001160| 6c 6c 79 20 64 65 76 65 | 6c 6f 70 65 64 20 69 6e |lly deve|loped in|
|00001170| 20 4d 6f 64 75 6c 61 2d | 32 20 74 68 65 6e 20 74 | Modula-|2 then t|
|00001180| 72 61 6e 73 6c 61 74 65 | 64 20 61 6e 64 20 63 6c |ranslate|d and cl|
|00001190| 65 61 6e 65 64 20 75 70 | 20 69 6e 0d 0a 20 20 20 |eaned up| in.. |
|000011a0| 20 20 20 20 41 64 61 20 | 38 33 20 61 66 74 65 72 | Ada |83 after|
|000011b0| 20 41 6c 73 79 73 20 31 | 2e 30 20 66 6f 72 20 74 | Alsys 1|.0 for t|
|000011c0| 68 65 20 50 43 20 63 61 | 6d 65 20 6f 75 74 20 62 |he PC ca|me out b|
|000011d0| 61 63 6b 20 61 72 6f 75 | 6e 64 20 31 39 38 37 2e |ack arou|nd 1987.|
|000011e0| 0d 0a 0d 0a 20 20 20 20 | 20 2a 20 56 69 73 75 61 |.... | * Visua|
|000011f0| 6c 20 42 61 73 69 63 20 | 74 6f 20 41 64 61 3a 20 |l Basic |to Ada: |
|00001200| 4e 4f 54 21 20 3a 2d 29 | 0d 0a 0d 0a 0d 0a 39 2e |NOT! :-)|......9.|
|00001210| 32 3a 20 48 6f 77 20 63 | 61 6e 20 49 20 63 6f 6e |2: How c|an I con|
|00001220| 76 65 72 74 20 41 64 61 | 20 38 33 20 73 6f 75 72 |vert Ada| 83 sour|
|00001230| 63 65 73 20 74 6f 20 41 | 64 61 20 39 58 3f 0d 0a |ces to A|da 9X?..|
|00001240| 0d 0a 20 20 20 46 69 72 | 73 74 20 79 6f 75 20 73 |.. Fir|st you s|
|00001250| 68 6f 75 6c 64 20 72 65 | 61 64 20 74 68 65 20 66 |hould re|ad the f|
|00001260| 6f 6c 6c 6f 77 69 6e 67 | 20 64 6f 63 75 6d 65 6e |ollowing| documen|
|00001270| 74 2c 20 77 68 69 63 68 | 20 77 69 6c 6c 20 70 72 |t, which| will pr|
|00001280| 6f 76 69 64 65 20 79 6f | 75 0d 0a 20 20 20 77 69 |ovide yo|u.. wi|
|00001290| 74 68 20 6d 75 63 68 20 | 75 73 65 66 75 6c 20 69 |th much |useful i|
|000012a0| 6e 66 6f 72 6d 61 74 69 | 6f 6e 3a 20 22 43 68 61 |nformati|on: "Cha|
|000012b0| 6e 67 65 73 20 74 6f 20 | 41 64 61 20 2d 2d 20 31 |nges to |Ada -- 1|
|000012c0| 39 38 37 20 74 6f 20 31 | 39 39 35 22 2c 20 66 69 |987 to 1|995", fi|
|000012d0| 6c 65 0d 0a 20 20 20 63 | 68 38 33 2e 7b 70 73 2c |le.. c|h83.{ps,|
|000012e0| 64 6f 63 7d 2c 20 69 6e | 20 64 69 72 65 63 74 6f |doc}, in| directo|
|000012f0| 72 79 0d 0a 20 20 20 66 | 74 70 3a 2f 2f 73 77 2d |ry.. f|tp://sw-|
|00001300| 65 6e 67 2e 66 61 6c 6c | 73 2d 63 68 75 72 63 68 |eng.fall|s-church|
|00001310| 2e 76 61 2e 75 73 2f 70 | 75 62 6c 69 63 2f 41 64 |.va.us/p|ublic/Ad|
|00001320| 61 49 43 2f 73 74 61 6e | 64 61 72 64 73 2f 39 35 |aIC/stan|dards/95|
|00001330| 6c 72 6d 5f 72 61 74 2f | 76 36 2e 30 0d 0a 0d 0a |lrm_rat/|v6.0....|
|00001340| 0d 0a 20 20 20 49 66 20 | 79 6f 75 27 72 65 20 75 |.. If |you're u|
|00001350| 73 69 6e 67 20 47 4e 41 | 54 2c 20 74 68 65 20 74 |sing GNA|T, the t|
|00001360| 6f 6f 6c 20 79 6f 75 20 | 61 72 65 20 70 72 6f 62 |ool you |are prob|
|00001370| 61 62 6c 79 20 6c 6f 6f | 6b 69 6e 67 20 66 6f 72 |ably loo|king for|
|00001380| 20 69 73 0d 0a 20 20 20 | 22 67 6e 61 74 63 68 6f | is.. |"gnatcho|
|00001390| 70 22 2e 20 49 6e 20 63 | 73 68 20 79 6f 75 20 63 |p". In c|sh you c|
|000013a0| 6f 75 6c 64 20 75 73 65 | 20 73 6f 6d 65 74 68 69 |ould use| somethi|
|000013b0| 6e 67 20 6c 69 6b 65 20 | 74 68 69 73 20 74 6f 20 |ng like |this to |
|000013c0| 71 75 69 63 6b 6c 79 0d | 0a 20 20 20 70 72 6f 63 |quickly.|. proc|
|000013d0| 65 73 73 20 65 78 69 73 | 74 69 6e 67 20 66 69 6c |ess exis|ting fil|
|000013e0| 65 73 3a 0d 0a 0d 0a 20 | 20 20 20 20 63 64 20 64 |es:.... | cd d|
|000013f0| 65 73 74 5f 64 69 72 20 | 20 20 20 20 20 20 20 20 |est_dir | |
|00001400| 20 20 20 20 20 20 20 20 | 20 20 20 23 20 54 68 65 | | # The|
|00001410| 20 64 65 73 74 69 6e 61 | 74 69 6f 6e 20 64 69 72 | destina|tion dir|
|00001420| 65 63 74 6f 72 79 0d 0a | 20 20 20 20 20 66 6f 72 |ectory..| for|
|00001430| 65 61 63 68 20 66 20 28 | 20 2e 2e 2f 73 72 63 5f |each f (| ../src_|
|00001440| 64 69 72 2f 2a 2e 61 20 | 29 20 20 20 23 20 2e 2e |dir/*.a |) # ..|
|00001450| 2f 73 72 63 5f 64 69 72 | 20 69 73 20 74 68 65 20 |/src_dir| is the |
|00001460| 73 6f 75 72 63 65 20 64 | 69 72 65 63 74 6f 72 79 |source d|irectory|
|00001470| 0d 0a 20 20 20 20 20 20 | 20 67 6e 61 74 63 68 6f |.. | gnatcho|
|00001480| 70 20 24 66 0d 0a 20 20 | 20 20 20 65 6e 64 0d 0a |p $f.. | end..|
|00001490| 0d 0a 20 20 20 67 6e 61 | 74 63 68 6f 70 20 77 69 |.. gna|tchop wi|
|000014a0| 6c 6c 20 73 68 6f 77 20 | 79 6f 75 20 77 68 61 74 |ll show |you what|
|000014b0| 20 73 6f 75 72 63 65 73 | 20 61 72 65 20 63 61 75 | sources| are cau|
|000014c0| 73 69 6e 67 20 70 72 6f | 62 6c 65 6d 73 2e 0d 0a |sing pro|blems...|
|000014d0| 0d 0a 0d 0a 39 2e 33 3a | 20 49 20 68 65 61 72 20 |....9.3:| I hear |
|000014e0| 74 68 61 74 20 41 64 61 | 20 69 73 20 73 6c 6f 77 |that Ada| is slow|
|000014f0| 65 72 20 74 68 61 6e 20 | 46 6f 72 74 72 61 6e 20 |er than |Fortran |
|00001500| 6f 72 20 43 2c 20 69 73 | 20 74 68 61 74 20 74 72 |or C, is| that tr|
|00001510| 75 65 3f 0d 0a 0d 0a 20 | 20 20 46 69 72 73 74 2c |ue?.... | First,|
|00001520| 20 6e 6f 74 65 20 74 68 | 61 74 20 79 6f 75 20 61 | note th|at you a|
|00001530| 72 65 20 63 6f 6d 70 61 | 72 69 6e 67 20 63 6f 6d |re compa|ring com|
|00001540| 70 69 6c 65 72 73 2c 20 | 6e 6f 74 20 6c 61 6e 67 |pilers, |not lang|
|00001550| 75 61 67 65 73 2e 20 54 | 68 65 72 65 20 69 73 0d |uages. T|here is.|
|00001560| 0a 20 20 20 6e 6f 20 73 | 75 63 68 20 74 68 69 6e |. no s|uch thin|
|00001570| 67 20 61 73 20 22 66 61 | 73 74 22 20 41 64 61 20 |g as "fa|st" Ada |
|00001580| 63 6f 64 65 20 61 6e 79 | 20 6d 6f 72 65 20 74 68 |code any| more th|
|00001590| 61 6e 20 74 68 65 72 65 | 20 69 73 20 22 66 61 73 |an there| is "fas|
|000015a0| 74 22 20 43 2b 2b 20 6f | 72 0d 0a 20 20 20 46 6f |t" C++ o|r.. Fo|
|000015b0| 72 74 72 61 6e 20 63 6f | 64 65 2e 20 4e 6f 77 2c |rtran co|de. Now,|
|000015c0| 20 77 68 65 6e 20 63 6f | 6d 70 61 72 69 6e 67 20 | when co|mparing |
|000015d0| 65 78 65 63 75 74 69 6f | 6e 20 73 70 65 65 64 73 |executio|n speeds|
|000015e0| 20 6f 6e 20 73 69 6d 69 | 6c 61 72 0d 0a 20 20 20 | on simi|lar.. |
|000015f0| 70 6c 61 74 66 6f 72 6d | 73 2c 20 79 6f 75 20 6d |platform|s, you m|
|00001600| 75 73 74 20 6b 65 65 70 | 20 69 6e 20 6d 69 6e 64 |ust keep| in mind|
|00001610| 20 74 68 65 20 6f 70 74 | 69 6d 69 7a 61 74 69 6f | the opt|imizatio|
|00001620| 6e 20 6c 65 76 65 6c 73 | 2c 20 4f 53 20 74 75 6e |n levels|, OS tun|
|00001630| 69 6e 67 2c 0d 0a 20 20 | 20 65 74 63 2e 20 77 68 |ing,.. | etc. wh|
|00001640| 69 6c 65 20 6d 61 6b 69 | 6e 67 20 74 68 65 20 63 |ile maki|ng the c|
|00001650| 6f 6d 70 61 72 69 73 6f | 6e 73 2e 20 54 68 65 20 |ompariso|ns. The |
|00001660| 62 6f 74 74 6f 6d 20 6c | 69 6e 65 20 69 73 20 74 |bottom l|ine is t|
|00001670| 68 61 74 0d 0a 20 20 20 | 62 65 6e 63 68 6d 61 72 |hat.. |benchmar|
|00001680| 6b 69 6e 67 2c 20 65 73 | 70 65 63 69 61 6c 6c 79 |king, es|pecially|
|00001690| 20 62 65 74 77 65 65 6e | 20 74 77 6f 20 64 69 66 | between| two dif|
|000016a0| 66 65 72 65 6e 74 20 6c | 61 6e 67 75 61 67 65 73 |ferent l|anguages|
|000016b0| 2c 20 72 65 71 75 69 72 | 65 73 0d 0a 20 20 20 5f |, requir|es.. _|
|000016c0| 76 65 72 79 5f 20 63 61 | 72 65 66 75 6c 20 6d 65 |very_ ca|reful me|
|000016d0| 61 73 75 72 65 6d 65 6e | 74 2e 20 49 6e 20 67 65 |asuremen|t. In ge|
|000016e0| 6e 65 72 61 6c 2c 20 73 | 75 63 68 20 72 65 73 75 |neral, s|uch resu|
|000016f0| 6c 74 73 20 73 68 6f 75 | 6c 64 20 62 65 20 76 69 |lts shou|ld be vi|
|00001700| 65 77 65 64 0d 0a 20 20 | 20 77 69 74 68 20 63 61 |ewed.. | with ca|
|00001710| 75 74 69 6f 6e 2e 0d 0a | 0d 0a 20 20 20 28 41 20 |ution...|.. (A |
|00001720| 6d 65 73 73 61 67 65 20 | 66 72 6f 6d 20 42 65 76 |message |from Bev|
|00001730| 69 6e 20 42 72 65 74 74 | 20 6f 66 20 44 45 43 29 |in Brett| of DEC)|
|00001740| 0d 0a 0d 0a 20 20 20 49 | 20 68 61 76 65 20 62 65 |.... I| have be|
|00001750| 65 6e 20 61 73 6b 65 64 | 20 74 6f 20 63 6f 6d 6d |en asked| to comm|
|00001760| 65 6e 74 20 6f 6e 20 74 | 68 65 20 72 65 6c 61 74 |ent on t|he relat|
|00001770| 69 76 65 20 70 65 72 66 | 6f 72 6d 61 6e 63 65 20 |ive perf|ormance |
|00001780| 6f 66 20 61 6c 67 6f 72 | 69 74 68 6d 73 0d 0a 20 |of algor|ithms.. |
|00001790| 20 20 63 6f 64 65 64 20 | 69 6e 20 41 64 61 20 61 | coded |in Ada a|
|000017a0| 6e 64 20 69 6e 20 46 6f | 72 74 72 61 6e 2e 0d 0a |nd in Fo|rtran...|
|000017b0| 0d 0a 20 20 20 54 68 69 | 73 20 71 75 65 73 74 69 |.. Thi|s questi|
|000017c0| 6f 6e 20 68 61 73 20 63 | 6f 6d 65 20 75 70 20 72 |on has c|ome up r|
|000017d0| 65 70 65 61 74 65 64 6c | 79 20 6f 76 65 72 20 74 |epeatedl|y over t|
|000017e0| 68 65 20 79 65 61 72 73 | 2c 20 61 6e 64 20 64 65 |he years|, and de|
|000017f0| 73 65 72 76 65 73 20 61 | 0d 0a 20 20 20 63 6f 6d |serves a|.. com|
|00001800| 70 6c 65 74 65 20 61 6e | 73 77 65 72 2c 20 72 61 |plete an|swer, ra|
|00001810| 74 68 65 72 20 74 68 61 | 6e 20 61 20 73 69 6d 70 |ther tha|n a simp|
|00001820| 6c 69 73 74 69 63 20 6f | 6e 65 2e 0d 0a 0d 0a 20 |listic o|ne..... |
|00001830| 20 20 54 68 65 72 65 20 | 61 72 65 20 6d 61 6e 79 | There |are many|
|00001840| 20 66 61 63 74 6f 72 73 | 20 77 68 69 63 68 20 69 | factors| which i|
|00001850| 6e 66 6c 75 65 6e 63 65 | 20 74 68 65 20 73 69 7a |nfluence| the siz|
|00001860| 65 20 61 6e 64 20 65 78 | 65 63 75 74 69 6f 6e 20 |e and ex|ecution |
|00001870| 73 70 65 65 64 20 6f 66 | 0d 0a 20 20 20 74 68 65 |speed of|.. the|
|00001880| 20 72 75 6e 6e 69 6e 67 | 20 70 72 6f 67 72 61 6d | running| program|
|00001890| 2c 20 61 6e 64 20 74 68 | 65 79 20 61 6c 6c 20 70 |, and th|ey all p|
|000018a0| 6c 61 79 20 74 6f 67 65 | 74 68 65 72 20 74 6f 20 |lay toge|ther to |
|000018b0| 67 65 74 20 61 20 66 75 | 6c 6c 20 61 6e 73 77 65 |get a fu|ll answe|
|000018c0| 72 2e 0d 0a 20 20 20 49 | 20 73 68 61 6c 6c 20 74 |r... I| shall t|
|000018d0| 68 65 6e 20 64 69 73 63 | 75 73 73 20 61 6e 20 65 |hen disc|uss an e|
|000018e0| 78 61 63 74 20 41 64 61 | 20 76 2e 20 46 6f 72 74 |xact Ada| v. Fort|
|000018f0| 72 61 6e 20 63 6f 6d 70 | 61 72 69 73 6f 6e 20 74 |ran comp|arison t|
|00001900| 68 61 74 20 44 69 67 69 | 74 61 6c 0d 0a 20 20 20 |hat Digi|tal.. |
|00001910| 77 61 73 20 69 6e 76 6f | 6c 76 65 64 20 69 6e 2e |was invo|lved in.|
|00001920| 0d 0a 0d 0a 20 20 20 46 | 69 72 73 74 2c 20 61 20 |.... F|irst, a |
|00001930| 70 6f 73 69 74 69 6f 6e | 20 73 74 61 74 65 6d 65 |position| stateme|
|00001940| 6e 74 3a 20 54 68 65 20 | 76 61 72 69 61 74 69 6f |nt: The |variatio|
|00001950| 6e 20 62 65 74 77 65 65 | 6e 20 41 64 61 20 61 6e |n betwee|n Ada an|
|00001960| 64 20 46 6f 72 74 72 61 | 6e 20 69 73 0d 0a 20 20 |d Fortra|n is.. |
|00001970| 20 6c 65 73 73 20 74 68 | 61 6e 20 74 68 65 20 76 | less th|an the v|
|00001980| 61 72 69 61 74 69 6f 6e | 20 77 69 74 68 69 6e 20 |ariation| within |
|00001990| 74 68 65 20 6c 61 6e 67 | 75 61 67 65 20 63 61 75 |the lang|uage cau|
|000019a0| 73 65 64 20 62 79 20 74 | 68 65 20 65 78 61 63 74 |sed by t|he exact|
|000019b0| 0d 0a 20 20 20 69 6d 70 | 6c 65 6d 65 6e 74 61 74 |.. imp|lementat|
|000019c0| 69 6f 6e 20 64 65 74 61 | 69 6c 73 2e 20 41 20 70 |ion deta|ils. A p|
|000019d0| 65 72 73 6f 6e 20 76 65 | 72 73 65 64 20 69 6e 20 |erson ve|rsed in |
|000019e0| 74 68 65 20 41 64 61 20 | 69 73 73 75 65 73 20 73 |the Ada |issues s|
|000019f0| 68 6f 75 6c 64 20 64 6f | 20 61 73 0d 0a 20 20 20 |hould do| as.. |
|00001a00| 77 65 6c 6c 20 69 6e 20 | 41 64 61 20 61 73 20 61 |well in |Ada as a|
|00001a10| 20 70 65 72 73 6f 6e 20 | 76 65 72 73 65 64 20 69 | person |versed i|
|00001a20| 6e 20 74 68 65 20 46 6f | 72 74 72 61 6e 20 69 73 |n the Fo|rtran is|
|00001a30| 73 75 65 73 20 77 69 6c | 6c 20 64 6f 20 69 6e 0d |sues wil|l do in.|
|00001a40| 0a 20 20 20 46 6f 72 74 | 72 61 6e 2e 20 54 68 65 |. Fort|ran. The|
|00001a50| 20 73 69 7a 65 20 61 6e | 64 20 65 78 65 63 75 74 | size an|d execut|
|00001a60| 69 6f 6e 20 73 70 65 65 | 64 20 6f 66 20 74 68 65 |ion spee|d of the|
|00001a70| 20 72 65 73 75 6c 74 20 | 73 68 6f 75 6c 64 20 62 | result |should b|
|00001a80| 65 20 77 69 74 68 69 6e | 20 61 0d 0a 20 20 20 66 |e within| a.. f|
|00001a90| 65 77 20 70 65 72 63 65 | 6e 74 20 6f 66 20 65 61 |ew perce|nt of ea|
|00001aa0| 63 68 20 6f 74 68 65 72 | 2e 0d 0a 0d 0a 20 20 20 |ch other|..... |
|00001ab0| 28 61 29 20 44 69 66 66 | 65 72 65 6e 63 65 73 20 |(a) Diff|erences |
|00001ac0| 64 75 65 20 74 6f 20 74 | 68 65 20 63 6f 6d 70 69 |due to t|he compi|
|00001ad0| 6c 65 72 0d 0a 0d 0a 20 | 20 20 49 6e 20 74 68 65 |ler.... | In the|
|00001ae0| 20 63 61 73 65 20 6f 66 | 20 74 68 65 20 44 45 43 | case of| the DEC|
|00001af0| 20 41 64 61 20 61 6e 64 | 20 46 6f 72 74 72 61 6e | Ada and| Fortran|
|00001b00| 20 63 6f 6d 70 69 6c 65 | 72 73 2c 20 74 68 65 20 | compile|rs, the |
|00001b10| 6f 70 74 69 6d 69 7a 65 | 72 20 61 6e 64 0d 0a 20 |optimize|r and.. |
|00001b20| 20 20 20 20 20 20 63 6f | 64 65 20 67 65 6e 65 72 | co|de gener|
|00001b30| 61 74 6f 72 20 61 72 65 | 20 74 68 65 20 73 61 6d |ator are| the sam|
|00001b40| 65 2e 20 4e 65 76 65 72 | 2d 74 68 65 2d 6c 65 73 |e. Never|-the-les|
|00001b50| 73 2c 20 74 68 65 20 65 | 78 61 63 74 20 69 6e 70 |s, the e|xact inp|
|00001b60| 75 74 73 20 69 6e 74 6f | 0d 0a 20 20 20 20 20 20 |uts into|.. |
|00001b70| 20 74 68 65 20 6f 70 74 | 69 6d 69 7a 65 72 20 61 | the opt|imizer a|
|00001b80| 6e 64 20 63 6f 64 65 20 | 67 65 6e 65 72 61 74 6f |nd code |generato|
|00001b90| 72 20 6d 61 79 20 64 69 | 66 66 65 72 20 73 6c 69 |r may di|ffer sli|
|00001ba0| 67 68 74 6c 79 20 77 68 | 65 6e 20 74 68 65 20 73 |ghtly wh|en the s|
|00001bb0| 61 6d 65 0d 0a 20 20 20 | 20 20 20 20 61 6c 67 6f |ame.. | algo|
|00001bc0| 72 69 74 68 6d 20 69 73 | 20 63 6f 6d 70 69 6c 65 |rithm is| compile|
|00001bd0| 64 20 62 79 20 74 68 65 | 20 41 64 61 20 61 6e 64 |d by the| Ada and|
|00001be0| 20 46 6f 72 74 72 61 6e | 20 63 6f 6d 70 69 6c 65 | Fortran| compile|
|00001bf0| 72 73 2c 20 61 6e 64 20 | 74 68 69 73 0d 0a 20 20 |rs, and |this.. |
|00001c00| 20 20 20 20 20 63 61 6e | 20 72 65 73 75 6c 74 20 | can| result |
|00001c10| 69 6e 20 6d 61 6a 6f 72 | 20 64 69 66 66 65 72 65 |in major| differe|
|00001c20| 6e 63 65 73 20 69 6e 20 | 74 68 65 20 67 65 6e 65 |nces in |the gene|
|00001c30| 72 61 74 65 64 20 63 6f | 64 65 2e 20 49 6e 20 74 |rated co|de. In t|
|00001c40| 68 65 73 65 0d 0a 20 20 | 20 20 20 20 20 63 61 73 |hese.. | cas|
|00001c50| 65 73 20 74 68 65 20 63 | 6f 6d 70 69 6c 65 72 20 |es the c|ompiler |
|00001c60| 66 72 6f 6e 74 20 65 6e | 64 73 20 63 61 6e 20 75 |front en|ds can u|
|00001c70| 73 75 61 6c 6c 79 20 62 | 65 20 6d 6f 64 69 66 69 |sually b|e modifi|
|00001c80| 65 64 20 74 6f 20 63 6f | 72 72 65 63 74 0d 0a 20 |ed to co|rrect.. |
|00001c90| 20 20 20 20 20 20 74 68 | 65 20 73 6c 6f 77 65 72 | th|e slower|
|00001ca0| 20 6f 6e 65 2e 0d 0a 0d | 0a 20 20 20 20 20 20 20 | one....|. |
|00001cb0| 57 65 20 68 61 76 65 20 | 6e 6f 74 20 6f 62 73 65 |We have |not obse|
|00001cc0| 72 76 65 64 20 61 6e 79 | 20 6d 61 6a 6f 72 20 64 |rved any| major d|
|00001cd0| 69 66 66 65 72 65 6e 63 | 65 73 20 69 6e 20 67 65 |ifferenc|es in ge|
|00001ce0| 6e 65 72 61 74 65 64 20 | 63 6f 64 65 0d 0a 20 20 |nerated |code.. |
|00001cf0| 20 20 20 20 20 71 75 61 | 6c 69 74 79 20 62 65 74 | qua|lity bet|
|00001d00| 77 65 65 6e 20 74 68 65 | 20 44 45 43 20 41 64 61 |ween the| DEC Ada|
|00001d10| 20 61 6e 64 20 44 45 43 | 20 46 6f 72 74 72 61 6e | and DEC| Fortran|
|00001d20| 20 63 6f 6d 70 69 6c 65 | 72 73 20 63 61 75 73 65 | compile|rs cause|
|00001d30| 64 20 62 79 0d 0a 20 20 | 20 20 20 20 20 73 75 63 |d by.. | suc|
|00001d40| 68 20 69 73 73 75 65 73 | 2e 0d 0a 0d 0a 0d 0a 20 |h issues|....... |
|00001d50| 20 20 28 62 29 20 44 69 | 66 66 65 72 65 6e 63 65 | (b) Di|fference|
|00001d60| 73 20 64 75 65 20 74 6f | 20 74 68 65 20 6c 61 6e |s due to| the lan|
|00001d70| 67 75 61 67 65 0d 0a 0d | 0a 20 20 20 49 74 20 69 |guage...|. It i|
|00001d80| 73 20 76 65 72 79 20 69 | 6d 70 6f 72 74 61 6e 74 |s very i|mportant|
|00001d90| 20 74 68 61 74 20 74 68 | 65 20 73 61 6d 65 20 61 | that th|e same a|
|00001da0| 6c 67 6f 72 69 74 68 6d | 20 62 65 20 77 72 69 74 |lgorithm| be writ|
|00001db0| 74 65 6e 20 69 6e 20 74 | 68 65 20 74 77 6f 0d 0a |ten in t|he two..|
|00001dc0| 20 20 20 20 20 20 20 6c | 61 6e 67 75 61 67 65 73 | l|anguages|
|00001dd0| 2e 20 54 68 65 20 62 69 | 67 67 65 73 74 20 64 69 |. The bi|ggest di|
|00001de0| 66 66 65 72 65 6e 63 65 | 73 20 77 65 20 68 61 76 |fference|s we hav|
|00001df0| 65 20 6f 62 73 65 72 76 | 65 64 20 61 72 65 0d 0a |e observ|ed are..|
|00001e00| 20 20 20 20 20 20 20 20 | 20 31 2e 20 48 61 76 69 | | 1. Havi|
|00001e10| 6e 67 20 74 68 65 20 77 | 72 6f 6e 67 20 64 69 6d |ng the w|rong dim|
|00001e20| 65 6e 73 69 6f 6e 20 76 | 61 72 79 69 6e 67 20 66 |ension v|arying f|
|00001e30| 61 73 74 65 73 74 2c 20 | 73 69 6e 63 65 20 69 74 |astest, |since it|
|00001e40| 20 69 73 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 | is.. | |
|00001e50| 20 64 65 73 69 72 65 61 | 62 6c 65 20 74 6f 20 68 | desirea|ble to h|
|00001e60| 61 76 65 20 74 68 65 20 | 66 69 72 73 74 20 64 69 |ave the |first di|
|00001e70| 6d 65 6e 73 69 6f 6e 20 | 63 68 61 6e 67 69 6e 67 |mension |changing|
|00001e80| 20 66 61 73 74 65 73 74 | 20 69 6e 0d 0a 20 20 20 | fastest| in.. |
|00001e90| 20 20 20 20 20 20 20 20 | 20 46 6f 72 74 72 61 6e | | Fortran|
|00001ea0| 2c 20 61 6e 64 20 74 68 | 65 20 6c 61 73 74 20 64 |, and th|e last d|
|00001eb0| 69 6d 65 6e 73 69 6f 6e | 20 69 6e 20 41 64 61 2e |imension| in Ada.|
|00001ec0| 20 54 68 75 73 20 77 68 | 65 6e 20 61 6e 0d 0a 20 | Thus wh|en an.. |
|00001ed0| 20 20 20 20 20 20 20 20 | 20 20 20 61 6c 67 6f 72 | | algor|
|00001ee0| 69 74 68 6d 20 69 73 20 | 74 72 61 6e 73 6c 69 74 |ithm is |translit|
|00001ef0| 65 72 61 74 65 64 2c 20 | 74 68 65 20 61 72 72 61 |erated, |the arra|
|00001f00| 79 20 69 6e 64 65 78 65 | 73 20 6d 75 73 74 20 62 |y indexe|s must b|
|00001f10| 65 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 72 |e.. | r|
|00001f20| 65 76 65 72 73 65 64 2e | 0d 0a 0d 0a 20 20 20 20 |eversed.|.... |
|00001f30| 20 20 20 20 20 32 2e 20 | 55 73 69 6e 67 20 63 6f | 2. |Using co|
|00001f40| 6d 70 69 6c 65 2d 74 69 | 6d 65 2d 6b 6e 6f 77 6e |mpile-ti|me-known|
|00001f50| 20 62 6f 75 6e 64 73 20 | 66 6f 72 20 61 72 72 61 | bounds |for arra|
|00001f60| 79 73 20 69 6e 20 46 6f | 72 74 72 61 6e 2c 20 61 |ys in Fo|rtran, a|
|00001f70| 6e 64 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |nd.. | |
|00001f80| 75 73 69 6e 67 20 75 6e | 63 6f 6e 73 74 72 61 69 |using un|constrai|
|00001f90| 6e 65 64 20 61 72 72 61 | 79 73 20 69 6e 20 74 68 |ned arra|ys in th|
|00001fa0| 65 20 41 64 61 20 63 6f | 64 65 2e 20 4b 6e 6f 77 |e Ada co|de. Know|
|00001fb0| 69 6e 67 20 74 68 65 20 | 65 78 61 63 74 0d 0a 20 |ing the |exact.. |
|00001fc0| 20 20 20 20 20 20 20 20 | 20 20 20 76 61 6c 75 65 | | value|
|00001fd0| 73 20 6f 66 20 74 68 65 | 20 64 69 6d 65 6e 73 69 |s of the| dimensi|
|00001fe0| 6f 6e 73 20 61 74 20 63 | 6f 6d 70 69 6c 65 2d 74 |ons at c|ompile-t|
|00001ff0| 69 6d 65 20 72 65 73 75 | 6c 74 73 20 69 6e 20 6d |ime resu|lts in m|
|00002000| 75 63 68 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |uch.. | |
|00002010| 20 62 65 74 74 65 72 20 | 63 6f 64 65 2e 0d 0a 0d | better |code....|
|00002020| 0a 20 20 20 20 20 20 20 | 20 20 33 2e 20 4e 6f 74 |. | 3. Not|
|00002030| 20 73 75 70 70 72 65 73 | 73 69 6e 67 20 61 6c 6c | suppres|sing all|
|00002040| 20 74 68 65 20 72 75 6e | 74 69 6d 65 20 63 68 65 | the run|time che|
|00002050| 63 6b 73 20 69 6e 20 41 | 64 61 2e 20 54 68 65 20 |cks in A|da. The |
|00002060| 46 6f 72 74 72 61 6e 0d | 0a 20 20 20 20 20 20 20 |Fortran.|. |
|00002070| 20 20 20 20 20 63 6f 6d | 70 69 6c 65 72 20 61 73 | com|piler as|
|00002080| 73 75 6d 65 73 20 61 6c | 6c 20 61 72 72 61 79 20 |sumes al|l array |
|00002090| 62 6f 75 6e 64 73 20 61 | 72 65 20 69 6e 20 72 61 |bounds a|re in ra|
|000020a0| 6e 67 65 2c 20 61 6e 64 | 20 61 6c 6c 0d 0a 20 20 |nge, and| all.. |
|000020b0| 20 20 20 20 20 20 20 20 | 20 20 61 72 69 74 68 6d | | arithm|
|000020c0| 65 74 69 63 20 6f 70 65 | 72 61 74 69 6f 6e 73 20 |etic ope|rations |
|000020d0| 64 6f 20 6e 6f 74 20 6f | 76 65 72 66 6c 6f 77 2e |do not o|verflow.|
|000020e0| 20 59 6f 75 20 6d 75 73 | 74 20 75 73 65 20 61 20 | You mus|t use a |
|000020f0| 70 72 61 67 6d 61 0d 0a | 20 20 20 20 20 20 20 20 |pragma..| |
|00002100| 20 20 20 20 53 75 70 70 | 72 65 73 73 20 74 6f 20 | Supp|ress to |
|00002110| 74 65 6c 6c 20 74 68 69 | 73 20 74 6f 20 74 68 65 |tell thi|s to the|
|00002120| 20 41 64 61 20 63 6f 6d | 70 69 6c 65 72 20 61 73 | Ada com|piler as|
|00002130| 20 77 65 6c 6c 2e 0d 0a | 0d 0a 20 20 20 20 20 20 | well...|.. |
|00002140| 20 20 20 34 2e 20 44 6f | 6e 27 74 20 75 73 65 20 | 4. Do|n't use |
|00002150| 61 72 72 61 79 73 20 6f | 66 20 41 64 61 20 42 6f |arrays o|f Ada Bo|
|00002160| 6f 6c 65 61 6e 73 20 74 | 6f 20 6d 61 74 63 68 20 |oleans t|o match |
|00002170| 61 72 72 61 79 73 20 6f | 66 20 46 6f 72 74 72 61 |arrays o|f Fortra|
|00002180| 6e 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 49 |n.. | I|
|00002190| 6e 74 65 67 65 72 73 2c | 20 62 65 63 61 75 73 65 |ntegers,| because|
|000021a0| 20 61 63 63 65 73 73 69 | 6e 67 20 62 79 74 65 73 | accessi|ng bytes|
|000021b0| 20 6f 6e 20 61 20 52 49 | 53 43 20 73 79 73 74 65 | on a RI|SC syste|
|000021c0| 6d 20 6d 69 67 68 74 20 | 62 65 0d 0a 20 20 20 20 |m might |be.. |
|000021d0| 20 20 20 20 20 20 20 20 | 6d 75 63 68 20 77 6f 72 | |much wor|
|000021e0| 73 65 20 74 68 61 6e 20 | 61 63 63 65 73 73 69 6e |se than |accessin|
|000021f0| 67 20 66 75 6c 6c 77 6f | 72 64 73 2e 0d 0a 0d 0a |g fullwo|rds.....|
|00002200| 0d 0a 20 20 20 28 63 29 | 20 44 69 66 66 65 72 65 |.. (c)| Differe|
|00002210| 6e 63 65 73 20 64 75 65 | 20 74 6f 20 74 68 65 20 |nces due| to the |
|00002220| 62 69 6e 64 69 6e 67 73 | 0d 0a 0d 0a 20 20 20 54 |bindings|.... T|
|00002230| 68 65 20 62 69 67 67 65 | 73 74 20 62 69 6e 64 69 |he bigge|st bindi|
|00002240| 6e 67 73 20 64 69 66 66 | 65 72 65 6e 63 65 73 20 |ngs diff|erences |
|00002250| 61 72 65 20 72 65 6c 61 | 74 65 64 20 74 6f 20 46 |are rela|ted to F|
|00002260| 6f 72 74 72 61 6e 27 73 | 20 62 75 69 6c 74 2d 69 |ortran's| built-i|
|00002270| 6e 0d 0a 20 20 20 20 20 | 20 20 73 75 70 70 6f 72 |n.. | suppor|
|00002280| 74 20 66 6f 72 20 63 6f | 6d 70 6c 65 78 20 74 79 |t for co|mplex ty|
|00002290| 70 65 73 2c 20 61 6e 64 | 20 66 6f 72 20 76 61 72 |pes, and| for var|
|000022a0| 69 6f 75 73 20 6d 61 74 | 68 20 72 6f 75 74 69 6e |ious mat|h routin|
|000022b0| 65 73 20 73 75 63 68 20 | 61 73 0d 0a 20 20 20 20 |es such |as.. |
|000022c0| 20 20 20 53 51 52 54 20 | 61 6e 64 20 53 49 4e 2c | SQRT |and SIN,|
|000022d0| 20 63 6f 6d 70 61 72 65 | 64 20 77 69 74 68 20 41 | compare|d with A|
|000022e0| 64 61 20 63 6f 64 65 20 | 74 68 61 74 20 6f 66 74 |da code |that oft|
|000022f0| 65 6e 20 75 73 65 73 20 | 68 61 6e 64 2d 63 6f 64 |en uses |hand-cod|
|00002300| 65 64 20 6f 72 0d 0a 20 | 20 20 20 20 20 20 49 53 |ed or.. | IS|
|00002310| 4f 20 73 74 61 6e 64 61 | 72 64 69 73 65 64 20 76 |O standa|rdised v|
|00002320| 65 72 73 69 6f 6e 73 20 | 6f 66 20 74 68 65 73 65 |ersions |of these|
|00002330| 20 66 75 6e 63 74 69 6f | 6e 73 20 77 69 74 68 20 | functio|ns with |
|00002340| 64 69 66 66 65 72 65 6e | 74 0d 0a 20 20 20 20 20 |differen|t.. |
|00002350| 20 20 72 65 71 75 69 72 | 65 6d 65 6e 74 73 20 74 | requir|ements t|
|00002360| 68 61 6e 20 61 72 65 20 | 69 6d 70 6f 73 65 64 20 |han are |imposed |
|00002370| 6f 6e 20 74 68 65 20 46 | 6f 72 74 72 61 6e 20 76 |on the F|ortran v|
|00002380| 65 72 73 69 6f 6e 73 2e | 0d 0a 0d 0a 20 20 20 20 |ersions.|.... |
|00002390| 20 20 20 44 45 43 20 41 | 64 61 20 68 61 73 20 62 | DEC A|da has b|
|000023a0| 75 69 6c 74 2d 69 6e 20 | 73 75 70 70 6f 72 74 20 |uilt-in |support |
|000023b0| 66 6f 72 20 63 6f 6d 70 | 6c 65 78 20 74 79 70 65 |for comp|lex type|
|000023c0| 73 2c 20 61 6e 64 20 61 | 6c 73 6f 20 68 61 73 0d |s, and a|lso has.|
|000023d0| 0a 20 20 20 20 20 20 20 | 62 69 6e 64 69 6e 67 73 |. |bindings|
|000023e0| 20 64 69 72 65 63 74 6c | 79 20 74 6f 20 74 68 65 | directl|y to the|
|000023f0| 20 73 61 6d 65 20 70 72 | 69 6d 69 74 69 76 65 73 | same pr|imitives|
|00002400| 20 74 68 61 74 20 46 6f | 72 74 72 61 6e 20 75 73 | that Fo|rtran us|
|00002410| 65 73 20 66 6f 72 20 69 | 74 73 0d 0a 20 20 20 20 |es for i|ts.. |
|00002420| 20 20 20 6d 61 74 68 20 | 72 6f 75 74 69 6e 65 73 | math |routines|
|00002430| 20 61 6e 64 20 73 6f 20 | 67 65 74 73 20 74 68 65 | and so |gets the|
|00002440| 20 73 61 6d 65 20 70 65 | 72 66 6f 72 6d 61 6e 63 | same pe|rformanc|
|00002450| 65 20 61 73 20 46 6f 72 | 74 72 61 6e 20 64 6f 65 |e as For|tran doe|
|00002460| 73 2e 0d 0a 0d 0a 0d 0a | 20 20 20 28 64 29 20 44 |s.......| (d) D|
|00002470| 69 66 66 65 72 65 6e 63 | 65 73 20 64 75 65 20 74 |ifferenc|es due t|
|00002480| 6f 20 74 68 65 20 61 75 | 74 68 6f 72 0d 0a 0d 0a |o the au|thor....|
|00002490| 20 20 20 54 68 65 20 75 | 73 65 20 6f 66 20 67 6f | The u|se of go|
|000024a0| 6f 64 20 41 64 61 20 61 | 6e 64 20 46 6f 72 74 72 |od Ada a|nd Fortr|
|000024b0| 61 6e 20 73 74 79 6c 65 | 20 63 61 6e 20 61 6c 73 |an style| can als|
|000024c0| 6f 20 65 66 66 65 63 74 | 20 74 68 65 20 67 65 6e |o effect| the gen|
|000024d0| 65 72 61 74 65 64 0d 0a | 20 20 20 20 20 20 20 63 |erated..| c|
|000024e0| 6f 64 65 2e 20 50 72 6f | 76 69 64 65 64 20 74 68 |ode. Pro|vided th|
|000024f0| 65 20 61 75 74 68 6f 72 | 20 77 72 69 74 65 73 20 |e author| writes |
|00002500| 69 6e 20 67 6f 6f 64 20 | 41 64 61 20 73 74 79 6c |in good |Ada styl|
|00002510| 65 2c 20 61 6e 64 20 66 | 6f 6c 6c 6f 77 73 0d 0a |e, and f|ollows..|
|00002520| 20 20 20 20 20 20 20 74 | 68 65 20 61 62 6f 76 65 | t|he above|
|00002530| 20 67 75 69 64 65 6c 69 | 6e 65 73 2c 20 74 68 65 | guideli|nes, the|
|00002540| 20 67 65 6e 65 72 61 74 | 65 64 20 63 6f 64 65 20 | generat|ed code |
|00002550| 73 68 6f 75 6c 64 20 64 | 6f 20 61 73 20 77 65 6c |should d|o as wel|
|00002560| 6c 20 61 73 0d 0a 20 20 | 20 20 20 20 20 46 6f 72 |l as.. | For|
|00002570| 74 72 61 6e 2e 0d 0a 0d | 0a 0d 0a 20 20 20 20 54 |tran....|... T|
|00002580| 68 65 20 41 64 61 20 50 | 65 72 66 6f 72 6d 61 6e |he Ada P|erforman|
|00002590| 63 65 20 42 65 6e 63 68 | 6d 61 72 6b 0d 0a 0d 0a |ce Bench|mark....|
|000025a0| 20 20 20 41 20 44 45 43 | 20 41 64 61 20 63 75 73 | A DEC| Ada cus|
|000025b0| 74 6f 6d 65 72 20 68 61 | 64 20 61 20 46 6f 72 74 |tomer ha|d a Fort|
|000025c0| 72 61 6e 20 62 65 6e 63 | 68 6d 61 72 6b 20 74 68 |ran benc|hmark th|
|000025d0| 61 74 20 68 61 64 20 62 | 65 65 6e 20 74 72 61 6e |at had b|een tran|
|000025e0| 73 6c 61 74 65 64 0d 0a | 20 20 20 69 6e 74 6f 20 |slated..| into |
|000025f0| 41 64 61 20 77 69 74 68 | 6f 75 74 20 61 77 61 72 |Ada with|out awar|
|00002600| 65 6e 65 73 73 20 6f 66 | 20 74 68 65 20 61 62 6f |eness of| the abo|
|00002610| 76 65 20 69 73 73 75 65 | 73 2c 20 61 6e 64 20 77 |ve issue|s, and w|
|00002620| 61 73 20 72 75 6e 6e 69 | 6e 67 0d 0a 20 20 20 73 |as runni|ng.. s|
|00002630| 75 62 73 74 61 6e 74 69 | 61 6c 6c 79 20 73 6c 6f |ubstanti|ally slo|
|00002640| 77 65 72 20 77 69 74 68 | 20 44 45 43 20 41 64 61 |wer with| DEC Ada|
|00002650| 20 74 68 61 6e 20 74 68 | 65 20 6f 72 69 67 69 6e | than th|e origin|
|00002660| 61 6c 20 77 61 73 20 77 | 69 74 68 20 44 45 43 0d |al was w|ith DEC.|
|00002670| 0a 20 20 20 46 6f 72 74 | 72 61 6e 2e 0d 0a 0d 0a |. Fort|ran.....|
|00002680| 20 20 20 42 65 76 69 6e | 20 42 72 65 74 74 2c 20 | Bevin| Brett, |
|00002690| 61 20 44 45 43 20 41 64 | 61 20 74 65 61 6d 20 6d |a DEC Ad|a team m|
|000026a0| 65 6d 62 65 72 2c 20 64 | 65 76 65 6c 6f 70 65 64 |ember, d|eveloped|
|000026b0| 20 74 68 65 20 61 62 6f | 76 65 20 67 75 69 64 65 | the abo|ve guide|
|000026c0| 6c 69 6e 65 73 20 69 6e | 0d 0a 20 20 20 74 68 65 |lines in|.. the|
|000026d0| 20 70 72 6f 63 65 73 73 | 20 6f 66 20 72 65 74 72 | process| of retr|
|000026e0| 61 6e 73 6c 61 74 69 6e | 67 20 74 68 65 20 63 6f |anslatin|g the co|
|000026f0| 64 65 20 69 6e 74 6f 20 | 41 64 61 2e 0d 0a 0d 0a |de into |Ada.....|
|00002700| 20 20 20 50 6f 72 74 69 | 6f 6e 73 20 6f 66 20 74 | Porti|ons of t|
|00002710| 68 69 73 20 74 72 61 6e | 73 6c 61 74 69 6f 6e 20 |his tran|slation |
|00002720| 61 72 65 20 73 68 6f 77 | 6e 20 68 65 72 65 20 28 |are show|n here (|
|00002730| 61 29 20 61 73 20 61 6e | 20 69 6c 6c 75 73 74 72 |a) as an| illustr|
|00002740| 61 74 69 6f 6e 20 6f 66 | 0d 0a 20 20 20 74 68 65 |ation of|.. the|
|00002750| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 6f 66 20 | applica|tion of |
|00002760| 74 68 65 20 61 62 6f 76 | 65 20 72 75 6c 65 73 2c |the abov|e rules,|
|00002770| 20 61 6e 64 20 28 62 29 | 20 61 73 20 61 6e 20 69 | and (b)| as an i|
|00002780| 6c 6c 75 73 74 72 61 74 | 69 6f 6e 20 6f 66 20 74 |llustrat|ion of t|
|00002790| 68 65 0d 0a 20 20 20 6b | 69 6e 64 20 6f 66 20 6f |he.. k|ind of o|
|000027a0| 70 65 72 61 74 69 6f 6e | 73 20 74 68 61 74 20 77 |peration|s that w|
|000027b0| 65 72 65 20 70 72 65 73 | 65 6e 74 20 69 6e 20 74 |ere pres|ent in t|
|000027c0| 68 65 20 62 65 6e 63 68 | 6d 61 72 6b 2e 0d 0a 0d |he bench|mark....|
|000027d0| 0a 20 20 20 54 68 65 20 | 77 68 6f 6c 65 20 62 65 |. The |whole be|
|000027e0| 6e 63 68 6d 61 72 6b 20 | 68 61 73 20 6e 6f 74 20 |nchmark |has not |
|000027f0| 62 65 65 6e 20 70 72 6f | 76 69 64 65 64 20 74 6f |been pro|vided to|
|00002800| 20 61 76 6f 69 64 20 70 | 6f 73 73 69 62 6c 65 20 | avoid p|ossible |
|00002810| 69 73 73 75 65 73 20 6f | 66 0d 0a 20 20 20 6f 77 |issues o|f.. ow|
|00002820| 6e 65 72 73 68 69 70 2e | 0d 0a 0d 0a 20 20 20 54 |nership.|.... T|
|00002830| 68 65 20 72 65 73 75 6c | 74 69 6e 67 20 41 64 61 |he resul|ting Ada|
|00002840| 20 62 65 6e 63 68 6d 61 | 72 6b 20 63 6f 6d 70 6f | benchma|rk compo|
|00002850| 6e 65 6e 74 73 20 65 61 | 63 68 20 72 61 6e 20 77 |nents ea|ch ran w|
|00002860| 69 74 68 69 6e 20 61 20 | 66 65 77 20 70 65 72 63 |ithin a |few perc|
|00002870| 65 6e 74 0d 0a 20 20 20 | 6f 66 20 74 68 65 69 72 |ent.. |of their|
|00002880| 20 46 6f 72 74 72 61 6e | 20 63 6f 75 6e 74 65 72 | Fortran| counter|
|00002890| 70 61 72 74 73 2e 20 54 | 68 65 20 41 64 61 20 63 |parts. T|he Ada c|
|000028a0| 6f 64 65 20 69 73 20 61 | 76 61 69 6c 61 62 6c 65 |ode is a|vailable|
|000028b0| 20 62 79 20 46 54 50 2c | 20 69 6e 0d 0a 20 20 20 | by FTP,| in.. |
|000028c0| 66 69 6c 65 20 66 74 70 | 3a 2f 2f 6c 67 6c 66 74 |file ftp|://lglft|
|000028d0| 70 2e 65 70 66 6c 2e 63 | 68 2f 70 75 62 2f 41 64 |p.epfl.c|h/pub/Ad|
|000028e0| 61 2f 46 41 51 2f 61 64 | 61 2d 76 73 2d 66 6f 72 |a/FAQ/ad|a-vs-for|
|000028f0| 74 72 61 6e 2e 61 64 61 | 0d 0a 0d 0a 0d 0a 39 2e |tran.ada|......9.|
|00002900| 34 3a 20 49 73 6e 27 74 | 20 41 64 61 20 6c 65 73 |4: Isn't| Ada les|
|00002910| 73 20 22 65 6c 65 67 61 | 6e 74 22 20 74 68 61 6e |s "elega|nt" than|
|00002920| 20 45 69 66 66 65 6c 3f | 0d 0a 0d 0a 20 20 20 57 | Eiffel?|.... W|
|00002930| 68 69 6c 65 20 69 74 20 | 69 73 20 74 72 75 65 20 |hile it |is true |
|00002940| 74 68 61 74 20 70 72 6f | 67 72 61 6d 6d 69 6e 67 |that pro|gramming|
|00002950| 2d 6c 61 6e 67 75 61 67 | 65 20 73 75 70 70 6f 72 |-languag|e suppor|
|00002960| 74 20 66 6f 72 20 22 61 | 73 73 65 72 74 69 6f 6e |t for "a|ssertion|
|00002970| 73 22 0d 0a 20 20 20 69 | 73 20 61 6e 20 69 6d 70 |s".. i|s an imp|
|00002980| 6f 72 74 61 6e 74 20 63 | 6f 6e 74 72 69 62 75 74 |ortant c|ontribut|
|00002990| 69 6f 6e 20 6f 66 20 45 | 69 66 66 65 6c 20 74 6f |ion of E|iffel to|
|000029a0| 20 73 6f 66 74 77 61 72 | 65 20 63 6f 6e 73 74 72 | softwar|e constr|
|000029b0| 75 63 74 69 6f 6e 2c 20 | 74 68 69 73 0d 0a 20 20 |uction, |this.. |
|000029c0| 20 69 73 20 6e 6f 74 20 | 61 6e 20 69 73 73 75 65 | is not |an issue|
|000029d0| 20 6f 66 20 22 65 6c 65 | 67 61 6e 63 65 22 2c 20 | of "ele|gance", |
|000029e0| 61 6e 64 20 74 68 65 72 | 65 20 61 72 65 20 6d 61 |and ther|e are ma|
|000029f0| 6e 79 20 6f 74 68 65 72 | 20 69 6d 70 6f 72 74 61 |ny other| importa|
|00002a00| 6e 74 0d 0a 20 20 20 66 | 61 63 74 6f 72 73 20 74 |nt.. f|actors t|
|00002a10| 6f 20 63 6f 6e 73 69 64 | 65 72 2e 0d 0a 0d 0a 20 |o consid|er..... |
|00002a20| 20 20 4e 6f 74 65 20 61 | 6c 73 6f 20 74 68 61 74 | Note a|lso that|
|00002a30| 20 70 72 65 63 6f 6e 64 | 69 74 69 6f 6e 73 20 61 | precond|itions a|
|00002a40| 6e 64 20 70 6f 73 74 63 | 6f 6e 64 69 74 69 6f 6e |nd postc|ondition|
|00002a50| 73 20 63 61 6e 20 62 65 | 20 66 61 69 72 6c 79 20 |s can be| fairly |
|00002a60| 65 61 73 69 6c 79 0d 0a | 20 20 20 61 6e 64 20 65 |easily..| and e|
|00002a70| 66 66 69 63 69 65 6e 74 | 6c 79 20 69 6e 63 6c 75 |fficient|ly inclu|
|00002a80| 64 65 64 20 69 6e 20 41 | 64 61 20 63 6f 64 65 2e |ded in A|da code.|
|00002a90| 20 49 6e 76 61 72 69 61 | 6e 74 73 20 73 65 65 6d | Invaria|nts seem|
|00002aa0| 20 64 69 66 66 69 63 75 | 6c 74 20 74 6f 0d 0a 20 | difficu|lt to.. |
|00002ab0| 20 20 65 6d 75 6c 61 74 | 65 20 64 69 72 65 63 74 | emulat|e direct|
|00002ac0| 6c 79 20 69 6e 20 41 64 | 61 2e 20 49 66 20 79 6f |ly in Ad|a. If yo|
|00002ad0| 75 27 72 65 20 72 65 61 | 6c 6c 79 20 69 6e 74 65 |u're rea|lly inte|
|00002ae0| 72 65 73 74 65 64 20 69 | 6e 20 74 68 65 20 66 6f |rested i|n the fo|
|00002af0| 72 6d 61 6c 20 75 73 65 | 0d 0a 20 20 20 6f 66 20 |rmal use|.. of |
|00002b00| 61 73 73 65 72 74 69 6f | 6e 73 20 77 69 74 68 20 |assertio|ns with |
|00002b10| 41 64 61 2c 20 6d 61 79 | 62 65 20 41 6e 6e 61 20 |Ada, may|be Anna |
|00002b20| 69 73 20 61 20 73 6f 6c | 75 74 69 6f 6e 20 66 6f |is a sol|ution fo|
|00002b30| 72 20 79 6f 75 2e 0d 0a | 0d 0a 20 20 20 28 54 75 |r you...|.. (Tu|
|00002b40| 63 6b 65 72 20 54 61 66 | 74 20 63 6f 6d 6d 65 6e |cker Taf|t commen|
|00002b50| 74 73 29 0d 0a 0d 0a 20 | 20 20 49 20 67 75 65 73 |ts).... | I gues|
|00002b60| 73 20 6f 6e 65 20 74 68 | 69 6e 67 20 74 68 61 74 |s one th|ing that|
|00002b70| 20 62 6f 74 68 65 72 73 | 20 6d 65 20 61 20 6c 69 | bothers| me a li|
|00002b80| 74 74 6c 65 20 69 73 20 | 74 68 61 74 20 70 65 6f |ttle is |that peo|
|00002b90| 70 6c 65 20 61 72 65 20 | 71 75 69 63 6b 20 74 6f |ple are |quick to|
|00002ba0| 0d 0a 20 20 20 73 61 79 | 20 74 68 61 74 20 45 69 |.. say| that Ei|
|00002bb0| 66 66 65 6c 20 69 73 20 | 22 65 6c 65 67 61 6e 74 |ffel is |"elegant|
|00002bc0| 22 20 77 69 74 68 6f 75 | 74 20 72 65 61 6c 6c 79 |" withou|t really|
|00002bd0| 20 6c 6f 6f 6b 69 6e 67 | 20 61 74 20 69 74 2e 20 | looking| at it. |
|00002be0| 49 20 66 65 61 72 20 74 | 68 61 74 0d 0a 20 20 20 |I fear t|hat.. |
|00002bf0| 73 75 63 68 20 73 74 61 | 74 65 6d 65 6e 74 73 20 |such sta|tements |
|00002c00| 77 69 6c 6c 20 62 65 63 | 6f 6d 65 20 73 65 6c 66 |will bec|ome self|
|00002c10| 2d 66 75 6c 66 69 6c 6c | 69 6e 67 20 70 72 6f 70 |-fulfill|ing prop|
|00002c20| 68 65 63 69 65 73 2c 20 | 77 69 74 68 20 74 68 6f |hecies, |with tho|
|00002c30| 73 65 0d 0a 20 20 20 70 | 72 6f 67 72 61 6d 6d 65 |se.. p|rogramme|
|00002c40| 72 73 20 69 6e 74 65 72 | 65 73 74 65 64 20 69 6e |rs inter|ested in|
|00002c50| 20 65 6c 65 67 61 6e 63 | 65 20 6d 69 67 72 61 74 | eleganc|e migrat|
|00002c60| 69 6e 67 20 6f 76 65 72 | 20 74 6f 20 45 69 66 66 |ing over| to Eiff|
|00002c70| 65 6c 20 72 61 74 68 65 | 72 0d 0a 20 20 20 74 68 |el rathe|r.. th|
|00002c80| 61 6e 20 73 74 69 63 6b | 69 6e 67 20 77 69 74 68 |an stick|ing with|
|00002c90| 20 41 64 61 2e 0d 0a 0d | 0a 20 20 20 49 6e 20 70 | Ada....|. In p|
|00002ca0| 61 72 74 69 63 75 6c 61 | 72 2c 20 61 6c 74 68 6f |articula|r, altho|
|00002cb0| 75 67 68 20 49 20 6c 69 | 6b 65 20 74 68 65 20 61 |ugh I li|ke the a|
|00002cc0| 73 73 65 72 74 69 6f 6e | 20 73 74 75 66 66 20 69 |ssertion| stuff i|
|00002cd0| 6e 20 45 69 66 66 65 6c | 2c 20 49 20 74 68 69 6e |n Eiffel|, I thin|
|00002ce0| 6b 0d 0a 20 20 20 74 68 | 65 20 6c 61 6e 67 75 61 |k.. th|e langua|
|00002cf0| 67 65 20 68 61 73 20 61 | 20 6e 75 6d 62 65 72 20 |ge has a| number |
|00002d00| 6f 66 20 22 69 6e 65 6c | 65 67 61 6e 74 22 20 61 |of "inel|egant" a|
|00002d10| 73 70 65 63 74 73 2e 20 | 46 6f 72 20 65 78 61 6d |spects. |For exam|
|00002d20| 70 6c 65 3a 0d 0a 0d 0a | 20 20 20 20 31 2e 20 65 |ple:....| 1. e|
|00002d30| 78 63 65 70 74 69 6f 6e | 20 68 61 6e 64 6c 65 72 |xception| handler|
|00002d40| 73 20 6f 6e 6c 79 20 61 | 74 20 74 68 65 20 74 6f |s only a|t the to|
|00002d50| 70 20 6c 65 76 65 6c 20 | 6f 66 20 61 20 72 6f 75 |p level |of a rou|
|00002d60| 74 69 6e 65 2c 20 77 69 | 74 68 20 74 68 65 0d 0a |tine, wi|th the..|
|00002d70| 20 20 20 20 20 20 20 6f | 6e 6c 79 20 77 61 79 20 | o|nly way |
|00002d80| 74 6f 20 22 68 61 6e 64 | 6c 65 22 20 61 6e 20 65 |to "hand|le" an e|
|00002d90| 78 63 65 70 74 69 6f 6e | 20 62 65 69 6e 67 20 62 |xception| being b|
|00002da0| 79 20 72 65 74 72 79 69 | 6e 67 20 74 68 65 20 77 |y retryi|ng the w|
|00002db0| 68 6f 6c 65 0d 0a 20 20 | 20 20 20 20 20 72 6f 75 |hole.. | rou|
|00002dc0| 74 69 6e 65 2e 0d 0a 0d | 0a 20 20 20 20 32 2e 20 |tine....|. 2. |
|00002dd0| 4e 6f 20 77 61 79 20 74 | 6f 20 72 65 74 75 72 6e |No way t|o return|
|00002de0| 20 66 72 6f 6d 20 61 20 | 72 6f 75 74 69 6e 65 20 | from a |routine |
|00002df0| 69 6e 20 74 68 65 20 6d | 69 64 64 6c 65 2e 20 54 |in the m|iddle. T|
|00002e00| 68 69 73 20 6d 61 6b 65 | 73 20 69 74 20 61 0d 0a |his make|s it a..|
|00002e10| 20 20 20 20 20 20 20 70 | 61 69 6e 20 69 6e 20 74 | p|ain in t|
|00002e20| 68 65 20 6e 65 63 6b 20 | 74 6f 20 73 65 61 72 63 |he neck |to searc|
|00002e30| 68 20 74 68 72 6f 75 67 | 68 20 61 20 6c 69 73 74 |h throug|h a list|
|00002e40| 20 66 6f 72 20 73 6f 6d | 65 74 68 69 6e 67 20 69 | for som|ething i|
|00002e50| 6e 20 61 20 6c 6f 6f 70 | 2c 0d 0a 20 20 20 20 20 |n a loop|,.. |
|00002e60| 20 20 61 6e 64 20 74 68 | 65 6e 20 72 65 74 75 72 | and th|en retur|
|00002e70| 6e 20 69 6d 6d 65 64 69 | 61 74 65 6c 79 20 77 68 |n immedi|ately wh|
|00002e80| 65 6e 20 79 6f 75 20 66 | 69 6e 64 20 77 68 61 74 |en you f|ind what|
|00002e90| 20 79 6f 75 20 77 61 6e | 74 2e 20 28 49 20 68 61 | you wan|t. (I ha|
|00002ea0| 76 65 0d 0a 20 20 20 20 | 20 20 20 6e 65 76 65 72 |ve.. | never|
|00002eb0| 20 66 6f 75 6e 64 20 74 | 68 65 20 61 64 64 69 74 | found t|he addit|
|00002ec0| 69 6f 6e 20 6f 66 20 65 | 78 74 72 61 20 62 6f 6f |ion of e|xtra boo|
|00002ed0| 6c 65 61 6e 20 63 6f 6e | 74 72 6f 6c 20 76 61 72 |lean con|trol var|
|00002ee0| 69 61 62 6c 65 20 61 20 | 68 65 6c 70 0d 0a 20 20 |iable a |help.. |
|00002ef0| 20 20 20 20 20 74 6f 20 | 74 68 65 20 75 6e 64 65 | to |the unde|
|00002f00| 72 73 74 61 6e 64 69 6e | 67 20 6f 66 20 61 6e 20 |rstandin|g of an |
|00002f10| 61 6c 67 6f 72 69 74 68 | 6d 2e 29 0d 0a 0d 0a 20 |algorith|m.).... |
|00002f20| 20 20 20 33 2e 20 4e 61 | 6d 65 73 70 61 63 65 20 | 3. Na|mespace |
|00002f30| 63 6f 6e 74 72 6f 6c 20 | 68 61 6e 64 6c 65 64 20 |control |handled |
|00002f40| 62 79 20 61 20 73 65 70 | 61 72 61 74 65 20 73 75 |by a sep|arate su|
|00002f50| 62 6c 61 6e 67 75 61 67 | 65 2c 20 61 6e 64 20 6e |blanguag|e, and n|
|00002f60| 6f 20 72 65 61 6c 0d 0a | 20 20 20 20 20 20 20 68 |o real..| h|
|00002f70| 69 67 68 65 72 20 6c 65 | 76 65 6c 20 63 6f 6e 63 |igher le|vel conc|
|00002f80| 65 70 74 20 6f 66 20 22 | 6d 6f 64 75 6c 65 22 20 |ept of "|module" |
|00002f90| 6f 72 20 22 73 75 62 73 | 79 73 74 65 6d 2e 22 0d |or "subs|ystem.".|
|00002fa0| 0a 0d 0a 20 20 20 20 34 | 2e 20 41 6e 20 6f 62 73 |... 4|. An obs|
|00002fb0| 63 75 72 65 20 6e 6f 74 | 61 74 69 6f 6e 20 6c 69 |cure not|ation li|
|00002fc0| 6b 65 20 22 21 21 22 20 | 62 65 69 6e 67 20 75 73 |ke "!!" |being us|
|00002fd0| 65 64 20 66 6f 72 20 61 | 6e 20 69 6d 70 6f 72 74 |ed for a|n import|
|00002fe0| 61 6e 74 20 61 6e 64 0d | 0a 20 20 20 20 20 20 20 |ant and.|. |
|00002ff0| 66 72 65 71 75 65 6e 74 | 20 6f 70 65 72 61 74 69 |frequent| operati|
|00003000| 6f 6e 20 28 63 6f 6e 73 | 74 72 75 63 74 69 6f 6e |on (cons|truction|
|00003010| 29 2e 0d 0a 0d 0a 20 20 | 20 20 35 2e 20 4e 6f 20 |)..... | 5. No |
|00003020| 77 61 79 20 74 6f 20 63 | 6f 6e 76 65 6e 69 65 6e |way to c|onvenien|
|00003030| 74 6c 79 20 22 75 73 65 | 22 20 61 6e 6f 74 68 65 |tly "use|" anothe|
|00003040| 72 20 61 62 73 74 72 61 | 63 74 69 6f 6e 20 77 69 |r abstra|ction wi|
|00003050| 74 68 6f 75 74 0d 0a 20 | 20 20 20 20 20 20 69 6e |thout.. | in|
|00003060| 68 65 72 69 74 69 6e 67 | 20 66 72 6f 6d 20 69 74 |heriting| from it|
|00003070| 2e 0d 0a 0d 0a 20 20 20 | 20 36 2e 20 4e 6f 20 73 |..... | 6. No s|
|00003080| 74 72 6f 6e 67 20 64 69 | 73 74 69 6e 63 74 69 6f |trong di|stinctio|
|00003090| 6e 73 20 62 65 74 77 65 | 65 6e 20 69 6e 74 65 67 |ns betwe|en integ|
|000030a0| 65 72 20 74 79 70 65 73 | 20 75 73 65 64 20 66 6f |er types| used fo|
|000030b0| 72 20 61 72 72 61 79 0d | 0a 20 20 20 20 20 20 20 |r array.|. |
|000030c0| 69 6e 64 65 78 69 6e 67 | 2e 0d 0a 0d 0a 20 20 20 |indexing|..... |
|000030d0| 20 37 2e 20 55 73 69 6e | 67 20 74 68 65 20 73 61 | 7. Usin|g the sa|
|000030e0| 6d 65 20 6f 70 65 72 61 | 74 6f 72 20 22 3a 3d 22 |me opera|tor ":="|
|000030f0| 20 66 6f 72 20 62 6f 74 | 68 20 28 61 6c 69 61 73 | for bot|h (alias|
|00003100| 69 6e 67 29 20 70 6f 69 | 6e 74 65 72 0d 0a 20 20 |ing) poi|nter.. |
|00003110| 20 20 20 20 20 61 73 73 | 69 67 6e 6d 65 6e 74 2c | ass|ignment,|
|00003120| 20 61 6e 64 20 66 6f 72 | 20 76 61 6c 75 65 20 61 | and for| value a|
|00003130| 73 73 69 67 6e 6d 65 6e | 74 2c 20 64 65 70 65 6e |ssignmen|t, depen|
|00003140| 64 69 6e 67 20 6f 6e 20 | 77 68 65 74 68 65 72 20 |ding on |whether |
|00003150| 74 68 65 0d 0a 20 20 20 | 20 20 20 20 74 79 70 65 |the.. | type|
|00003160| 20 69 73 20 22 65 78 70 | 61 6e 64 65 64 2e 22 20 | is "exp|anded." |
|00003170| 28 53 69 6d 75 6c 61 27 | 73 20 73 6f 6c 75 74 69 |(Simula'|s soluti|
|00003180| 6f 6e 20 77 61 73 20 66 | 61 72 20 70 72 65 66 65 |on was f|ar prefe|
|00003190| 72 61 62 6c 65 2c 20 49 | 4d 48 4f 29 2e 0d 0a 0d |rable, I|MHO)....|
|000031a0| 0a 20 20 20 20 41 6e 64 | 20 6d 6f 73 74 20 63 72 |. And| most cr|
|000031b0| 69 74 69 63 61 6c 6c 79 | 3a 0d 0a 0d 0a 0d 0a 20 |itically|:...... |
|000031c0| 20 20 20 38 2e 20 4e 6f | 20 73 65 70 61 72 61 74 | 8. No| separat|
|000031d0| 65 20 69 6e 74 65 72 66 | 61 63 65 20 66 6f 72 20 |e interf|ace for |
|000031e0| 61 6e 20 61 62 73 74 72 | 61 63 74 69 6f 6e 2e 20 |an abstr|action. |
|000031f0| 59 6f 75 20 63 61 6e 20 | 76 69 65 77 20 61 20 69 |You can |view a i|
|00003200| 6e 74 65 72 66 61 63 65 | 0d 0a 20 20 20 20 20 20 |nterface|.. |
|00003210| 20 62 79 20 72 75 6e 6e | 69 6e 67 20 61 20 74 6f | by runn|ing a to|
|00003220| 6f 6c 2c 20 62 75 74 20 | 74 68 69 73 20 6d 69 73 |ol, but |this mis|
|00003230| 73 65 73 20 63 6f 6d 70 | 6c 65 74 65 6c 79 20 74 |ses comp|letely t|
|00003240| 68 65 20 69 6d 70 6f 72 | 74 61 6e 63 65 20 6f 66 |he impor|tance of|
|00003250| 0d 0a 20 20 20 20 20 20 | 20 68 61 76 69 6e 67 20 |.. | having |
|00003260| 61 20 70 68 79 73 69 63 | 61 6c 20 6d 6f 64 75 6c |a physic|al modul|
|00003270| 65 20 74 68 61 74 20 72 | 65 70 72 65 73 65 6e 74 |e that r|epresent|
|00003280| 73 20 74 68 65 20 69 6e | 74 65 72 66 61 63 65 2c |s the in|terface,|
|00003290| 20 61 6e 64 20 61 63 74 | 73 0d 0a 20 20 20 20 20 | and act|s.. |
|000032a0| 20 20 61 73 20 61 20 63 | 6f 6e 74 72 61 63 74 20 | as a c|ontract |
|000032b0| 62 65 74 77 65 65 6e 20 | 74 68 65 20 73 70 65 63 |between |the spec|
|000032c0| 69 66 69 65 72 20 6f 72 | 20 75 73 65 72 20 6f 66 |ifier or| user of|
|000032d0| 20 61 6e 20 61 62 73 74 | 72 61 63 74 69 6f 6e 20 | an abst|raction |
|000032e0| 61 6e 64 0d 0a 20 20 20 | 20 20 20 20 69 74 73 20 |and.. | its |
|000032f0| 69 6d 70 6c 65 6d 65 6e | 74 6f 72 2e 20 49 6e 20 |implemen|tor. In |
|00003300| 45 69 66 66 65 6c 2c 20 | 6f 6e 65 20 6d 69 67 68 |Eiffel, |one migh|
|00003310| 74 20 6e 6f 74 20 65 76 | 65 6e 20 62 65 20 74 72 |t not ev|en be tr|
|00003320| 75 6c 79 20 61 77 61 72 | 65 20 77 68 65 6e 0d 0a |uly awar|e when..|
|00003330| 20 20 20 20 20 20 20 6f | 6e 65 20 69 73 20 63 68 | o|ne is ch|
|00003340| 61 6e 67 69 6e 67 20 74 | 68 65 20 69 6e 74 65 72 |anging t|he inter|
|00003350| 66 61 63 65 20 74 6f 20 | 61 6e 20 61 62 73 74 72 |face to |an abstr|
|00003360| 61 63 74 69 6f 6e 2c 20 | 62 65 63 61 75 73 65 20 |action, |because |
|00003370| 74 68 65 72 65 20 69 73 | 0d 0a 20 20 20 20 20 20 |there is|.. |
|00003380| 20 6e 6f 20 70 61 72 74 | 69 63 75 6c 61 72 20 70 | no part|icular p|
|00003390| 68 79 73 69 63 61 6c 20 | 73 65 70 61 72 61 74 69 |hysical |separati|
|000033a0| 6f 6e 20 62 65 74 77 65 | 65 6e 20 69 6e 74 65 72 |on betwe|en inter|
|000033b0| 66 61 63 65 20 61 6e 64 | 0d 0a 20 20 20 20 20 20 |face and|.. |
|000033c0| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 2e | impleme|ntation.|
|000033d0| 0d 0a 0d 0a 0d 0a 20 20 | 20 49 20 63 6f 6e 73 69 |...... | I consi|
|000033e0| 64 65 72 20 6d 61 6e 79 | 20 6f 66 20 74 68 65 20 |der many| of the |
|000033f0| 61 62 6f 76 65 20 70 72 | 6f 62 6c 65 6d 73 20 71 |above pr|oblems q|
|00003400| 75 69 74 65 20 73 65 72 | 69 6f 75 73 2c 20 77 69 |uite ser|ious, wi|
|00003410| 74 68 20 73 6f 6d 65 20 | 6f 66 20 74 68 65 6d 0d |th some |of them.|
|00003420| 0a 20 20 20 62 65 69 6e | 67 20 72 65 61 6c 20 74 |. bein|g real t|
|00003430| 68 72 6f 77 62 61 63 6b | 73 20 74 6f 20 74 68 65 |hrowback|s to the|
|00003440| 20 6f 6c 64 20 73 74 79 | 6c 65 20 6f 66 20 70 72 | old sty|le of pr|
|00003450| 6f 67 72 61 6d 6d 69 6e | 67 20 6c 61 6e 67 75 61 |ogrammin|g langua|
|00003460| 67 65 73 20 77 68 65 72 | 65 0d 0a 20 20 20 74 68 |ges wher|e.. th|
|00003470| 65 72 65 20 77 65 72 65 | 20 6e 6f 20 77 65 6c 6c |ere were| no well|
|00003480| 20 64 65 66 69 6e 65 64 | 20 69 6e 74 65 72 66 61 | defined| interfa|
|00003490| 63 65 73 20 6f 72 20 6d | 6f 64 75 6c 65 73 2e 0d |ces or m|odules..|
|000034a0| 0a 0d 0a 20 20 20 48 65 | 6e 63 65 2c 20 49 20 63 |... He|nce, I c|
|000034b0| 72 69 6e 67 65 20 61 20 | 62 69 74 20 77 68 65 6e |ringe a |bit when|
|000034c0| 20 70 65 6f 70 6c 65 20 | 73 61 79 20 74 68 61 74 | people |say that|
|000034d0| 20 45 69 66 66 65 6c 20 | 69 73 20 74 68 65 20 22 | Eiffel |is the "|
|000034e0| 6d 6f 73 74 0d 0a 20 20 | 20 65 6c 65 67 61 6e 74 |most.. | elegant|
|000034f0| 22 20 4f 4f 50 20 61 6e | 64 20 74 68 61 74 20 74 |" OOP an|d that t|
|00003500| 68 65 79 20 77 6f 75 6c | 64 20 75 73 65 20 69 74 |hey woul|d use it|
|00003510| 20 69 66 20 6f 6e 6c 79 | 20 69 74 20 77 65 72 65 | if only| it were|
|00003520| 20 70 72 61 63 74 69 63 | 61 6c 20 74 6f 0d 0a 20 | practic|al to.. |
|00003530| 20 20 64 6f 20 73 6f 2e | 20 49 6e 20 6d 61 6e 79 | do so.| In many|
|00003540| 20 77 61 79 73 2c 20 49 | 20 74 68 69 6e 6b 20 41 | ways, I| think A|
|00003550| 64 61 20 69 73 20 6d 75 | 63 68 20 62 65 74 74 65 |da is mu|ch bette|
|00003560| 72 20 68 75 6d 61 6e 2d | 65 6e 67 69 6e 65 65 72 |r human-|engineer|
|00003570| 65 64 20 74 68 61 6e 0d | 0a 20 20 20 45 69 66 66 |ed than.|. Eiff|
|00003580| 65 6c 2c 20 77 69 74 68 | 20 69 6d 70 6f 72 74 61 |el, with| importa|
|00003590| 6e 74 20 74 68 69 6e 67 | 73 20 6c 69 6b 65 20 72 |nt thing|s like r|
|000035a0| 61 6e 67 65 20 63 6f 6e | 73 74 72 61 69 6e 74 73 |ange con|straints|
|000035b0| 20 62 75 69 6c 74 20 69 | 6e 74 6f 20 74 68 65 0d | built i|nto the.|
|000035c0| 0a 20 20 20 6c 61 6e 67 | 75 61 67 65 20 69 6e 20 |. lang|uage in |
|000035d0| 61 20 77 61 79 20 74 68 | 61 74 20 6d 61 6b 65 73 |a way th|at makes|
|000035e0| 20 74 68 65 6d 20 63 6f | 6e 76 65 6e 69 65 6e 74 | them co|nvenient|
|000035f0| 20 74 6f 20 75 73 65 2e | 20 41 6c 74 68 6f 75 67 | to use.| Althoug|
|00003600| 68 20 67 65 6e 65 72 61 | 6c 0d 0a 20 20 20 61 73 |h genera|l.. as|
|00003610| 73 65 72 74 69 6f 6e 73 | 20 61 72 65 20 6e 69 63 |sertions| are nic|
|00003620| 65 2c 20 74 68 65 79 20 | 64 6f 6e 27 74 20 67 69 |e, they |don't gi|
|00003630| 76 65 20 79 6f 75 20 74 | 68 65 20 6b 69 6e 64 20 |ve you t|he kind |
|00003640| 6f 66 20 6c 69 6e 65 2d | 62 79 2d 6c 69 6e 65 0d |of line-|by-line.|
|00003650| 0a 20 20 20 63 6f 6e 73 | 69 73 74 65 6e 63 79 20 |. cons|istency |
|00003660| 63 68 65 63 6b 73 20 74 | 68 61 74 20 41 64 61 20 |checks t|hat Ada |
|00003670| 63 61 6e 20 67 69 76 65 | 20 79 6f 75 2e 0d 0a 0d |can give| you....|
|00003680| 0a 20 20 20 54 6f 20 73 | 75 6d 6d 61 72 69 7a 65 |. To s|ummarize|
|00003690| 20 2d 2d 0d 0a 20 20 20 | 41 6c 74 68 6f 75 67 68 | --.. |Although|
|000036a0| 20 45 69 66 66 65 6c 20 | 63 65 72 74 61 69 6e 6c | Eiffel |certainl|
|000036b0| 79 20 68 61 73 20 61 20 | 6e 75 6d 62 65 72 20 6f |y has a |number o|
|000036c0| 66 20 6e 69 63 65 20 66 | 65 61 74 75 72 65 73 2c |f nice f|eatures,|
|000036d0| 20 49 20 64 6f 6e 27 74 | 0d 0a 20 20 20 63 6f 6e | I don't|.. con|
|000036e0| 73 69 64 65 72 20 69 74 | 20 72 65 61 64 79 20 66 |sider it| ready f|
|000036f0| 6f 72 20 70 72 69 6d 65 | 20 74 69 6d 65 20 61 73 |or prime| time as|
|00003700| 20 66 61 72 20 61 73 20 | 62 75 69 6c 64 69 6e 67 | far as |building|
|00003710| 20 61 6e 64 20 6d 61 69 | 6e 74 61 69 6e 69 6e 67 | and mai|ntaining|
|00003720| 0d 0a 20 20 20 6c 61 72 | 67 65 20 73 79 73 74 65 |.. lar|ge syste|
|00003730| 6d 73 20 77 69 74 68 20 | 6c 61 72 67 65 20 6e 75 |ms with |large nu|
|00003740| 6d 62 65 72 73 20 6f 66 | 20 70 72 6f 67 72 61 6d |mbers of| program|
|00003750| 6d 65 72 73 2e 20 41 6e | 64 20 66 72 6f 6d 20 61 |mers. An|d from a|
|00003760| 20 68 75 6d 61 6e 0d 0a | 20 20 20 65 6e 67 69 6e | human..| engin|
|00003770| 65 65 72 69 6e 67 20 70 | 6f 69 6e 74 20 6f 66 20 |eering p|oint of |
|00003780| 76 69 65 77 2c 20 49 20 | 74 68 69 6e 6b 20 41 64 |view, I |think Ad|
|00003790| 61 20 69 73 20 73 69 67 | 6e 69 66 69 63 61 6e 74 |a is sig|nificant|
|000037a0| 6c 79 20 62 65 74 74 65 | 72 2e 0d 0a 0d 0a 0d 0a |ly bette|r.......|
|000037b0| 39 2e 35 3a 20 41 72 65 | 20 74 68 65 72 65 20 61 |9.5: Are| there a|
|000037c0| 6e 79 20 70 61 70 65 72 | 73 20 64 65 74 61 69 6c |ny paper|s detail|
|000037d0| 69 6e 67 20 74 68 65 20 | 64 69 66 66 65 72 65 6e |ing the |differen|
|000037e0| 63 65 73 20 62 65 74 77 | 65 65 6e 20 41 64 61 20 |ces betw|een Ada |
|000037f0| 61 6e 64 20 43 2b 2b 3f | 0d 0a 0d 0a 20 20 20 42 |and C++?|.... B|
|00003800| 65 6c 6f 77 20 61 72 65 | 20 74 77 6f 20 72 65 66 |elow are| two ref|
|00003810| 65 72 65 6e 63 65 73 2e | 20 42 65 61 72 20 69 6e |erences.| Bear in|
|00003820| 20 6d 69 6e 64 20 74 68 | 61 74 20 69 74 20 69 73 | mind th|at it is|
|00003830| 20 64 69 66 66 69 63 75 | 6c 74 20 74 6f 20 6d 61 | difficu|lt to ma|
|00003840| 6b 65 0d 0a 20 20 20 73 | 75 63 68 20 61 20 63 6f |ke.. s|uch a co|
|00003850| 6d 70 61 72 69 73 6f 6e | 20 77 69 74 68 6f 75 74 |mparison| without|
|00003860| 20 65 78 70 6f 73 69 6e | 67 20 62 69 61 73 65 73 | exposin|g biases|
|00003870| 2e 20 48 6f 77 65 76 65 | 72 2c 20 74 68 65 20 74 |. Howeve|r, the t|
|00003880| 77 6f 20 70 61 70 65 72 | 73 0d 0a 20 20 20 62 65 |wo paper|s.. be|
|00003890| 6c 6f 77 20 61 72 65 20 | 77 65 6c 6c 20 77 6f 72 |low are |well wor|
|000038a0| 74 68 20 72 65 61 64 69 | 6e 67 2e 0d 0a 0d 0a 20 |th readi|ng..... |
|000038b0| 20 20 22 41 20 43 6f 6d | 70 61 72 69 73 6f 6e 20 | "A Com|parison |
|000038c0| 6f 66 20 74 68 65 20 4f | 4f 20 66 65 61 74 75 72 |of the O|O featur|
|000038d0| 65 73 20 6f 66 20 41 64 | 61 39 78 20 61 6e 64 20 |es of Ad|a9x and |
|000038e0| 43 2b 2b 22 20 69 6e 20 | 53 70 72 69 6e 67 65 72 |C++" in |Springer|
|000038f0| 20 4c 65 63 74 75 72 65 | 0d 0a 20 20 20 4e 6f 74 | Lecture|.. Not|
|00003900| 65 73 20 69 6e 20 43 53 | 3a 20 22 41 64 61 20 45 |es in CS|: "Ada E|
|00003910| 75 72 6f 70 65 20 39 33 | 22 20 70 70 2e 31 32 35 |urope 93|" pp.125|
|00003920| 2d 31 34 31 20 28 73 68 | 6f 72 74 20 70 61 70 65 |-141 (sh|ort pape|
|00003930| 72 2c 20 67 6f 6f 64 20 | 72 65 61 64 69 6e 67 2c |r, good |reading,|
|00003940| 0d 0a 20 20 20 65 6e 6c | 69 67 68 74 65 6e 73 20 |.. enl|ightens |
|00003950| 69 64 69 6f 6d 73 29 0d | 0a 0d 0a 20 20 20 66 74 |idioms).|... ft|
|00003960| 70 20 61 6a 70 6f 2e 73 | 65 69 2e 63 6d 75 2e 65 |p ajpo.s|ei.cmu.e|
|00003970| 64 75 20 69 6e 20 64 69 | 72 65 63 74 6f 72 79 3a |du in di|rectory:|
|00003980| 20 2f 70 75 62 6c 69 63 | 2f 61 64 61 39 78 2c 20 | /public|/ada9x, |
|00003990| 64 6f 63 75 6d 65 6e 74 | 3a 0d 0a 20 20 20 39 78 |document|:.. 9x|
|000039a0| 5f 63 70 6c 75 73 2e 68 | 6c 70 0d 0a 0d 0a 0d 0a |_cplus.h|lp......|
|000039b0| 39 2e 36 3a 20 49 20 6b | 65 65 70 20 68 65 61 72 |9.6: I k|eep hear|
|000039c0| 69 6e 67 20 74 68 61 74 | 20 41 64 61 20 69 73 20 |ing that| Ada is |
|000039d0| 61 20 22 73 74 72 6f 6e | 67 6c 79 20 74 79 70 65 |a "stron|gly type|
|000039e0| 64 20 6c 61 6e 67 75 61 | 67 65 22 2c 20 62 75 74 |d langua|ge", but|
|000039f0| 20 69 74 20 73 65 65 6d | 73 0d 0a 64 69 66 66 65 | it seem|s..diffe|
|00003a00| 72 65 6e 74 20 66 72 6f | 6d 20 77 68 61 74 27 73 |rent fro|m what's|
|00003a10| 20 6d 65 61 6e 74 20 69 | 6e 20 43 2b 2b 2e 20 41 | meant i|n C++. A|
|00003a20| 72 65 20 74 68 65 79 20 | 64 69 66 66 65 72 65 6e |re they |differen|
|00003a30| 74 3f 0d 0a 0d 0a 20 20 | 20 28 54 75 63 6b 65 72 |t?.... | (Tucker|
|00003a40| 20 54 61 66 74 20 72 65 | 73 70 6f 6e 64 73 29 0d | Taft re|sponds).|
|00003a50| 0a 0d 0a 20 20 20 49 20 | 63 65 72 74 61 69 6e 6c |... I |certainl|
|00003a60| 79 20 61 67 72 65 65 20 | 74 68 61 74 20 41 4e 53 |y agree |that ANS|
|00003a70| 49 20 43 20 61 6e 64 20 | 43 2b 2b 20 61 72 65 20 |I C and |C++ are |
|00003a80| 73 74 61 74 69 63 61 6c | 6c 79 20 74 79 70 65 64 |statical|ly typed|
|00003a90| 20 6c 61 6e 67 75 61 67 | 65 73 2c 0d 0a 20 20 20 | languag|es,.. |
|00003aa0| 62 75 74 20 49 20 77 6f | 75 6c 64 20 64 65 62 61 |but I wo|uld deba|
|00003ab0| 74 65 20 74 68 65 20 22 | 73 74 72 65 6e 67 74 68 |te the "|strength|
|00003ac0| 22 20 6f 66 20 74 68 65 | 69 72 20 74 79 70 69 6e |" of the|ir typin|
|00003ad0| 67 2e 0d 0a 0d 0a 20 20 | 20 45 73 73 65 6e 74 69 |g..... | Essenti|
|00003ae0| 61 6c 6c 79 20 61 6e 79 | 20 73 75 70 70 6f 72 74 |ally any| support|
|00003af0| 20 66 6f 72 20 69 6d 70 | 6c 69 63 69 74 20 63 6f | for imp|licit co|
|00003b00| 6e 76 65 72 73 69 6f 6e | 20 28 69 6d 70 6c 69 63 |nversion| (implic|
|00003b10| 69 74 20 22 63 61 73 74 | 69 6e 67 2c 22 0d 0a 20 |it "cast|ing,".. |
|00003b20| 20 20 22 70 72 6f 6d 6f | 74 69 6f 6e 22 2c 20 22 | "promo|tion", "|
|00003b30| 75 73 75 61 6c 22 20 61 | 72 69 74 68 6d 65 74 69 |usual" a|rithmeti|
|00003b40| 63 20 63 6f 6e 76 65 72 | 73 69 6f 6e 73 2c 20 65 |c conver|sions, e|
|00003b50| 74 63 2e 29 20 22 77 65 | 61 6b 65 6e 73 22 20 61 |tc.) "we|akens" a|
|00003b60| 20 74 79 70 65 0d 0a 20 | 20 20 73 79 73 74 65 6d | type.. | system|
|00003b70| 20 28 62 75 74 20 61 6c | 73 6f 20 6d 61 6b 65 73 | (but al|so makes|
|00003b80| 20 69 74 20 22 66 72 69 | 65 6e 64 6c 69 65 72 22 | it "fri|endlier"|
|00003b90| 20 69 6e 20 73 6f 6d 65 | 20 77 61 79 73 29 2e 0d | in some| ways)..|
|00003ba0| 0a 0d 0a 20 20 20 43 20 | 61 6c 6c 6f 77 73 20 69 |... C |allows i|
|00003bb0| 6d 70 6c 69 63 69 74 20 | 63 6f 6e 76 65 72 73 69 |mplicit |conversi|
|00003bc0| 6f 6e 20 62 65 74 77 65 | 65 6e 20 61 6c 6c 20 69 |on betwe|en all i|
|00003bd0| 6e 74 65 67 65 72 20 74 | 79 70 65 73 20 61 6e 64 |nteger t|ypes and|
|00003be0| 20 61 6c 6c 0d 0a 20 20 | 20 65 6e 75 6d 65 72 61 | all.. | enumera|
|00003bf0| 74 69 6f 6e 20 74 79 70 | 65 73 2e 20 43 2b 2b 20 |tion typ|es. C++ |
|00003c00| 61 74 20 6c 65 61 73 74 | 20 63 75 74 73 20 6f 66 |at least| cuts of|
|00003c10| 66 20 69 6d 70 6c 69 63 | 69 74 20 63 6f 6e 76 65 |f implic|it conve|
|00003c20| 72 73 69 6f 6e 20 74 6f | 0d 0a 20 20 20 65 6e 75 |rsion to|.. enu|
|00003c30| 6d 65 72 61 74 69 6f 6e | 20 74 79 70 65 73 2c 20 |meration| types, |
|00003c40| 62 75 74 20 72 65 74 61 | 69 6e 73 20 69 6d 70 6c |but reta|ins impl|
|00003c50| 69 63 69 74 20 63 6f 6e | 76 65 72 73 69 6f 6e 20 |icit con|version |
|00003c60| 61 6d 6f 6e 67 20 61 6c | 6c 20 69 6e 74 65 67 65 |among al|l intege|
|00003c70| 72 0d 0a 20 20 20 28 61 | 6e 64 20 66 6c 6f 61 74 |r.. (a|nd float|
|00003c80| 69 6e 67 2d 70 6f 69 6e | 74 29 20 74 79 70 65 73 |ing-poin|t) types|
|00003c90| 2e 20 41 6c 73 6f 2c 20 | 69 6e 20 62 6f 74 68 20 |. Also, |in both |
|00003ca0| 43 20 61 6e 64 20 43 2b | 2b 2c 20 74 79 70 65 64 |C and C+|+, typed|
|00003cb0| 65 66 73 20 66 6f 72 0d | 0a 20 20 20 70 6f 69 6e |efs for.|. poin|
|00003cc0| 74 65 72 2f 61 72 72 61 | 79 20 74 79 70 65 73 20 |ter/arra|y types |
|00003cd0| 61 72 65 20 65 73 73 65 | 6e 74 69 61 6c 6c 79 20 |are esse|ntially |
|00003ce0| 22 6d 61 63 72 6f 73 22 | 3b 20 61 6c 6c 20 70 6f |"macros"|; all po|
|00003cf0| 69 6e 74 65 72 20 74 79 | 70 65 73 20 77 69 74 68 |inter ty|pes with|
|00003d00| 0d 0a 20 20 20 74 68 65 | 20 73 61 6d 65 20 74 61 |.. the| same ta|
|00003d10| 72 67 65 74 20 74 79 70 | 65 20 61 72 65 20 69 6d |rget typ|e are im|
|00003d20| 70 6c 69 63 69 74 6c 79 | 20 69 6e 74 65 72 63 6f |plicitly| interco|
|00003d30| 6e 76 65 72 74 69 62 6c | 65 2e 0d 0a 0d 0a 20 20 |nvertibl|e..... |
|00003d40| 20 46 69 6e 61 6c 6c 79 | 20 43 2b 2b 20 61 6c 6c | Finally| C++ all|
|00003d50| 6f 77 73 20 74 68 65 20 | 75 73 65 72 20 74 6f 20 |ows the |user to |
|00003d60| 64 65 66 69 6e 65 20 61 | 20 6e 75 6d 62 65 72 20 |define a| number |
|00003d70| 6f 66 20 74 68 65 69 72 | 20 6f 77 6e 20 69 6d 70 |of their| own imp|
|00003d80| 6c 69 63 69 74 0d 0a 20 | 20 20 63 6f 6e 76 65 72 |licit.. | conver|
|00003d90| 73 69 6f 6e 20 6f 70 65 | 72 61 74 6f 72 73 2c 20 |sion ope|rators, |
|00003da0| 77 68 69 63 68 20 62 61 | 73 69 63 61 6c 6c 79 20 |which ba|sically |
|00003db0| 61 6c 6c 6f 77 73 20 74 | 68 65 20 75 73 65 72 20 |allows t|he user |
|00003dc0| 74 6f 20 22 77 65 61 6b | 65 6e 22 20 74 68 65 0d |to "weak|en" the.|
|00003dd0| 0a 20 20 20 74 79 70 65 | 20 73 79 73 74 65 6d 20 |. type| system |
|00003de0| 61 73 20 74 68 65 79 20 | 73 65 65 20 66 69 74 2e |as they |see fit.|
|00003df0| 0d 0a 0d 0a 20 20 20 4f | 66 20 63 6f 75 72 73 65 |.... O|f course|
|00003e00| 2c 20 61 6c 6c 20 6f 66 | 20 74 68 69 73 20 69 6d |, all of| this im|
|00003e10| 70 6c 69 63 69 74 20 63 | 6f 6e 76 65 72 73 69 6f |plicit c|onversio|
|00003e20| 6e 20 73 65 72 76 65 73 | 20 61 20 70 75 72 70 6f |n serves| a purpo|
|00003e30| 73 65 2c 20 62 75 74 20 | 69 74 0d 0a 20 20 20 64 |se, but |it.. d|
|00003e40| 6f 65 73 20 74 65 6e 64 | 20 74 6f 20 6d 6f 76 65 |oes tend| to move|
|00003e50| 20 43 2f 43 2b 2b 20 74 | 6f 77 61 72 64 20 74 68 | C/C++ t|oward th|
|00003e60| 65 20 22 77 65 61 6b 65 | 72 22 20 65 6e 64 20 6f |e "weake|r" end o|
|00003e70| 66 20 74 68 65 20 77 65 | 61 6b 20 76 73 2e 20 73 |f the we|ak vs. s|
|00003e80| 74 72 6f 6e 67 0d 0a 20 | 20 20 74 79 70 69 6e 67 |trong.. | typing|
|00003e90| 20 73 70 65 63 74 72 75 | 6d 2e 0d 0a 0d 0a 20 20 | spectru|m..... |
|00003ea0| 20 4e 6f 74 65 20 74 68 | 61 74 20 74 68 65 20 22 | Note th|at the "|
|00003eb0| 73 74 72 6f 6e 67 22 20 | 64 69 73 74 69 6e 63 74 |strong" |distinct|
|00003ec0| 69 6f 6e 73 20 62 65 74 | 77 65 65 6e 20 69 6e 74 |ions bet|ween int|
|00003ed0| 65 67 65 72 20 74 79 70 | 65 73 20 68 65 6c 70 73 |eger typ|es helps|
|00003ee0| 0d 0a 20 20 20 64 72 61 | 6d 61 74 69 63 61 6c 6c |.. dra|maticall|
|00003ef0| 79 20 69 6e 20 63 61 74 | 63 68 69 6e 67 20 28 61 |y in cat|ching (a|
|00003f00| 74 20 63 6f 6d 70 69 6c | 65 2d 74 69 6d 65 29 20 |t compil|e-time) |
|00003f10| 61 72 72 61 79 20 69 6e | 64 65 78 69 6e 67 20 65 |array in|dexing e|
|00003f20| 72 72 6f 72 73 20 69 6e | 0d 0a 20 20 20 41 64 61 |rrors in|.. Ada|
|00003f30| 20 70 72 6f 67 72 61 6d | 73 2c 20 62 79 20 6d 61 | program|s, by ma|
|00003f40| 6b 69 6e 67 20 73 75 72 | 65 20 74 68 61 74 20 69 |king sur|e that i|
|00003f50| 66 20 79 6f 75 20 68 61 | 76 65 20 61 6e 20 61 72 |f you ha|ve an ar|
|00003f60| 72 61 79 20 69 6e 64 65 | 78 65 64 20 62 79 20 61 |ray inde|xed by a|
|00003f70| 0d 0a 20 20 20 63 6f 75 | 6e 74 20 6f 66 20 61 70 |.. cou|nt of ap|
|00003f80| 70 6c 65 73 2c 20 79 6f | 75 20 64 6f 6e 27 74 20 |ples, yo|u don't |
|00003f90| 69 6e 64 65 78 20 69 6e | 74 6f 20 69 74 20 77 69 |index in|to it wi|
|00003fa0| 74 68 20 61 20 63 6f 75 | 6e 74 20 6f 66 20 6f 72 |th a cou|nt of or|
|00003fb0| 61 6e 67 65 73 0d 0a 20 | 20 20 28 77 69 74 68 6f |anges.. | (witho|
|00003fc0| 75 74 20 61 6e 20 2a 65 | 78 70 6c 69 63 69 74 2a |ut an *e|xplicit*|
|00003fd0| 20 63 6f 6e 76 65 72 73 | 69 6f 6e 29 2e 20 54 68 | convers|ion). Th|
|00003fe0| 65 20 61 64 76 61 6e 74 | 61 67 65 73 20 6f 66 20 |e advant|ages of |
|00003ff0| 22 73 74 72 6f 6e 67 6c | 79 22 0d 0a 20 20 20 64 |"strongl|y".. d|
|00004000| 69 73 74 69 6e 67 75 69 | 73 68 69 6e 67 20 65 6e |istingui|shing en|
|00004010| 75 6d 65 72 61 74 69 6f | 6e 20 74 79 70 65 73 20 |umeratio|n types |
|00004020| 69 73 20 65 76 65 6e 20 | 6d 6f 72 65 20 6f 62 76 |is even |more obv|
|00004030| 69 6f 75 73 20 28 61 6e | 64 20 74 68 65 0d 0a 20 |ious (an|d the.. |
|00004040| 20 20 64 65 73 69 67 6e | 65 72 73 20 6f 66 20 43 | design|ers of C|
|00004050| 2b 2b 20 72 65 63 6f 67 | 6e 69 7a 65 64 20 74 68 |++ recog|nized th|
|00004060| 69 73 29 2e 0d 0a 0d 0a | 20 20 20 54 68 65 20 73 |is).....| The s|
|00004070| 74 72 6f 6e 67 20 64 69 | 73 74 69 6e 63 74 69 6f |trong di|stinctio|
|00004080| 6e 73 20 62 65 74 77 65 | 65 6e 20 61 63 63 65 73 |ns betwe|en acces|
|00004090| 73 20 74 79 70 65 73 20 | 28 70 6f 69 6e 74 65 72 |s types |(pointer|
|000040a0| 20 74 79 70 65 73 29 20 | 69 6e 20 41 64 61 0d 0a | types) |in Ada..|
|000040b0| 20 20 20 61 6c 73 6f 20 | 68 61 73 20 61 64 76 61 | also |has adva|
|000040c0| 6e 74 61 67 65 73 2c 20 | 61 6c 6c 6f 77 69 6e 67 |ntages, |allowing|
|000040d0| 20 61 63 63 65 73 73 20 | 74 79 70 65 73 20 74 6f | access |types to|
|000040e0| 20 62 65 20 72 65 70 72 | 65 73 65 6e 74 65 64 20 | be repr|esented |
|000040f0| 61 73 0d 0a 20 20 20 6f | 66 66 73 65 74 73 20 77 |as.. o|ffsets w|
|00004100| 69 74 68 69 6e 20 74 68 | 65 69 72 20 73 74 6f 72 |ithin th|eir stor|
|00004110| 61 67 65 20 70 6f 6f 6c | 20 72 61 74 68 65 72 20 |age pool| rather |
|00004120| 74 68 61 6e 20 61 73 20 | 61 64 64 72 65 73 73 65 |than as |addresse|
|00004130| 73 2c 20 61 6e 64 20 67 | 69 76 69 6e 67 0d 0a 20 |s, and g|iving.. |
|00004140| 20 20 6d 6f 72 65 20 68 | 69 67 68 2d 6c 65 76 65 | more h|igh-leve|
|00004150| 6c 20 63 6f 6e 74 72 6f | 6c 20 6f 76 65 72 20 73 |l contro|l over s|
|00004160| 74 6f 72 61 67 65 20 6d | 61 6e 61 67 65 6d 65 6e |torage m|anagemen|
|00004170| 74 2e 0d 0a 0d 0a 20 20 | 20 53 74 72 6f 6e 67 20 |t..... | Strong |
|00004180| 74 79 70 69 6e 67 20 63 | 61 6e 20 62 65 20 63 61 |typing c|an be ca|
|00004190| 72 72 69 65 64 20 74 6f | 6f 20 66 61 72 2c 20 61 |rried to|o far, a|
|000041a0| 6e 64 20 73 6f 6d 65 20 | 61 6d 6f 75 6e 74 20 6f |nd some |amount o|
|000041b0| 66 20 69 6d 70 6c 69 63 | 69 74 0d 0a 20 20 20 63 |f implic|it.. c|
|000041c0| 6f 6e 76 65 72 73 69 6f | 6e 20 69 73 20 65 73 73 |onversio|n is ess|
|000041d0| 65 6e 74 69 61 6c 20 74 | 6f 20 6d 61 6b 65 20 4f |ential t|o make O|
|000041e0| 4f 50 20 70 61 6c 61 74 | 61 62 6c 65 2e 20 42 75 |OP palat|able. Bu|
|000041f0| 74 20 6e 6f 74 65 20 74 | 68 61 74 20 69 6e 20 41 |t note t|hat in A|
|00004200| 64 61 0d 0a 20 20 20 39 | 58 2c 20 65 76 65 6e 20 |da.. 9|X, even |
|00004210| 77 69 74 68 20 4f 4f 50 | 2c 20 77 65 20 64 6f 6e |with OOP|, we don|
|00004220| 27 74 20 61 6c 6c 6f 77 | 20 69 6d 70 6c 69 63 69 |'t allow| implici|
|00004230| 74 20 63 6f 6e 76 65 72 | 73 69 6f 6e 73 20 74 68 |t conver|sions th|
|00004240| 61 74 20 74 72 75 6e 63 | 61 74 65 0d 0a 20 20 20 |at trunc|ate.. |
|00004250| 74 68 65 20 65 78 74 65 | 6e 73 69 6f 6e 20 70 61 |the exte|nsion pa|
|00004260| 72 74 20 6f 66 20 61 20 | 72 65 63 6f 72 64 20 28 |rt of a |record (|
|00004270| 74 68 69 73 20 69 73 20 | 61 20 72 65 6c 61 74 69 |this is |a relati|
|00004280| 76 65 6c 79 20 63 6f 6d | 6d 6f 6e 20 6d 69 73 74 |vely com|mon mist|
|00004290| 61 6b 65 20 69 6e 0d 0a | 20 20 20 43 2b 2b 20 77 |ake in..| C++ w|
|000042a0| 68 65 6e 20 70 61 73 73 | 69 6e 67 20 70 61 72 61 |hen pass|ing para|
|000042b0| 6d 65 74 65 72 73 20 62 | 79 20 76 61 6c 75 65 29 |meters b|y value)|
|000042c0| 2e 20 49 6e 73 74 65 61 | 64 2c 20 69 6e 20 41 64 |. Instea|d, in Ad|
|000042d0| 61 20 39 58 2c 20 74 68 | 65 0d 0a 20 20 20 6c 61 |a 9X, th|e.. la|
|000042e0| 6e 67 75 61 67 65 20 64 | 69 73 74 69 6e 67 75 69 |nguage d|istingui|
|000042f0| 73 68 65 73 20 62 65 74 | 77 65 65 6e 20 61 20 73 |shes bet|ween a s|
|00004300| 70 65 63 69 66 69 63 20 | 74 79 70 65 20 54 20 61 |pecific |type T a|
|00004310| 6e 64 20 74 68 65 20 63 | 6c 61 73 73 2d 77 69 64 |nd the c|lass-wid|
|00004320| 65 0d 0a 20 20 20 74 79 | 70 65 20 54 27 43 6c 61 |e.. ty|pe T'Cla|
|00004330| 73 73 2c 20 61 6e 64 20 | 61 6c 6c 6f 77 73 20 69 |ss, and |allows i|
|00004340| 6d 70 6c 69 63 69 74 20 | 63 6f 6e 76 65 72 73 69 |mplicit |conversi|
|00004350| 6f 6e 73 20 74 6f 20 54 | 27 43 6c 61 73 73 20 66 |ons to T|'Class f|
|00004360| 72 6f 6d 20 54 20 6f 72 | 20 61 6e 79 0d 0a 20 20 |rom T or| any.. |
|00004370| 20 6f 66 20 69 74 73 20 | 64 65 72 69 76 61 74 69 | of its |derivati|
|00004380| 76 65 73 2c 20 62 75 74 | 20 6e 6f 74 20 74 6f 20 |ves, but| not to |
|00004390| 74 68 65 20 73 70 65 63 | 69 66 69 63 20 74 79 70 |the spec|ific typ|
|000043a0| 65 20 54 2e 20 43 6f 6e | 76 65 72 73 69 6f 6e 73 |e T. Con|versions|
|000043b0| 20 74 6f 20 74 68 65 0d | 0a 20 20 20 63 6c 61 73 | to the.|. clas|
|000043c0| 73 2d 77 69 64 65 20 74 | 79 70 65 20 6e 65 76 65 |s-wide t|ype neve|
|000043d0| 72 20 69 6d 70 6c 69 63 | 69 74 6c 79 20 74 72 75 |r implic|itly tru|
|000043e0| 6e 63 61 74 65 20 74 68 | 65 20 65 78 74 65 6e 73 |ncate th|e extens|
|000043f0| 69 6f 6e 20 70 61 72 74 | 2e 0d 0a 20 20 20 43 6f |ion part|... Co|
|00004400| 6e 76 65 72 73 69 6f 6e | 73 20 74 6f 20 61 20 73 |nversion|s to a s|
|00004410| 70 65 63 69 66 69 63 20 | 74 79 70 65 20 63 61 6e |pecific |type can|
|00004420| 20 74 72 75 6e 63 61 74 | 65 2c 20 61 6e 64 20 68 | truncat|e, and h|
|00004430| 65 6e 63 65 20 6d 75 73 | 74 20 62 65 0d 0a 20 20 |ence mus|t be.. |
|00004440| 20 65 78 70 6c 69 63 69 | 74 2e 0d 0a 0d 0a 20 20 | explici|t..... |
|00004450| 20 4e 6f 74 65 20 61 6c | 73 6f 20 74 68 61 74 20 | Note al|so that |
|00004460| 69 6e 20 41 64 61 20 74 | 68 65 72 65 20 61 72 65 |in Ada t|here are|
|00004470| 20 74 68 72 65 65 20 64 | 69 73 74 69 6e 63 74 20 | three d|istinct |
|00004480| 6b 69 6e 64 73 20 6f 66 | 20 63 6f 6e 76 65 72 73 |kinds of| convers|
|00004490| 69 6f 6e 73 2c 0d 0a 20 | 20 20 69 6d 70 6c 69 63 |ions,.. | implic|
|000044a0| 69 74 20 6f 6e 65 73 2c | 20 65 78 70 6c 69 63 69 |it ones,| explici|
|000044b0| 74 20 6f 6e 65 73 2c 20 | 61 6e 64 20 75 6e 63 68 |t ones, |and unch|
|000044c0| 65 63 6b 65 64 20 6f 6e | 65 73 2e 20 4f 6e 6c 79 |ecked on|es. Only|
|000044d0| 20 74 68 65 20 75 6e 63 | 68 65 63 6b 65 64 0d 0a | the unc|hecked..|
|000044e0| 20 20 20 6f 6e 65 73 20 | 61 72 65 20 70 6f 74 65 | ones |are pote|
|000044f0| 6e 74 69 61 6c 6c 79 20 | 75 6e 73 61 66 65 2e 20 |ntially |unsafe. |
|00004500| 54 68 65 20 65 78 70 6c | 69 63 69 74 20 6f 6e 65 |The expl|icit one|
|00004510| 73 20 61 72 65 20 73 61 | 66 65 2c 20 77 69 74 68 |s are sa|fe, with|
|00004520| 20 65 69 74 68 65 72 0d | 0a 20 20 20 63 6f 6d 70 | either.|. comp|
|00004530| 69 6c 65 2d 74 69 6d 65 | 20 6f 72 20 72 75 6e 2d |ile-time| or run-|
|00004540| 74 69 6d 65 20 63 68 65 | 63 6b 73 20 74 6f 20 65 |time che|cks to e|
|00004550| 6e 73 75 72 65 20 74 68 | 61 74 2e 20 49 6e 20 43 |nsure th|at. In C|
|00004560| 20 74 68 65 72 65 20 61 | 72 65 20 6f 6e 6c 79 0d | there a|re only.|
|00004570| 0a 20 20 20 69 6d 70 6c | 69 63 69 74 20 61 6e 64 |. impl|icit and|
|00004580| 20 65 78 70 6c 69 63 69 | 74 2f 75 6e 63 68 65 63 | explici|t/unchec|
|00004590| 6b 65 64 20 63 6f 6e 76 | 65 72 73 69 6f 6e 73 2e |ked conv|ersions.|
|000045a0| 20 43 2b 2b 20 68 61 73 | 20 72 65 63 65 6e 74 6c | C++ has| recentl|
|000045b0| 79 20 61 64 64 65 64 20 | 61 0d 0a 20 20 20 63 68 |y added |a.. ch|
|000045c0| 65 63 6b 65 64 2c 20 65 | 78 70 6c 69 63 69 74 20 |ecked, e|xplicit |
|000045d0| 22 64 79 6e 61 6d 69 63 | 22 20 63 61 73 74 2c 20 |"dynamic|" cast, |
|000045e0| 62 75 74 20 73 74 69 6c | 6c 20 69 74 20 77 69 6c |but stil|l it wil|
|000045f0| 6c 20 62 65 20 63 6f 6d | 6d 6f 6e 20 74 6f 20 75 |l be com|mon to u|
|00004600| 73 65 0d 0a 20 20 20 22 | 6e 6f 72 6d 61 6c 22 20 |se.. "|normal" |
|00004610| 65 78 70 6c 69 63 69 74 | 20 63 61 73 74 73 20 66 |explicit| casts f|
|00004620| 6f 72 20 62 6f 74 68 20 | 63 68 65 63 6b 65 64 20 |or both |checked |
|00004630| 61 6e 64 20 75 6e 63 68 | 65 63 6b 65 64 20 63 6f |and unch|ecked co|
|00004640| 6e 76 65 72 73 69 6f 6e | 73 2c 0d 0a 20 20 20 74 |nversion|s,.. t|
|00004650| 68 65 72 65 62 79 20 6d | 61 6b 69 6e 67 20 69 74 |hereby m|aking it|
|00004660| 20 6d 6f 72 65 20 64 69 | 66 66 69 63 75 6c 74 20 | more di|fficult |
|00004670| 74 6f 20 69 64 65 6e 74 | 69 66 79 20 70 6c 61 63 |to ident|ify plac|
|00004680| 65 73 20 77 68 65 72 65 | 20 74 68 65 20 74 79 70 |es where| the typ|
|00004690| 65 0d 0a 20 20 20 73 79 | 73 74 65 6d 20 6d 69 67 |e.. sy|stem mig|
|000046a0| 68 74 20 62 65 20 63 6f | 6d 70 72 6f 6d 69 73 65 |ht be co|mpromise|
|000046b0| 64 2e 0d 0a 0d 0a 20 20 | 20 48 65 6e 63 65 2c 20 |d..... | Hence, |
|000046c0| 74 68 65 20 62 6f 74 74 | 6f 6d 20 6c 69 6e 65 20 |the bott|om line |
|000046d0| 69 73 20 74 68 61 74 20 | 74 68 65 20 74 79 70 65 |is that |the type|
|000046e0| 20 63 68 65 63 6b 69 6e | 67 20 69 73 20 28 6f 62 | checkin|g is (ob|
|000046f0| 6a 65 63 74 69 76 65 6c | 79 29 0d 0a 20 20 20 22 |jectivel|y).. "|
|00004700| 73 74 72 6f 6e 67 65 72 | 22 20 69 6e 20 41 64 61 |stronger|" in Ada|
|00004710| 20 74 68 61 6e 20 43 2f | 43 2b 2b 2c 20 74 68 6f | than C/|C++, tho|
|00004720| 75 67 68 20 74 68 61 74 | 20 64 6f 65 73 6e 27 74 |ugh that| doesn't|
|00004730| 20 6e 65 63 65 73 73 61 | 72 69 6c 79 20 6d 65 61 | necessa|rily mea|
|00004740| 6e 0d 0a 20 20 20 22 62 | 65 74 74 65 72 22 20 2d |n.. "b|etter" -|
|00004750| 2d 20 77 68 65 74 68 65 | 72 20 6f 6e 65 20 69 73 |- whethe|r one is|
|00004760| 20 22 62 65 74 74 65 72 | 22 20 66 6f 72 20 61 20 | "better|" for a |
|00004770| 70 61 72 74 69 63 75 6c | 61 72 20 73 74 79 6c 65 |particul|ar style|
|00004780| 20 6f 66 0d 0a 20 20 20 | 70 72 6f 67 72 61 6d 6d | of.. |programm|
|00004790| 69 6e 67 20 74 68 61 6e | 20 74 68 65 20 6f 74 68 |ing than| the oth|
|000047a0| 65 72 20 69 73 20 61 20 | 22 72 65 6c 69 67 69 6f |er is a |"religio|
|000047b0| 75 73 22 20 69 73 73 75 | 65 20 49 4d 48 4f 2e 20 |us" issu|e IMHO. |
|000047c0| 49 20 6b 6e 6f 77 20 6d | 79 0d 0a 20 20 20 72 65 |I know m|y.. re|
|000047d0| 6c 69 67 69 6f 6e 20 63 | 75 72 72 65 6e 74 6c 79 |ligion c|urrently|
|000047e0| 20 66 61 76 6f 72 73 20 | 74 68 65 20 73 74 72 6f | favors |the stro|
|000047f0| 6e 67 65 72 20 63 68 65 | 63 6b 69 6e 67 20 6f 66 |nger che|cking of|
|00004800| 20 41 64 61 20 69 6e 20 | 6d 6f 73 74 20 63 61 73 | Ada in |most cas|
|00004810| 65 73 0d 0a 20 20 20 5b | 65 78 63 65 70 74 20 70 |es.. [|except p|
|00004820| 65 72 68 61 70 73 20 66 | 6f 72 20 6d 75 6c 74 69 |erhaps f|or multi|
|00004830| 70 6c 79 2f 64 69 76 69 | 64 65 2c 20 77 68 65 72 |ply/divi|de, wher|
|00004840| 65 20 49 20 70 65 72 73 | 6f 6e 61 6c 6c 79 20 62 |e I pers|onally b|
|00004850| 65 6c 69 65 76 65 20 74 | 68 65 0d 0a 20 20 20 63 |elieve t|he.. c|
|00004860| 68 65 63 6b 69 6e 67 20 | 73 68 6f 75 6c 64 20 65 |hecking |should e|
|00004870| 69 74 68 65 72 20 62 65 | 20 77 65 61 6b 65 72 2c |ither be| weaker,|
|00004880| 20 6f 72 20 64 69 72 65 | 63 74 6c 79 20 73 75 70 | or dire|ctly sup|
|00004890| 70 6f 72 74 20 74 68 65 | 20 63 6f 6e 63 65 70 74 |port the| concept|
|000048a0| 20 6f 66 0d 0a 20 20 20 | 22 75 6e 69 74 73 22 2f | of.. |"units"/|
|000048b0| 22 64 69 6d 65 6e 73 69 | 6f 6e 73 22 5d 2e 0d 0a |"dimensi|ons"]...|
|000048c0| 0d 0a 0d 0a 39 2e 37 3a | 20 49 27 6d 20 74 6f 6c |....9.7:| I'm tol|
|000048d0| 64 20 41 64 61 20 64 6f | 65 73 20 61 6c 6c 20 73 |d Ada do|es all s|
|000048e0| 6f 72 74 73 20 6f 66 20 | 73 74 61 74 69 63 20 74 |orts of |static t|
|000048f0| 79 70 65 20 63 68 65 63 | 6b 69 6e 67 2c 20 62 75 |ype chec|king, bu|
|00004900| 74 20 63 61 6e 27 74 20 | 79 6f 75 20 67 65 74 0d |t can't |you get.|
|00004910| 0a 74 68 65 20 73 61 6d | 65 20 65 66 66 65 63 74 |.the sam|e effect|
|00004920| 20 75 73 69 6e 67 20 61 | 20 74 6f 6f 6c 20 6c 69 | using a| tool li|
|00004930| 6b 65 20 22 6c 69 6e 74 | 22 20 77 69 74 68 20 43 |ke "lint|" with C|
|00004940| 3f 0d 0a 0d 0a 20 20 20 | 4e 6f 2c 20 68 65 72 65 |?.... |No, here|
|00004950| 20 61 72 65 20 61 20 66 | 65 77 20 72 65 61 73 6f | are a f|ew reaso|
|00004960| 6e 73 20 77 68 79 20 28 | 74 68 69 73 20 6c 69 73 |ns why (|this lis|
|00004970| 74 20 69 73 20 62 79 20 | 6e 6f 20 6d 65 61 6e 73 |t is by |no means|
|00004980| 20 63 6f 6d 70 6c 65 74 | 65 29 3a 0d 0a 0d 0a 20 | complet|e):.... |
|00004990| 20 20 28 53 75 62 6d 69 | 74 74 65 64 20 62 79 20 | (Submi|tted by |
|000049a0| 4e 6f 72 6d 20 43 6f 68 | 65 6e 29 0d 0a 20 20 20 |Norm Coh|en).. |
|000049b0| 20 20 2a 20 52 75 6e 6e | 69 6e 67 20 62 6f 74 68 | * Runn|ing both|
|000049c0| 20 4c 69 6e 74 20 61 6e | 64 20 61 20 43 20 63 6f | Lint an|d a C co|
|000049d0| 6d 70 69 6c 65 72 20 72 | 65 71 75 69 72 65 73 20 |mpiler r|equires |
|000049e0| 74 68 65 20 70 72 6f 67 | 72 61 6d 20 74 65 78 74 |the prog|ram text|
|000049f0| 20 74 6f 20 62 65 0d 0a | 20 20 20 20 20 20 20 70 | to be..| p|
|00004a00| 61 72 73 65 64 20 61 6e | 64 20 73 65 6d 61 6e 74 |arsed an|d semant|
|00004a10| 69 63 61 6c 6c 79 20 61 | 6e 61 6c 79 7a 65 64 20 |ically a|nalyzed |
|00004a20| 74 77 69 63 65 2e 20 54 | 68 65 20 72 65 73 75 6c |twice. T|he resul|
|00004a30| 74 73 20 6f 66 20 61 6e | 20 41 64 61 0d 0a 20 20 |ts of an| Ada.. |
|00004a40| 20 20 20 20 20 63 6f 6d | 70 69 6c 65 72 27 73 20 | com|piler's |
|00004a50| 70 61 72 73 65 20 61 6e | 64 20 73 65 6d 61 6e 74 |parse an|d semant|
|00004a60| 69 63 20 61 6e 61 6c 79 | 73 69 73 20 61 72 65 20 |ic analy|sis are |
|00004a70| 75 73 65 64 20 64 69 72 | 65 63 74 6c 79 20 69 6e |used dir|ectly in|
|00004a80| 0d 0a 20 20 20 20 20 20 | 20 70 65 72 66 6f 72 6d |.. | perform|
|00004a90| 69 6e 67 20 63 6f 6e 73 | 69 73 74 65 6e 63 79 20 |ing cons|istency |
|00004aa0| 63 68 65 63 6b 73 2e 0d | 0a 0d 0a 20 20 20 20 20 |checks..|... |
|00004ab0| 2a 20 54 68 65 20 72 75 | 6c 65 73 20 6f 66 20 41 |* The ru|les of A|
|00004ac0| 64 61 20 70 72 6f 76 69 | 64 65 20 74 68 65 20 6f |da provi|de the o|
|00004ad0| 70 70 6f 72 74 75 6e 69 | 74 79 20 66 6f 72 20 73 |pportuni|ty for s|
|00004ae0| 74 72 6f 6e 67 65 72 20 | 63 6f 6e 73 69 73 74 65 |tronger |consiste|
|00004af0| 6e 63 79 0d 0a 20 20 20 | 20 20 20 20 63 68 65 63 |ncy.. | chec|
|00004b00| 6b 73 20 74 68 61 6e 20 | 61 72 65 20 70 6f 73 73 |ks than |are poss|
|00004b10| 69 62 6c 65 20 77 69 74 | 68 20 43 2e 20 46 6f 72 |ible wit|h C. For|
|00004b20| 20 65 78 61 6d 70 6c 65 | 2c 20 61 6e 20 41 64 61 | example|, an Ada|
|00004b30| 20 70 72 6f 67 72 61 6d | 6d 65 72 0d 0a 20 20 20 | program|mer.. |
|00004b40| 20 20 20 20 63 61 6e 20 | 64 65 63 6c 61 72 65 20 | can |declare |
|00004b50| 64 69 73 74 69 6e 63 74 | 20 69 6e 74 65 67 65 72 |distinct| integer|
|00004b60| 20 74 79 70 65 73 20 74 | 6f 20 72 65 70 72 65 73 | types t|o repres|
|00004b70| 65 6e 74 20 64 69 73 74 | 69 6e 63 74 0d 0a 20 20 |ent dist|inct.. |
|00004b80| 20 20 20 20 20 61 62 73 | 74 72 61 63 74 69 6f 6e | abs|traction|
|00004b90| 73 2e 20 41 6e 20 41 64 | 61 20 63 6f 6d 70 69 6c |s. An Ad|a compil|
|00004ba0| 65 72 20 77 69 6c 6c 20 | 63 61 74 63 68 20 61 6e |er will |catch an|
|00004bb0| 20 69 6e 61 64 76 65 72 | 74 65 6e 74 0d 0a 20 20 | inadver|tent.. |
|00004bc0| 20 20 20 20 20 69 6e 74 | 65 72 6d 69 78 69 6e 67 | int|ermixing|
|00004bd0| 20 6f 66 20 74 68 65 73 | 65 20 74 77 6f 20 74 79 | of thes|e two ty|
|00004be0| 70 65 73 2c 20 62 75 74 | 20 74 68 65 72 65 20 69 |pes, but| there i|
|00004bf0| 73 20 6e 6f 20 77 61 79 | 20 61 0d 0a 20 20 20 20 |s no way| a.. |
|00004c00| 20 20 20 63 6f 72 72 65 | 73 70 6f 6e 64 69 6e 67 | corre|sponding|
|00004c10| 20 64 69 73 74 69 6e 63 | 74 69 6f 6e 20 63 61 6e | distinc|tion can|
|00004c20| 20 62 65 20 6d 61 64 65 | 20 69 6e 20 43 2c 20 73 | be made| in C, s|
|00004c30| 6f 20 74 68 65 72 65 20 | 69 73 20 6e 6f 20 77 61 |o there |is no wa|
|00004c40| 79 20 66 6f 72 0d 0a 20 | 20 20 20 20 20 20 4c 69 |y for.. | Li|
|00004c50| 6e 74 20 74 6f 20 70 65 | 72 66 6f 72 6d 20 61 20 |nt to pe|rform a |
|00004c60| 63 6f 72 72 65 73 70 6f | 6e 64 69 6e 67 20 63 68 |correspo|nding ch|
|00004c70| 65 63 6b 2e 20 53 69 6d | 69 6c 61 72 6c 79 2c 20 |eck. Sim|ilarly, |
|00004c80| 69 6e 20 43 2c 20 61 20 | 70 6f 69 6e 74 65 72 0d |in C, a |pointer.|
|00004c90| 0a 20 20 20 20 20 20 20 | 74 6f 20 61 6e 20 6f 62 |. |to an ob|
|00004ca0| 6a 65 63 74 20 6f 66 20 | 74 79 70 65 20 54 20 69 |ject of |type T i|
|00004cb0| 73 20 69 6e 64 69 73 74 | 69 6e 67 75 69 73 68 61 |s indist|inguisha|
|00004cc0| 62 6c 65 20 66 72 6f 6d | 20 61 6e 20 61 72 72 61 |ble from| an arra|
|00004cd0| 79 20 6f 66 0d 0a 20 20 | 20 20 20 20 20 6f 62 6a |y of.. | obj|
|00004ce0| 65 63 74 73 20 6f 66 20 | 74 79 70 65 20 54 2e 0d |ects of |type T..|
|00004cf0| 0a 0d 0a 20 20 20 20 20 | 2a 20 54 68 65 20 72 75 |... |* The ru|
|00004d00| 6c 65 73 20 6f 66 20 74 | 68 65 20 41 64 61 20 6c |les of t|he Ada l|
|00004d10| 61 6e 67 75 61 67 65 20 | 65 6e 73 75 72 65 20 74 |anguage |ensure t|
|00004d20| 68 61 74 20 74 68 65 20 | 70 72 6f 67 72 61 6d 20 |hat the |program |
|00004d30| 74 65 78 74 0d 0a 20 20 | 20 20 20 20 20 70 72 6f |text.. | pro|
|00004d40| 76 69 64 65 73 20 69 6e | 66 6f 72 6d 61 74 69 6f |vides in|formatio|
|00004d50| 6e 20 61 6c 6c 6f 77 69 | 6e 67 20 50 52 45 43 49 |n allowi|ng PRECI|
|00004d60| 53 45 20 63 6f 6e 73 69 | 73 74 65 6e 63 79 20 63 |SE consi|stency c|
|00004d70| 68 65 63 6b 73 2e 20 46 | 6f 72 0d 0a 20 20 20 20 |hecks. F|or.. |
|00004d80| 20 20 20 65 78 61 6d 70 | 6c 65 2c 20 74 68 65 20 | examp|le, the |
|00004d90| 65 78 70 72 65 73 73 69 | 6f 6e 20 69 6e 20 61 6e |expressi|on in an|
|00004da0| 20 41 64 61 20 63 61 73 | 65 20 73 74 61 74 65 6d | Ada cas|e statem|
|00004db0| 65 6e 74 20 63 61 6e 20 | 62 65 20 77 72 69 74 74 |ent can |be writt|
|00004dc0| 65 6e 20 74 6f 0d 0a 20 | 20 20 20 20 20 20 68 61 |en to.. | ha|
|00004dd0| 76 65 20 61 20 73 74 61 | 74 69 63 20 73 75 62 74 |ve a sta|tic subt|
|00004de0| 79 70 65 2c 20 61 6c 6c | 6f 77 69 6e 67 20 74 68 |ype, all|owing th|
|00004df0| 65 20 63 6f 6d 70 69 6c | 65 72 20 74 6f 20 61 73 |e compil|er to as|
|00004e00| 63 65 72 74 61 69 6e 20 | 74 68 61 74 20 61 6c 6c |certain |that all|
|00004e10| 0d 0a 20 20 20 20 20 20 | 20 70 6f 73 73 69 62 6c |.. | possibl|
|00004e20| 65 20 76 61 6c 75 65 73 | 20 68 61 76 65 20 62 65 |e values| have be|
|00004e30| 65 6e 20 63 6f 76 65 72 | 65 64 20 77 69 74 68 6f |en cover|ed witho|
|00004e40| 75 74 20 72 65 73 6f 72 | 74 69 6e 67 20 74 6f 20 |ut resor|ting to |
|00004e50| 61 20 64 65 66 61 75 6c | 74 0d 0a 20 20 20 20 20 |a defaul|t.. |
|00004e60| 20 20 28 77 68 65 6e 20 | 6f 74 68 65 72 73 29 20 | (when |others) |
|00004e70| 61 72 6d 2e 0d 0a 0d 0a | 20 20 20 20 20 2a 20 57 |arm.....| * W|
|00004e80| 69 74 68 20 6c 61 63 6b | 20 6f 66 20 70 72 65 63 |ith lack| of prec|
|00004e90| 69 73 65 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 2c |ise info|rmation,|
|00004ea0| 20 4c 69 6e 74 20 68 61 | 73 20 6e 6f 20 63 68 6f | Lint ha|s no cho|
|00004eb0| 69 63 65 20 62 75 74 20 | 74 6f 20 62 65 0d 0a 20 |ice but |to be.. |
|00004ec0| 20 20 20 20 20 20 6f 76 | 65 72 6c 79 20 70 65 73 | ov|erly pes|
|00004ed0| 73 69 6d 69 73 74 69 63 | 20 6f 72 2c 20 77 69 74 |simistic| or, wit|
|00004ee0| 68 20 64 69 66 66 65 72 | 65 6e 74 20 73 65 74 74 |h differ|ent sett|
|00004ef0| 69 6e 67 73 20 66 6f 72 | 20 61 20 63 6f 6d 70 6c |ings for| a compl|
|00004f00| 69 63 61 74 65 64 0d 0a | 20 20 20 20 20 20 20 73 |icated..| s|
|00004f10| 65 74 20 6f 66 20 6f 70 | 74 69 6f 6e 73 2c 20 6f |et of op|tions, o|
|00004f20| 76 65 72 6c 79 20 6f 70 | 74 69 6d 69 73 74 69 63 |verly op|timistic|
|00004f30| 2e 20 57 68 65 6e 20 69 | 74 20 69 73 20 6f 76 65 |. When i|t is ove|
|00004f40| 72 6c 79 20 70 65 73 73 | 69 6d 69 73 74 69 63 2c |rly pess|imistic,|
|00004f50| 0d 0a 20 20 20 20 20 20 | 20 74 68 65 20 75 73 65 |.. | the use|
|00004f60| 72 20 73 65 65 73 20 74 | 6f 6f 20 6d 61 6e 79 20 |r sees t|oo many |
|00004f70| 22 66 61 6c 73 65 20 61 | 6c 61 72 6d 73 22 20 61 |"false a|larms" a|
|00004f80| 6e 64 20 6d 61 79 20 65 | 6e 64 20 75 70 20 69 67 |nd may e|nd up ig|
|00004f90| 6e 6f 72 69 6e 67 0d 0a | 20 20 20 20 20 20 20 76 |noring..| v|
|00004fa0| 61 6c 69 64 20 77 61 72 | 6e 69 6e 67 73 2e 20 57 |alid war|nings. W|
|00004fb0| 68 65 6e 20 69 74 20 69 | 73 20 6f 76 65 72 6c 79 |hen it i|s overly|
|00004fc0| 20 6f 70 74 69 6d 69 73 | 74 69 63 2c 20 4c 69 6e | optimis|tic, Lin|
|00004fd0| 74 20 6f 76 65 72 6c 6f | 6f 6b 73 0d 0a 20 20 20 |t overlo|oks.. |
|00004fe0| 20 20 20 20 63 65 72 74 | 61 69 6e 20 65 72 72 6f | cert|ain erro|
|00004ff0| 72 73 2e 0d 0a 0d 0a 20 | 20 20 20 20 2a 20 49 74 |rs..... | * It|
|00005000| 20 69 73 20 69 6d 70 6f | 73 73 69 62 6c 65 20 74 | is impo|ssible t|
|00005010| 6f 20 66 6f 72 67 65 74 | 20 74 6f 20 72 75 6e 20 |o forget| to run |
|00005020| 63 6f 6e 73 69 73 74 65 | 6e 63 79 20 63 68 65 63 |consiste|ncy chec|
|00005030| 6b 73 20 77 68 65 6e 20 | 75 73 69 6e 67 20 61 6e |ks when |using an|
|00005040| 0d 0a 20 20 20 20 20 20 | 20 41 64 61 20 63 6f 6d |.. | Ada com|
|00005050| 70 69 6c 65 72 2e 20 28 | 4f 66 20 63 6f 75 72 73 |piler. (|Of cours|
|00005060| 65 20 61 20 43 20 70 72 | 6f 67 72 61 6d 6d 69 6e |e a C pr|ogrammin|
|00005070| 67 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 20 63 6f |g enviro|nment co|
|00005080| 75 6c 64 20 62 65 20 73 | 65 74 0d 0a 20 20 20 20 |uld be s|et.. |
|00005090| 20 20 20 75 70 20 73 6f | 20 74 68 61 74 20 74 68 | up so| that th|
|000050a0| 65 20 43 20 63 6f 6d 70 | 69 6c 65 72 20 63 6f 75 |e C comp|iler cou|
|000050b0| 6c 64 20 6f 6e 6c 79 20 | 62 65 20 69 6e 76 6f 6b |ld only |be invok|
|000050c0| 65 64 20 66 72 6f 6d 20 | 61 20 73 63 72 69 70 74 |ed from |a script|
|000050d0| 20 74 68 61 74 0d 0a 20 | 20 20 20 20 20 20 61 6c | that.. | al|
|000050e0| 73 6f 20 69 6e 76 6f 6b | 65 73 20 4c 69 6e 74 2e |so invok|es Lint.|
|000050f0| 29 0d 0a 0d 0a 20 20 20 | 20 20 2a 20 41 20 63 6f |).... | * A co|
|00005100| 6d 70 69 6c 61 74 69 6f | 6e 20 74 68 61 74 20 66 |mpilatio|n that f|
|00005110| 61 69 6c 73 20 41 64 61 | 20 63 6f 6e 73 69 73 74 |ails Ada| consist|
|00005120| 65 6e 63 79 20 63 68 65 | 63 6b 73 20 69 73 20 72 |ency che|cks is r|
|00005130| 65 6a 65 63 74 65 64 2e | 20 41 0d 0a 20 20 20 20 |ejected.| A.. |
|00005140| 20 20 20 63 6f 6d 70 69 | 6c 61 74 69 6f 6e 20 74 | compi|lation t|
|00005150| 68 61 74 20 66 61 69 6c | 73 20 4c 69 6e 74 20 63 |hat fail|s Lint c|
|00005160| 6f 6e 73 69 73 74 65 6e | 63 79 20 63 68 65 63 6b |onsisten|cy check|
|00005170| 73 20 6d 61 79 20 73 74 | 69 6c 6c 20 62 65 0d 0a |s may st|ill be..|
|00005180| 20 20 20 20 20 20 20 63 | 6f 6d 70 69 6c 65 64 2c | c|ompiled,|
|00005190| 20 61 6e 64 20 69 74 73 | 20 6f 62 6a 65 63 74 20 | and its| object |
|000051a0| 66 69 6c 65 20 75 73 65 | 64 20 28 69 6e 74 65 6e |file use|d (inten|
|000051b0| 74 69 6f 6e 61 6c 6c 79 | 20 6f 72 20 61 63 63 69 |tionally| or acci|
|000051c0| 64 65 6e 74 6c 79 29 0d | 0a 20 20 20 20 20 20 20 |dently).|. |
|000051d0| 69 6e 20 62 75 69 6c 64 | 69 6e 67 20 74 68 65 20 |in build|ing the |
|000051e0| 73 79 73 74 65 6d 2e 20 | 28 4f 6e 65 20 63 61 6e |system. |(One can|
|000051f0| 6e 6f 74 20 61 75 74 6f | 6d 61 74 65 20 74 68 65 |not auto|mate the|
|00005200| 20 72 65 6a 65 63 74 69 | 6f 6e 20 6f 66 0d 0a 20 | rejecti|on of.. |
|00005210| 20 20 20 20 20 20 70 72 | 6f 67 72 61 6d 73 20 74 | pr|ograms t|
|00005220| 68 61 74 20 66 61 69 6c | 20 4c 69 6e 74 20 75 6e |hat fail| Lint un|
|00005230| 6c 65 73 73 20 6f 6e 65 | 20 69 73 20 63 65 72 74 |less one| is cert|
|00005240| 61 69 6e 20 74 68 61 74 | 20 74 68 65 72 65 20 77 |ain that| there w|
|00005250| 69 6c 6c 0d 0a 20 20 20 | 20 20 20 20 6e 65 76 65 |ill.. | neve|
|00005260| 72 20 62 65 20 61 6e 79 | 20 66 61 6c 73 65 20 77 |r be any| false w|
|00005270| 61 72 6e 69 6e 67 73 2e | 29 0d 0a 0d 0a 20 20 20 |arnings.|).... |
|00005280| 20 20 2a 20 41 64 61 20 | 65 6e 66 6f 72 63 65 73 | * Ada |enforces|
|00005290| 20 63 6f 6e 73 69 73 74 | 65 6e 63 79 20 61 6d 6f | consist|ency amo|
|000052a0| 6e 67 20 73 65 70 61 72 | 61 74 65 6c 79 20 63 6f |ng separ|ately co|
|000052b0| 6d 70 69 6c 65 64 20 75 | 6e 69 74 73 2e 0d 0a 0d |mpiled u|nits....|
|000052c0| 0a 0d 0a 20 20 20 4f 66 | 20 63 6f 75 72 73 65 20 |... Of| course |
|000052d0| 65 76 65 6e 20 73 74 72 | 6f 6e 67 65 72 20 61 72 |even str|onger ar|
|000052e0| 67 75 6d 65 6e 74 73 20 | 63 61 6e 20 62 65 20 6d |guments |can be m|
|000052f0| 61 64 65 20 61 62 6f 75 | 74 20 41 64 61 27 73 20 |ade abou|t Ada's |
|00005300| 52 55 4e 2d 54 49 4d 45 | 0d 0a 20 20 20 63 68 65 |RUN-TIME|.. che|
|00005310| 63 6b 73 20 28 77 68 69 | 63 68 20 63 61 6e 20 62 |cks (whi|ch can b|
|00005320| 65 20 75 73 65 64 20 77 | 69 74 68 20 6c 69 74 74 |e used w|ith litt|
|00005330| 6c 65 20 61 64 64 69 74 | 69 6f 6e 61 6c 20 6f 76 |le addit|ional ov|
|00005340| 65 72 68 65 61 64 20 62 | 65 63 61 75 73 65 20 74 |erhead b|ecause t|
|00005350| 68 65 0d 0a 20 20 20 69 | 6e 66 6f 72 6d 61 74 69 |he.. i|nformati|
|00005360| 6f 6e 20 63 6f 6e 74 61 | 69 6e 65 64 20 69 6e 20 |on conta|ined in |
|00005370| 61 6e 20 41 64 61 20 70 | 72 6f 67 72 61 6d 20 61 |an Ada p|rogram a|
|00005380| 6e 64 20 74 68 65 20 6b | 6e 6f 77 6c 65 64 67 65 |nd the k|nowledge|
|00005390| 20 74 68 61 74 20 74 68 | 65 0d 0a 20 20 20 70 72 | that th|e.. pr|
|000053a0| 6f 67 72 61 6d 20 68 61 | 73 20 70 61 73 73 65 64 |ogram ha|s passed|
|000053b0| 20 63 6f 6d 70 69 6c 65 | 2d 74 69 6d 65 20 63 6f | compile|-time co|
|000053c0| 6e 73 69 73 74 65 6e 63 | 79 20 63 68 65 63 6b 73 |nsistenc|y checks|
|000053d0| 20 6d 61 6b 65 20 69 74 | 20 70 6f 73 73 69 62 6c | make it| possibl|
|000053e0| 65 20 74 6f 0d 0a 20 20 | 20 6f 70 74 69 6d 69 7a |e to.. | optimiz|
|000053f0| 65 20 61 77 61 79 20 74 | 68 65 20 6d 61 6a 6f 72 |e away t|he major|
|00005400| 69 74 79 20 6f 66 20 74 | 68 65 20 63 68 65 63 6b |ity of t|he check|
|00005410| 73 29 2e 20 54 68 65 73 | 65 20 63 68 65 63 6b 73 |s). Thes|e checks|
|00005420| 2c 20 77 68 69 63 68 20 | 61 72 65 0d 0a 20 20 20 |, which |are.. |
|00005430| 61 62 73 65 6e 74 20 69 | 6e 20 43 2c 20 74 65 6e |absent i|n C, ten|
|00005440| 64 20 74 6f 20 73 6d 6f | 6b 65 20 6f 75 74 20 65 |d to smo|ke out e|
|00005450| 72 72 6f 72 73 20 65 61 | 72 6c 79 20 62 79 20 64 |rrors ea|rly by d|
|00005460| 65 74 65 63 74 69 6e 67 | 20 69 6e 74 65 72 6e 61 |etecting| interna|
|00005470| 6c 0d 0a 20 20 20 69 6e | 63 6f 6e 73 69 73 74 65 |l.. in|consiste|
|00005480| 6e 63 69 65 73 20 74 68 | 61 74 20 6d 69 67 68 74 |ncies th|at might|
|00005490| 20 6e 6f 74 20 6f 74 68 | 65 72 77 69 73 65 20 62 | not oth|erwise b|
|000054a0| 65 20 64 65 74 65 63 74 | 65 64 20 64 75 72 69 6e |e detect|ed durin|
|000054b0| 67 20 74 65 73 74 69 6e | 67 2e 0d 0a 20 20 20 54 |g testin|g... T|
|000054c0| 68 69 73 20 72 65 64 75 | 63 65 73 20 74 68 65 20 |his redu|ces the |
|000054d0| 6c 69 6b 65 6c 69 68 6f | 6f 64 20 6f 66 20 66 69 |likeliho|od of fi|
|000054e0| 65 6c 64 69 6e 67 20 61 | 20 73 79 73 74 65 6d 20 |elding a| system |
|000054f0| 74 68 61 74 20 61 70 70 | 65 61 72 73 20 74 6f 20 |that app|ears to |
|00005500| 77 6f 72 6b 0d 0a 20 20 | 20 77 65 6c 6c 20 64 75 |work.. | well du|
|00005510| 72 69 6e 67 20 74 65 73 | 74 69 6e 67 20 62 75 74 |ring tes|ting but|
|00005520| 20 66 61 69 6c 73 20 69 | 6e 20 6f 70 65 72 61 74 | fails i|n operat|
|00005530| 69 6f 6e 61 6c 20 75 73 | 65 2e 0d 0a 0d 0a 0d 0a |ional us|e.......|
|00005540| 39 2e 38 3a 20 44 6f 65 | 73 20 41 64 61 20 68 61 |9.8: Doe|s Ada ha|
|00005550| 76 65 20 73 6f 6d 65 74 | 68 69 6e 67 20 6c 69 6b |ve somet|hing lik|
|00005560| 65 20 74 68 65 20 53 74 | 61 6e 64 61 72 64 20 54 |e the St|andard T|
|00005570| 65 6d 70 6c 61 74 65 20 | 4c 69 62 72 61 72 79 20 |emplate |Library |
|00005580| 28 53 54 4c 29 20 69 6e | 20 43 2b 2b 2c 0d 0a 6f |(STL) in| C++,..o|
|00005590| 72 20 63 6f 6d 70 6f 6e | 65 6e 74 73 20 6c 69 6b |r compon|ents lik|
|000055a0| 65 20 79 6f 75 20 66 69 | 6e 64 20 69 6e 20 53 6d |e you fi|nd in Sm|
|000055b0| 61 6c 6c 74 61 6c 6b 20 | 65 6e 76 69 72 6f 6e 6d |alltalk |environm|
|000055c0| 65 6e 74 73 3f 0d 0a 0d | 0a 20 20 20 59 65 73 2c |ents?...|. Yes,|
|000055d0| 20 69 6e 20 76 61 72 69 | 6f 75 73 20 77 61 79 73 | in vari|ous ways|
|000055e0| 2e 0d 0a 0d 0a 20 20 20 | 46 65 77 20 63 6f 6d 70 |..... |Few comp|
|000055f0| 6f 6e 65 6e 74 73 20 61 | 72 65 20 70 61 72 74 20 |onents a|re part |
|00005600| 6f 66 20 74 68 65 20 49 | 53 4f 20 73 74 61 6e 64 |of the I|SO stand|
|00005610| 61 72 64 2e 20 41 64 61 | 20 39 35 20 68 61 73 20 |ard. Ada| 95 has |
|00005620| 61 6e 20 65 78 70 61 6e | 64 65 64 0d 0a 20 20 20 |an expan|ded.. |
|00005630| 73 65 74 20 6f 66 20 70 | 72 65 64 65 66 69 6e 65 |set of p|redefine|
|00005640| 64 20 6c 69 62 72 61 72 | 79 20 75 6e 69 74 73 2c |d librar|y units,|
|00005650| 20 63 6f 76 65 72 69 6e | 67 20 65 2e 67 2e 20 73 | coverin|g e.g. s|
|00005660| 74 72 69 6e 67 73 20 6f | 66 20 76 61 72 79 69 6e |trings o|f varyin|
|00005670| 67 2d 20 6f 72 0d 0a 20 | 20 20 64 79 6e 61 6d 69 |g- or.. | dynami|
|00005680| 63 2d 6c 65 6e 67 74 68 | 2c 20 65 6c 65 6d 65 6e |c-length|, elemen|
|00005690| 74 61 72 79 20 6e 75 6d | 65 72 69 63 61 6c 20 66 |tary num|erical f|
|000056a0| 75 6e 63 74 69 6f 6e 73 | 2c 20 72 61 6e 64 6f 6d |unctions|, random|
|000056b0| 20 6e 75 6d 62 65 72 0d | 0a 20 20 20 67 65 6e 65 | number.|. gene|
|000056c0| 72 61 74 6f 72 73 2c 20 | 63 6f 6d 70 6c 65 78 20 |rators, |complex |
|000056d0| 6e 75 6d 62 65 72 73 2c | 20 61 6e 64 20 6d 6f 72 |numbers,| and mor|
|000056e0| 65 3b 20 69 6e 20 61 64 | 64 69 74 69 6f 6e 2c 20 |e; in ad|dition, |
|000056f0| 74 68 65 20 53 70 65 63 | 69 61 6c 20 4e 65 65 64 |the Spec|ial Need|
|00005700| 73 0d 0a 20 20 20 41 6e | 6e 65 78 65 73 20 73 74 |s.. An|nexes st|
|00005710| 61 6e 64 61 72 64 69 7a | 65 20 6d 61 6e 79 20 61 |andardiz|e many a|
|00005720| 64 76 61 6e 63 65 64 20 | 73 65 72 76 69 63 65 73 |dvanced |services|
|00005730| 20 77 68 69 63 68 20 68 | 61 76 65 20 63 6f 6d 6d | which h|ave comm|
|00005740| 6f 6e 6c 79 20 62 65 65 | 6e 0d 0a 20 20 20 70 72 |only bee|n.. pr|
|00005750| 6f 76 69 64 65 64 20 62 | 79 20 73 65 70 61 72 61 |ovided b|y separa|
|00005760| 74 65 20 63 6f 6d 70 6f | 6e 65 6e 74 73 20 69 6e |te compo|nents in|
|00005770| 20 74 68 65 20 70 61 73 | 74 2e 0d 0a 0d 0a 20 20 | the pas|t..... |
|00005780| 20 41 20 6c 6f 74 20 6f | 66 20 66 72 65 65 20 41 | A lot o|f free A|
|00005790| 64 61 20 73 6f 66 74 77 | 61 72 65 20 63 6f 6d 70 |da softw|are comp|
|000057a0| 6f 6e 65 6e 74 73 20 61 | 72 65 20 61 76 61 69 6c |onents a|re avail|
|000057b0| 61 62 6c 65 20 66 72 6f | 6d 20 61 6e 6f 6e 79 6d |able fro|m anonym|
|000057c0| 6f 75 73 20 46 54 50 0d | 0a 20 20 20 73 69 74 65 |ous FTP.|. site|
|000057d0| 73 2e 20 54 68 65 72 65 | 20 69 73 20 61 6c 73 6f |s. There| is also|
|000057e0| 20 61 6e 20 75 70 63 6f | 6d 69 6e 67 20 72 65 6c | an upco|ming rel|
|000057f0| 65 61 73 65 20 6f 66 20 | 74 68 65 20 42 6f 6f 63 |ease of |the Booc|
|00005800| 68 20 43 6f 6d 70 6f 6e | 65 6e 74 73 20 66 6f 72 |h Compon|ents for|
|00005810| 0d 0a 20 20 20 41 64 61 | 20 39 35 20 75 6e 64 65 |.. Ada| 95 unde|
|00005820| 72 20 74 68 65 20 47 4e | 55 20 4c 69 62 72 61 72 |r the GN|U Librar|
|00005830| 79 20 47 65 6e 65 72 61 | 6c 20 50 75 62 6c 69 63 |y Genera|l Public|
|00005840| 20 4c 69 63 65 6e 73 65 | 20 28 4c 47 50 4c 29 3b | License| (LGPL);|
|00005850| 20 74 68 69 73 20 77 69 | 6c 6c 0d 0a 20 20 20 67 | this wi|ll.. g|
|00005860| 69 76 65 20 79 6f 75 20 | 74 68 65 20 61 62 69 6c |ive you |the abil|
|00005870| 69 74 79 20 74 6f 20 66 | 72 65 65 6c 79 20 69 6e |ity to f|reely in|
|00005880| 63 6c 75 64 65 20 74 68 | 65 20 6c 69 62 72 61 72 |clude th|e librar|
|00005890| 79 20 63 6f 6d 70 6f 6e | 65 6e 74 73 20 69 6e 20 |y compon|ents in |
|000058a0| 79 6f 75 72 0d 0a 20 20 | 20 61 70 70 6c 69 63 61 |your.. | applica|
|000058b0| 74 69 6f 6e 20 77 69 74 | 68 6f 75 74 20 61 6e 79 |tion wit|hout any|
|000058c0| 20 63 6f 73 74 20 6f 72 | 20 6f 62 6c 69 67 61 74 | cost or| obligat|
|000058d0| 69 6f 6e 2e 20 28 43 6f | 6e 74 61 63 74 20 64 77 |ion. (Co|ntact dw|
|000058e0| 65 6c 6c 65 72 40 64 66 | 77 2e 6e 65 74 0d 0a 20 |eller@df|w.net.. |
|000058f0| 20 20 66 6f 72 20 6d 6f | 72 65 20 64 65 74 61 69 | for mo|re detai|
|00005900| 6c 73 2e 29 0d 0a 0d 0a | 20 20 20 20 57 68 61 74 |ls.)....| What|
|00005910| 20 61 62 6f 75 74 20 53 | 54 4c 20 61 6e 64 20 74 | about S|TL and t|
|00005920| 68 65 20 53 6d 61 6c 6c | 74 61 6c 6b 20 6c 69 62 |he Small|talk lib|
|00005930| 72 61 72 79 3f 0d 0a 0d | 0a 20 20 20 54 68 65 20 |rary?...|. The |
|00005940| 43 2b 2b 20 53 54 4c 20 | 64 6f 65 73 6e 27 74 20 |C++ STL |doesn't |
|00005950| 63 6f 6e 74 61 69 6e 20 | 6d 75 63 68 2e 20 52 65 |contain |much. Re|
|00005960| 61 6c 6c 79 2e 20 42 72 | 65 61 6b 69 6e 67 20 69 |ally. Br|eaking i|
|00005970| 74 73 20 73 6f 75 72 63 | 65 20 63 6f 64 65 0d 0a |ts sourc|e code..|
|00005980| 20 20 20 64 6f 77 6e 2c | 20 69 74 20 63 6f 6e 74 | down,| it cont|
|00005990| 61 69 6e 73 20 6c 65 73 | 73 20 74 68 61 6e 20 33 |ains les|s than 3|
|000059a0| 30 30 30 20 73 65 6d 69 | 63 6f 6c 6f 6e 73 20 28 |000 semi|colons (|
|000059b0| 7e 37 30 30 30 20 74 6f | 74 61 6c 20 6c 69 6e 65 |~7000 to|tal line|
|000059c0| 73 29 2e 20 54 68 65 0d | 0a 20 20 20 65 6e 74 69 |s). The.|. enti|
|000059d0| 72 65 20 6c 69 62 72 61 | 72 79 20 65 78 69 73 74 |re libra|ry exist|
|000059e0| 73 20 69 6e 20 43 2b 2b | 20 68 65 61 64 65 72 20 |s in C++| header |
|000059f0| 66 69 6c 65 73 20 61 73 | 20 69 6e 6c 69 6e 65 61 |files as| inlinea|
|00005a00| 62 6c 65 20 63 6f 64 65 | 0d 0a 20 20 20 28 73 75 |ble code|.. (su|
|00005a10| 70 70 6f 73 65 64 6c 79 | 20 77 69 74 68 69 6e 20 |pposedly| within |
|00005a20| 61 20 66 65 77 20 70 65 | 72 63 65 6e 74 20 6f 66 |a few pe|rcent of|
|00005a30| 20 74 68 65 20 65 66 66 | 69 63 69 65 6e 63 79 20 | the eff|iciency |
|00005a40| 6f 66 20 68 61 6e 64 2d | 6f 70 74 69 6d 69 7a 65 |of hand-|optimize|
|00005a50| 64 0d 0a 20 20 20 63 6f | 64 65 29 2e 0d 0a 0d 0a |d.. co|de).....|
|00005a60| 20 20 20 53 54 4c 20 63 | 6c 61 73 73 20 68 69 65 | STL c|lass hie|
|00005a70| 72 61 72 63 68 79 0d 0a | 0d 0a 20 20 20 20 20 62 |rarchy..|.. b|
|00005a80| 6f 6f 6c 2c 20 68 65 61 | 70 20 20 20 20 20 2d 2d |ool, hea|p --|
|00005a90| 20 6f 66 20 63 6f 75 72 | 73 65 20 41 64 61 20 64 | of cour|se Ada d|
|00005aa0| 6f 65 73 20 6e 6f 74 20 | 6e 65 65 64 20 61 20 62 |oes not |need a b|
|00005ab0| 6f 6f 6c 20 63 6c 61 73 | 73 21 0d 0a 20 20 20 20 |ool clas|s!.. |
|00005ac0| 20 20 5c 20 66 75 6e 63 | 74 69 6f 6e 2c 20 70 61 | \ func|tion, pa|
|00005ad0| 69 72 2c 20 73 74 61 63 | 6b 0d 0a 20 20 20 20 20 |ir, stac|k.. |
|00005ae0| 20 20 20 20 5c 20 69 74 | 65 72 61 74 6f 72 2c 20 | \ it|erator, |
|00005af0| 74 65 6d 70 62 75 66 2c | 20 70 72 6f 6a 65 63 74 |tempbuf,| project|
|00005b00| 69 6f 6e 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ion.. | |
|00005b10| 20 5c 20 61 6c 67 6f 62 | 61 73 65 0d 0a 20 20 20 | \ algob|ase.. |
|00005b20| 20 20 20 20 20 20 20 20 | 20 20 20 20 5c 20 61 6c | | \ al|
|00005b30| 67 6f 72 69 74 68 6d 73 | 2c 20 62 69 74 76 65 63 |gorithms|, bitvec|
|00005b40| 74 6f 72 2c 20 64 65 71 | 75 65 2c 20 6c 69 73 74 |tor, deq|ue, list|
|00005b50| 2c 20 74 72 65 65 2c 20 | 76 65 63 74 6f 72 0d 0a |, tree, |vector..|
|00005b60| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00005b70| 20 20 5c 20 6d 61 70 2c | 20 6d 75 6c 74 69 6d 61 | \ map,| multima|
|00005b80| 70 2c 20 73 65 74 2c 20 | 6d 75 6c 74 69 73 65 74 |p, set, |multiset|
|00005b90| 0d 0a 0d 0a 0d 0a 20 20 | 20 54 68 65 20 6d 61 69 |...... | The mai|
|00005ba0| 6e 20 61 75 74 68 6f 72 | 20 6f 66 20 74 68 65 20 |n author| of the |
|00005bb0| 6c 69 62 72 61 72 79 2c | 20 41 6c 65 78 61 6e 64 |library,| Alexand|
|00005bc0| 65 72 20 53 74 65 70 61 | 6e 6f 76 2c 20 63 72 65 |er Stepa|nov, cre|
|00005bd0| 61 74 65 64 20 74 68 65 | 20 41 64 61 0d 0a 20 20 |ated the| Ada.. |
|00005be0| 20 47 65 6e 65 72 69 63 | 20 4c 69 62 72 61 72 79 | Generic| Library|
|00005bf0| 20 69 6e 20 74 68 65 20 | 31 39 38 30 27 73 20 2d | in the |1980's -|
|00005c00| 2d 20 61 6e 64 20 6c 61 | 74 65 72 20 62 6f 72 72 |- and la|ter borr|
|00005c10| 6f 77 65 64 20 66 72 6f | 6d 20 74 68 69 73 20 74 |owed fro|m this t|
|00005c20| 6f 0d 0a 20 20 20 63 72 | 65 61 74 65 20 53 54 4c |o.. cr|eate STL|
|00005c30| 2e 20 28 54 68 65 72 65 | 20 69 73 20 61 6e 20 69 |. (There| is an i|
|00005c40| 6e 74 65 72 76 69 65 77 | 20 77 69 74 68 20 53 74 |nterview| with St|
|00005c50| 65 70 61 6e 6f 76 20 69 | 6e 20 74 68 65 20 4d 61 |epanov i|n the Ma|
|00005c60| 72 63 68 20 31 39 39 35 | 0d 0a 20 20 20 69 73 73 |rch 1995|.. iss|
|00005c70| 75 65 20 6f 66 20 44 72 | 2e 20 44 6f 62 62 27 73 |ue of Dr|. Dobb's|
|00005c80| 20 4a 6f 75 72 6e 61 6c | 20 2d 2d 20 69 6e 20 74 | Journal| -- in t|
|00005c90| 68 65 20 43 20 50 72 6f | 67 72 61 6d 6d 69 6e 67 |he C Pro|gramming|
|00005ca0| 20 63 6f 6c 75 6d 6e 20 | 62 65 67 69 6e 6e 69 6e | column |beginnin|
|00005cb0| 67 0d 0a 20 20 20 6f 6e | 20 70 61 67 65 20 31 31 |g.. on| page 11|
|00005cc0| 35 2e 20 53 74 65 70 61 | 6e 6f 76 20 65 78 70 6c |5. Stepa|nov expl|
|00005cd0| 61 69 6e 73 20 74 68 61 | 74 20 74 68 65 73 65 20 |ains tha|t these |
|00005ce0| 63 6f 6d 70 6f 6e 65 6e | 74 73 20 77 65 72 65 20 |componen|ts were |
|00005cf0| 66 69 72 73 74 20 64 6f | 6e 65 0d 0a 20 20 20 69 |first do|ne.. i|
|00005d00| 6e 20 41 64 61 2e 29 0d | 0a 0d 0a 20 20 20 54 68 |n Ada.).|... Th|
|00005d10| 65 20 53 6d 61 6c 6c 74 | 61 6c 6b 20 6c 69 62 72 |e Smallt|alk libr|
|00005d20| 61 72 79 20 69 73 20 71 | 75 69 74 65 20 65 63 6c |ary is q|uite ecl|
|00005d30| 65 63 74 69 63 2e 20 49 | 74 20 63 6f 76 65 72 73 |ectic. I|t covers|
|00005d40| 20 65 76 65 72 79 74 68 | 69 6e 67 20 66 72 6f 6d | everyth|ing from|
|00005d50| 0d 0a 20 20 20 42 6f 6f | 6c 65 61 6e 20 74 6f 20 |.. Boo|lean to |
|00005d60| 62 69 74 6d 61 70 73 2c | 20 64 69 63 74 69 6f 6e |bitmaps,| diction|
|00005d70| 61 72 69 65 73 20 61 6e | 64 20 6f 74 68 65 72 20 |aries an|d other |
|00005d80| 63 6f 6c 6c 65 63 74 69 | 6f 6e 73 2e 20 50 61 72 |collecti|ons. Par|
|00005d90| 74 73 20 6f 66 20 69 74 | 0d 0a 20 20 20 68 61 76 |ts of it|.. hav|
|00005da0| 65 20 64 69 72 65 63 74 | 20 65 71 75 69 76 61 6c |e direct| equival|
|00005db0| 65 6e 74 73 20 69 6e 20 | 41 64 61 20 39 35 2c 20 |ents in |Ada 95, |
|00005dc0| 70 61 72 74 73 20 61 72 | 65 20 61 6c 72 65 61 64 |parts ar|e alread|
|00005dd0| 79 20 61 76 61 69 6c 61 | 62 6c 65 20 69 6e 0d 0a |y availa|ble in..|
|00005de0| 20 20 20 63 6f 6d 70 6f | 6e 65 6e 74 73 20 66 72 | compo|nents fr|
|00005df0| 6f 6d 20 61 6e 6f 6e 79 | 6d 6f 75 73 20 46 54 50 |om anony|mous FTP|
|00005e00| 20 73 69 74 65 73 20 61 | 6e 64 2f 6f 72 20 77 69 | sites a|nd/or wi|
|00005e10| 6c 6c 20 62 65 20 69 6e | 20 74 68 65 20 42 6f 6f |ll be in| the Boo|
|00005e20| 63 68 20 41 64 61 20 39 | 35 0d 0a 20 20 20 63 6f |ch Ada 9|5.. co|
|00005e30| 6d 70 6f 6e 65 6e 74 73 | 2c 20 61 6e 64 20 6f 74 |mponents|, and ot|
|00005e40| 68 65 72 20 70 61 72 74 | 73 20 61 72 65 20 61 76 |her part|s are av|
|00005e50| 61 69 6c 61 62 6c 65 20 | 66 72 6f 6d 20 63 6f 6d |ailable |from com|
|00005e60| 6d 65 72 63 69 61 6c 20 | 41 64 61 0d 0a 20 20 20 |mercial |Ada.. |
|00005e70| 63 6f 6d 70 6f 6e 65 6e | 74 20 73 75 70 70 6c 69 |componen|t suppli|
|00005e80| 65 72 73 2e 0d 0a 0d 0a | 0d 0a 39 2e 39 3a 20 57 |ers.....|..9.9: W|
|00005e90| 68 65 72 65 20 63 61 6e | 20 49 20 66 69 6e 64 20 |here can| I find |
|00005ea0| 74 68 65 20 65 71 75 69 | 76 61 6c 65 6e 74 20 6f |the equi|valent o|
|00005eb0| 66 20 22 70 72 69 6e 74 | 66 22 20 69 6e 20 41 64 |f "print|f" in Ad|
|00005ec0| 61 3f 0d 0a 0d 0a 20 20 | 20 57 68 69 6c 65 20 74 |a?.... | While t|
|00005ed0| 68 65 20 73 74 61 6e 64 | 61 72 64 20 70 61 63 6b |he stand|ard pack|
|00005ee0| 61 67 65 20 54 65 78 74 | 5f 49 4f 20 70 72 6f 76 |age Text|_IO prov|
|00005ef0| 69 64 65 73 20 6d 61 6e | 79 20 66 65 61 74 75 72 |ides man|y featur|
|00005f00| 65 73 2c 20 74 68 65 0d | 0a 20 20 20 72 65 71 75 |es, the.|. requ|
|00005f10| 65 73 74 20 66 6f 72 20 | 61 20 70 72 69 6e 74 66 |est for |a printf|
|00005f20| 2d 6c 69 6b 65 20 66 75 | 6e 63 74 69 6f 6e 20 69 |-like fu|nction i|
|00005f30| 73 20 6e 6f 74 20 75 6e | 75 73 75 61 6c 2e 0d 0a |s not un|usual...|
|00005f40| 0d 0a 20 20 20 28 73 6f | 6c 75 74 69 6f 6e 20 62 |.. (so|lution b|
|00005f50| 61 73 65 64 20 6f 6e 20 | 61 20 73 75 67 67 65 73 |ased on |a sugges|
|00005f60| 74 69 6f 6e 20 62 79 20 | 54 75 63 6b 65 72 20 54 |tion by |Tucker T|
|00005f70| 61 66 74 29 0d 0a 0d 0a | 20 20 20 49 74 20 69 73 |aft)....| It is|
|00005f80| 20 70 6f 73 73 69 62 6c | 65 20 74 6f 20 70 72 6f | possibl|e to pro|
|00005f90| 64 75 63 65 20 61 20 70 | 72 69 6e 74 66 2d 6c 69 |duce a p|rintf-li|
|00005fa0| 6b 65 20 63 61 70 61 62 | 69 6c 69 74 79 20 62 79 |ke capab|ility by|
|00005fb0| 20 6f 76 65 72 6c 6f 61 | 64 69 6e 67 20 74 68 65 | overloa|ding the|
|00005fc0| 0d 0a 20 20 20 22 26 22 | 20 6f 70 65 72 61 74 6f |.. "&"| operato|
|00005fd0| 72 20 74 6f 20 74 61 6b | 65 20 61 6e 20 6f 62 6a |r to tak|e an obj|
|00005fe0| 65 63 74 20 6f 66 20 74 | 79 70 65 20 46 6f 72 6d |ect of t|ype Form|
|00005ff0| 61 74 20 61 6e 64 20 61 | 6e 20 6f 62 6a 65 63 74 |at and a|n object|
|00006000| 20 6f 66 20 73 6f 6d 65 | 0d 0a 20 20 20 74 79 70 | of some|.. typ|
|00006010| 65 20 61 6e 64 20 72 65 | 74 75 72 6e 20 74 68 65 |e and re|turn the|
|00006020| 20 46 6f 72 6d 61 74 2c | 20 70 72 6f 70 65 72 6c | Format,| properl|
|00006030| 79 20 61 64 76 61 6e 63 | 65 64 2c 20 61 66 74 65 |y advanc|ed, afte|
|00006040| 72 20 68 61 76 69 6e 67 | 20 70 65 72 66 6f 72 6d |r having| perform|
|00006050| 65 64 0d 0a 20 20 20 74 | 68 65 20 61 70 70 72 6f |ed.. t|he appro|
|00006060| 70 72 69 61 74 65 20 6f | 75 74 70 75 74 2e 20 54 |priate o|utput. T|
|00006070| 68 65 20 72 65 6d 61 69 | 6e 69 6e 67 20 66 6f 72 |he remai|ning for|
|00006080| 6d 61 74 20 63 61 6e 20 | 62 65 20 63 6f 6e 76 65 |mat can |be conve|
|00006090| 72 74 65 64 20 62 61 63 | 6b 20 74 6f 0d 0a 20 20 |rted bac|k to.. |
|000060a0| 20 61 20 73 74 72 69 6e | 67 2d 2d 65 2e 67 2e 20 | a strin|g--e.g. |
|000060b0| 74 6f 20 65 78 61 6d 69 | 6e 65 20 77 68 61 74 20 |to exami|ne what |
|000060c0| 69 73 20 6c 65 66 74 20 | 61 74 20 74 68 65 20 65 |is left |at the e|
|000060d0| 6e 64 20 6f 66 20 74 68 | 65 20 66 6f 72 6d 61 74 |nd of th|e format|
|000060e0| 0d 0a 20 20 20 73 74 72 | 69 6e 67 2d 2d 20 6f 72 |.. str|ing-- or|
|000060f0| 20 73 69 6d 70 6c 79 20 | 70 72 69 6e 74 65 64 20 | simply |printed |
|00006100| 74 6f 20 64 69 73 70 6c | 61 79 20 77 68 61 74 65 |to displ|ay whate|
|00006110| 76 65 72 20 72 65 6d 61 | 69 6e 73 20 61 74 20 74 |ver rema|ins at t|
|00006120| 68 65 20 65 6e 64 2e 20 | 46 6f 72 0d 0a 20 20 20 |he end. |For.. |
|00006130| 65 78 61 6d 70 6c 65 3a | 0d 0a 0d 0a 20 20 20 20 |example:|.... |
|00006140| 20 77 69 74 68 20 54 65 | 78 74 5f 49 4f 3b 0d 0a | with Te|xt_IO;..|
|00006150| 20 20 20 20 20 70 61 63 | 6b 61 67 65 20 46 6f 72 | pac|kage For|
|00006160| 6d 61 74 74 65 64 5f 4f | 75 74 70 75 74 20 69 73 |matted_O|utput is|
|00006170| 0d 0a 20 20 20 20 20 20 | 20 74 79 70 65 20 46 6f |.. | type Fo|
|00006180| 72 6d 61 74 20 69 73 0d | 0a 20 20 20 20 20 20 20 |rmat is.|. |
|00006190| 20 20 6c 69 6d 69 74 65 | 64 20 70 72 69 76 61 74 | limite|d privat|
|000061a0| 65 3b 0d 0a 0d 0a 20 20 | 20 20 20 20 20 66 75 6e |e;.... | fun|
|000061b0| 63 74 69 6f 6e 20 46 6d | 74 20 28 53 74 72 20 3a |ction Fm|t (Str :|
|000061c0| 20 53 74 72 69 6e 67 29 | 0d 0a 20 20 20 20 20 20 | String)|.. |
|000061d0| 20 20 20 72 65 74 75 72 | 6e 20 46 6f 72 6d 61 74 | retur|n Format|
|000061e0| 3b 0d 0a 0d 0a 20 20 20 | 20 20 20 20 66 75 6e 63 |;.... | func|
|000061f0| 74 69 6f 6e 20 22 26 22 | 20 28 4c 65 66 74 20 3a |tion "&"| (Left :|
|00006200| 20 46 6f 72 6d 61 74 3b | 20 52 69 67 68 74 20 3a | Format;| Right :|
|00006210| 20 49 6e 74 65 67 65 72 | 29 0d 0a 20 20 20 20 20 | Integer|).. |
|00006220| 20 20 20 20 72 65 74 75 | 72 6e 20 46 6f 72 6d 61 | retu|rn Forma|
|00006230| 74 3b 0d 0a 20 20 20 20 | 20 20 20 66 75 6e 63 74 |t;.. | funct|
|00006240| 69 6f 6e 20 22 26 22 20 | 28 4c 65 66 74 20 3a 20 |ion "&" |(Left : |
|00006250| 46 6f 72 6d 61 74 3b 20 | 52 69 67 68 74 20 3a 20 |Format; |Right : |
|00006260| 46 6c 6f 61 74 29 0d 0a | 20 20 20 20 20 20 20 20 |Float)..| |
|00006270| 20 72 65 74 75 72 6e 20 | 46 6f 72 6d 61 74 3b 0d | return |Format;.|
|00006280| 0a 20 20 20 20 20 20 20 | 66 75 6e 63 74 69 6f 6e |. |function|
|00006290| 20 22 26 22 20 28 4c 65 | 66 74 20 3a 20 46 6f 72 | "&" (Le|ft : For|
|000062a0| 6d 61 74 3b 20 52 69 67 | 68 74 20 3a 20 53 74 72 |mat; Rig|ht : Str|
|000062b0| 69 6e 67 29 0d 0a 20 20 | 20 20 20 20 20 20 20 72 |ing).. | r|
|000062c0| 65 74 75 72 6e 20 46 6f | 72 6d 61 74 3b 0d 0a 20 |eturn Fo|rmat;.. |
|000062d0| 20 20 20 20 20 20 2e 2e | 2e 20 2d 2d 20 6f 74 68 | ..|. -- oth|
|000062e0| 65 72 20 6f 76 65 72 6c | 6f 61 64 69 6e 67 73 20 |er overl|oadings |
|000062f0| 6f 66 20 22 26 22 0d 0a | 0d 0a 20 20 20 20 20 20 |of "&"..|.. |
|00006300| 20 70 72 6f 63 65 64 75 | 72 65 20 50 72 69 6e 74 | procedu|re Print|
|00006310| 20 28 46 6d 74 20 3a 20 | 46 6f 72 6d 61 74 29 3b | (Fmt : |Format);|
|00006320| 0d 0a 0d 0a 20 20 20 20 | 20 20 20 66 75 6e 63 74 |.... | funct|
|00006330| 69 6f 6e 20 54 6f 5f 53 | 74 72 69 6e 67 20 28 46 |ion To_S|tring (F|
|00006340| 6d 74 20 3a 20 46 6f 72 | 6d 61 74 29 0d 0a 20 20 |mt : For|mat).. |
|00006350| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 53 74 | r|eturn St|
|00006360| 72 69 6e 67 3b 0d 0a 0d | 0a 20 20 20 20 20 70 72 |ring;...|. pr|
|00006370| 69 76 61 74 65 0d 0a 20 | 20 20 20 20 20 20 2e 2e |ivate.. | ..|
|00006380| 2e 0d 0a 20 20 20 20 20 | 65 6e 64 20 46 6f 72 6d |... |end Form|
|00006390| 61 74 74 65 64 5f 4f 75 | 74 70 75 74 3b 0d 0a 0d |atted_Ou|tput;...|
|000063a0| 0a 20 20 20 20 20 77 69 | 74 68 20 46 6f 72 6d 61 |. wi|th Forma|
|000063b0| 74 74 65 64 5f 4f 75 74 | 70 75 74 3b 20 75 73 65 |tted_Out|put; use|
|000063c0| 20 46 6f 72 6d 61 74 74 | 65 64 5f 4f 75 74 70 75 | Formatt|ed_Outpu|
|000063d0| 74 3b 0d 0a 20 20 20 20 | 20 70 72 6f 63 65 64 75 |t;.. | procedu|
|000063e0| 72 65 20 54 65 73 74 20 | 69 73 0d 0a 20 20 20 20 |re Test |is.. |
|000063f0| 20 20 20 58 2c 20 59 20 | 3a 20 46 6c 6f 61 74 3b | X, Y |: Float;|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.