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
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: Plain text[LF]
| default
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 73 65 | 6e 61 74 6f 72 2d 62 65 |Path: se|nator-be|
|00000010| 64 66 65 6c 6c 6f 77 2e | 6d 69 74 2e 65 64 75 21 |dfellow.|mit.edu!|
|00000020| 62 6c 6f 6f 6d 2d 62 65 | 61 63 6f 6e 2e 6d 69 74 |bloom-be|acon.mit|
|00000030| 2e 65 64 75 21 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 0a 46 72 6f |Magnus.K|empe.Fro|
|00000100| 6d 3a 20 4d 61 67 6e 75 | 73 2e 4b 65 6d 70 65 40 |m: Magnu|s.Kempe@|
|00000110| 64 69 2e 65 70 66 6c 2e | 63 68 20 28 4d 61 67 6e |di.epfl.|ch (Magn|
|00000120| 75 73 20 4b 65 6d 70 65 | 29 0a 4e 65 77 73 67 72 |us Kempe|).Newsgr|
|00000130| 6f 75 70 73 3a 20 63 6f | 6d 70 2e 6c 61 6e 67 2e |oups: co|mp.lang.|
|00000140| 61 64 61 2c 63 6f 6d 70 | 2e 61 6e 73 77 65 72 73 |ada,comp|.answers|
|00000150| 2c 6e 65 77 73 2e 61 6e | 73 77 65 72 73 0a 53 75 |,news.an|swers.Su|
|00000160| 62 6a 65 63 74 3a 20 41 | 64 61 20 46 41 51 3a 20 |bject: A|da FAQ: |
|00000170| 50 72 6f 67 72 61 6d 6d | 69 6e 67 20 77 69 74 68 |Programm|ing with|
|00000180| 20 41 64 61 20 28 70 61 | 72 74 20 34 20 6f 66 20 | Ada (pa|rt 4 of |
|00000190| 34 29 0a 46 6f 6c 6c 6f | 77 75 70 2d 54 6f 3a 20 |4).Follo|wup-To: |
|000001a0| 70 6f 73 74 65 72 0a 44 | 61 74 65 3a 20 31 37 20 |poster.D|ate: 17 |
|000001b0| 4d 61 72 20 31 39 39 36 | 20 31 34 3a 32 33 3a 31 |Mar 1996| 14:23:1|
|000001c0| 31 20 47 4d 54 0a 4f 72 | 67 61 6e 69 7a 61 74 69 |1 GMT.Or|ganizati|
|000001d0| 6f 6e 3a 20 4e 6f 6e 65 | 0a 4c 69 6e 65 73 3a 20 |on: None|.Lines: |
|000001e0| 38 36 39 0a 53 65 6e 64 | 65 72 3a 20 6d 61 67 6e |869.Send|er: magn|
|000001f0| 75 73 40 6c 67 6c 73 75 | 6e 34 2e 65 70 66 6c 2e |us@lglsu|n4.epfl.|
|00000200| 63 68 20 28 4d 61 67 6e | 75 73 20 4b 65 6d 70 65 |ch (Magn|us Kempe|
|00000210| 29 0a 41 70 70 72 6f 76 | 65 64 3a 20 6e 65 77 73 |).Approv|ed: news|
|00000220| 2d 61 6e 73 77 65 72 73 | 2d 72 65 71 75 65 73 74 |-answers|-request|
|00000230| 40 4d 49 54 2e 45 44 55 | 0a 44 69 73 74 72 69 62 |@MIT.EDU|.Distrib|
|00000240| 75 74 69 6f 6e 3a 20 77 | 6f 72 6c 64 0a 4d 65 73 |ution: w|orld.Mes|
|00000250| 73 61 67 65 2d 49 44 3a | 20 3c 34 69 68 37 38 66 |sage-ID:| <4ih78f|
|00000260| 24 66 71 32 40 64 69 73 | 75 6e 6d 73 2e 65 70 66 |$fq2@dis|unms.epf|
|00000270| 6c 2e 63 68 3e 0a 52 65 | 70 6c 79 2d 54 6f 3a 20 |l.ch>.Re|ply-To: |
|00000280| 4d 61 67 6e 75 73 2e 4b | 65 6d 70 65 40 64 69 2e |Magnus.K|empe@di.|
|00000290| 65 70 66 6c 2e 63 68 20 | 28 4d 61 67 6e 75 73 20 |epfl.ch |(Magnus |
|000002a0| 4b 65 6d 70 65 29 0a 4e | 4e 54 50 2d 50 6f 73 74 |Kempe).N|NTP-Post|
|000002b0| 69 6e 67 2d 48 6f 73 74 | 3a 20 6c 67 6c 73 75 6e |ing-Host|: lglsun|
|000002c0| 34 2e 65 70 66 6c 2e 63 | 68 0a 4d 69 6d 65 2d 56 |4.epfl.c|h.Mime-V|
|000002d0| 65 72 73 69 6f 6e 3a 20 | 31 2e 30 0a 43 6f 6e 74 |ersion: |1.0.Cont|
|000002e0| 65 6e 74 2d 54 79 70 65 | 3a 20 74 65 78 74 2f 70 |ent-Type|: text/p|
|000002f0| 6c 61 69 6e 3b 20 63 68 | 61 72 73 65 74 3d 69 73 |lain; ch|arset=is|
|00000300| 6f 2d 38 38 35 39 2d 31 | 0a 43 6f 6e 74 65 6e 74 |o-8859-1|.Content|
|00000310| 2d 54 72 61 6e 73 66 65 | 72 2d 45 6e 63 6f 64 69 |-Transfe|r-Encodi|
|00000320| 6e 67 3a 20 38 62 69 74 | 0a 53 75 6d 6d 61 72 79 |ng: 8bit|.Summary|
|00000330| 3a 20 41 64 61 20 50 72 | 6f 67 72 61 6d 6d 65 72 |: Ada Pr|ogrammer|
|00000340| 27 73 20 46 72 65 71 75 | 65 6e 74 6c 79 20 41 73 |'s Frequ|ently As|
|00000350| 6b 65 64 20 51 75 65 73 | 74 69 6f 6e 73 20 28 61 |ked Ques|tions (a|
|00000360| 6e 64 20 61 6e 73 77 65 | 72 73 29 2c 0a 20 20 20 |nd answe|rs),. |
|00000370| 20 20 20 20 20 20 20 20 | 70 61 72 74 20 34 20 6f | |part 4 o|
|00000380| 66 20 34 2e 0a 20 20 20 | 20 20 20 20 20 20 50 6c |f 4.. | Pl|
|00000390| 65 61 73 65 20 72 65 61 | 64 20 62 65 66 6f 72 65 |ease rea|d before|
|000003a0| 20 70 6f 73 74 69 6e 67 | 2e 0a 4b 65 79 77 6f 72 | posting|..Keywor|
|000003b0| 64 73 3a 20 61 64 76 61 | 6e 63 65 64 20 6c 61 6e |ds: adva|nced lan|
|000003c0| 67 75 61 67 65 2c 20 61 | 72 74 69 66 69 63 69 61 |guage, a|rtificia|
|000003d0| 6c 20 6c 61 6e 67 75 61 | 67 65 73 2c 20 63 6f 6d |l langua|ges, com|
|000003e0| 70 75 74 65 72 20 73 6f | 66 74 77 61 72 65 2c 0a |puter so|ftware,.|
|000003f0| 20 20 20 20 20 20 20 20 | 20 20 64 61 74 61 20 70 | | data p|
|00000400| 72 6f 63 65 73 73 69 6e | 67 2c 20 70 72 6f 67 72 |rocessin|g, progr|
|00000410| 61 6d 6d 69 6e 67 20 6c | 61 6e 67 75 61 67 65 73 |amming l|anguages|
|00000420| 2c 20 41 64 61 0a 58 72 | 65 66 3a 20 73 65 6e 61 |, Ada.Xr|ef: sena|
|00000430| 74 6f 72 2d 62 65 64 66 | 65 6c 6c 6f 77 2e 6d 69 |tor-bedf|ellow.mi|
|00000440| 74 2e 65 64 75 20 63 6f | 6d 70 2e 6c 61 6e 67 2e |t.edu co|mp.lang.|
|00000450| 61 64 61 3a 34 32 34 36 | 35 20 63 6f 6d 70 2e 61 |ada:4246|5 comp.a|
|00000460| 6e 73 77 65 72 73 3a 31 | 37 36 30 39 20 6e 65 77 |nswers:1|7609 new|
|00000470| 73 2e 61 6e 73 77 65 72 | 73 3a 36 37 31 36 39 0a |s.answer|s:67169.|
|00000480| 0a 41 72 63 68 69 76 65 | 2d 6e 61 6d 65 3a 20 63 |.Archive|-name: c|
|00000490| 6f 6d 70 75 74 65 72 2d | 6c 61 6e 67 2f 41 64 61 |omputer-|lang/Ada|
|000004a0| 2f 70 72 6f 67 72 61 6d | 6d 69 6e 67 2f 70 61 72 |/program|ming/par|
|000004b0| 74 34 0a 43 6f 6d 70 2d | 6c 61 6e 67 2d 61 64 61 |t4.Comp-|lang-ada|
|000004c0| 2d 61 72 63 68 69 76 65 | 2d 6e 61 6d 65 3a 20 70 |-archive|-name: p|
|000004d0| 72 6f 67 72 61 6d 6d 69 | 6e 67 2f 70 61 72 74 34 |rogrammi|ng/part4|
|000004e0| 0a 50 6f 73 74 69 6e 67 | 2d 46 72 65 71 75 65 6e |.Posting|-Frequen|
|000004f0| 63 79 3a 20 6d 6f 6e 74 | 68 6c 79 0a 4c 61 73 74 |cy: mont|hly.Last|
|00000500| 2d 6d 6f 64 69 66 69 65 | 64 3a 20 32 38 20 46 65 |-modifie|d: 28 Fe|
|00000510| 62 72 75 61 72 79 20 31 | 39 39 36 0a 4c 61 73 74 |bruary 1|996.Last|
|00000520| 2d 70 6f 73 74 65 64 3a | 20 32 36 20 4a 61 6e 75 |-posted:| 26 Janu|
|00000530| 61 72 79 20 31 39 39 36 | 0a 0a 20 20 20 20 20 20 |ary 1996|.. |
|00000540| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000550| 20 20 20 20 20 20 20 20 | 20 41 64 61 20 50 72 6f | | Ada Pro|
|00000560| 67 72 61 6d 6d 65 72 27 | 73 0a 20 20 20 20 20 20 |grammer'|s. |
|00000570| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000580| 20 46 72 65 71 75 65 6e | 74 6c 79 20 41 73 6b 65 | Frequen|tly Aske|
|00000590| 64 20 51 75 65 73 74 69 | 6f 6e 73 20 28 46 41 51 |d Questi|ons (FAQ|
|000005a0| 29 0a 0a 20 20 20 49 4d | 50 4f 52 54 41 4e 54 20 |).. IM|PORTANT |
|000005b0| 4e 4f 54 45 3a 20 4e 6f | 20 46 41 51 20 63 61 6e |NOTE: No| FAQ can|
|000005c0| 20 73 75 62 73 74 69 74 | 75 74 65 20 66 6f 72 20 | substit|ute for |
|000005d0| 72 65 61 6c 20 74 65 61 | 63 68 69 6e 67 20 61 6e |real tea|ching an|
|000005e0| 64 0a 20 20 20 64 6f 63 | 75 6d 65 6e 74 61 74 69 |d. doc|umentati|
|000005f0| 6f 6e 2e 20 54 68 65 72 | 65 20 69 73 20 61 6e 20 |on. Ther|e is an |
|00000600| 61 6e 6e 6f 74 61 74 65 | 64 20 6c 69 73 74 20 6f |annotate|d list o|
|00000610| 66 20 41 64 61 20 62 6f | 6f 6b 73 20 69 6e 20 74 |f Ada bo|oks in t|
|00000620| 68 65 0a 20 20 20 63 6f | 6d 70 61 6e 69 6f 6e 20 |he. co|mpanion |
|00000630| 63 6f 6d 70 2e 6c 61 6e | 67 2e 61 64 61 20 46 41 |comp.lan|g.ada FA|
|00000640| 51 2e 0a 0a 54 68 69 73 | 20 69 73 20 70 61 72 74 |Q...This| is part|
|00000650| 20 34 20 6f 66 20 61 20 | 34 2d 70 61 72 74 20 70 | 4 of a |4-part p|
|00000660| 6f 73 74 69 6e 67 2e 0a | 50 61 72 74 20 32 20 62 |osting..|Part 2 b|
|00000670| 65 67 69 6e 73 20 77 69 | 74 68 20 71 75 65 73 74 |egins wi|th quest|
|00000680| 69 6f 6e 20 35 2e 0a 50 | 61 72 74 20 33 20 62 65 |ion 5..P|art 3 be|
|00000690| 67 69 6e 73 20 77 69 74 | 68 20 71 75 65 73 74 69 |gins wit|h questi|
|000006a0| 6f 6e 20 36 2e 0a 50 61 | 72 74 73 20 31 2c 20 32 |on 6..Pa|rts 1, 2|
|000006b0| 2c 20 61 6e 64 20 33 20 | 73 68 6f 75 6c 64 20 62 |, and 3 |should b|
|000006c0| 65 20 74 68 65 20 70 72 | 65 76 69 6f 75 73 20 70 |e the pr|evious p|
|000006d0| 6f 73 74 69 6e 67 73 20 | 69 6e 20 74 68 69 73 20 |ostings |in this |
|000006e0| 74 68 72 65 61 64 2e 0a | 0a 20 20 20 20 52 65 63 |thread..|. Rec|
|000006f0| 65 6e 74 20 63 68 61 6e | 67 65 73 20 74 6f 20 74 |ent chan|ges to t|
|00000700| 68 69 73 20 46 41 51 20 | 61 72 65 20 6c 69 73 74 |his FAQ |are list|
|00000710| 65 64 20 69 6e 20 74 68 | 65 20 66 69 72 73 74 20 |ed in th|e first |
|00000720| 73 65 63 74 69 6f 6e 20 | 61 66 74 65 72 20 74 68 |section |after th|
|00000730| 65 20 74 61 62 6c 65 0a | 20 20 20 20 6f 66 20 63 |e table.| of c|
|00000740| 6f 6e 74 65 6e 74 73 20 | 28 69 6e 20 70 61 72 74 |ontents |(in part|
|00000750| 20 31 29 2e 20 54 68 69 | 73 20 64 6f 63 75 6d 65 | 1). Thi|s docume|
|00000760| 6e 74 20 69 73 20 75 6e | 64 65 72 20 65 78 70 6c |nt is un|der expl|
|00000770| 69 63 69 74 20 63 6f 70 | 79 72 69 67 68 74 2e 0a |icit cop|yright..|
|00000780| 0a 0a 39 3a 20 41 64 61 | 20 61 6e 64 20 4f 74 68 |..9: Ada| and Oth|
|00000790| 65 72 20 50 72 6f 67 72 | 61 6d 6d 69 6e 67 20 4c |er Progr|amming L|
|000007a0| 61 6e 67 75 61 67 65 73 | 0a 0a 0a 39 2e 31 3a 20 |anguages|...9.1: |
|000007b0| 57 68 65 72 65 20 63 61 | 6e 20 49 20 66 69 6e 64 |Where ca|n I find|
|000007c0| 20 70 72 6f 67 72 61 6d | 73 20 74 68 61 74 20 77 | program|s that w|
|000007d0| 69 6c 6c 20 74 72 61 6e | 73 6c 61 74 65 20 66 72 |ill tran|slate fr|
|000007e0| 6f 6d 20 5b 73 6f 6d 65 | 20 6c 61 6e 67 75 61 67 |om [some| languag|
|000007f0| 65 5d 20 74 6f 0a 41 64 | 61 3f 0a 0a 20 20 20 49 |e] to.Ad|a?.. I|
|00000800| 74 20 69 73 20 67 65 6e | 65 72 61 6c 6c 79 20 61 |t is gen|erally a|
|00000810| 64 76 69 73 61 62 6c 65 | 20 74 6f 20 73 69 6d 70 |dvisable| to simp|
|00000820| 6c 79 20 69 6e 74 65 72 | 66 61 63 65 20 66 72 6f |ly inter|face fro|
|00000830| 6d 20 41 64 61 20 74 6f | 20 74 68 65 0a 20 20 20 |m Ada to| the. |
|00000840| 65 78 69 73 74 69 6e 67 | 20 63 6f 64 65 20 73 65 |existing| code se|
|00000850| 67 6d 65 6e 74 73 20 74 | 68 61 74 20 28 73 68 6f |gments t|hat (sho|
|00000860| 75 6c 64 29 20 61 6c 72 | 65 61 64 79 20 77 6f 72 |uld) alr|eady wor|
|00000870| 6b 2e 20 4e 6f 74 65 20 | 74 68 61 74 20 41 64 61 |k. Note |that Ada|
|00000880| 20 28 39 35 29 0a 20 20 | 20 6e 6f 77 20 68 61 73 | (95). | now has|
|00000890| 20 61 6e 20 61 6e 6e 65 | 78 20 64 65 76 6f 74 65 | an anne|x devote|
|000008a0| 64 20 74 6f 20 73 70 65 | 63 69 66 79 69 6e 67 20 |d to spe|cifying |
|000008b0| 68 6f 77 20 74 6f 20 69 | 6e 74 65 72 66 61 63 65 |how to i|nterface|
|000008c0| 20 77 69 74 68 20 63 6f | 64 65 0a 20 20 20 77 72 | with co|de. wr|
|000008d0| 69 74 74 65 6e 20 69 6e | 20 6f 74 68 65 72 20 70 |itten in| other p|
|000008e0| 72 6f 67 72 61 6d 6d 69 | 6e 67 20 6c 61 6e 67 75 |rogrammi|ng langu|
|000008f0| 61 67 65 73 20 28 43 2c | 20 46 6f 74 72 61 6e 2c |ages (C,| Fotran,|
|00000900| 20 61 6e 64 20 43 6f 62 | 6f 6c 29 2c 20 61 6e 64 | and Cob|ol), and|
|00000910| 0a 20 20 20 74 68 65 72 | 65 20 61 72 65 20 61 6c |. ther|e are al|
|00000920| 72 65 61 64 79 20 69 6e | 74 65 72 66 61 63 65 73 |ready in|terfaces|
|00000930| 20 74 6f 20 43 2b 2b 20 | 74 6f 6f 2e 0a 0a 20 20 | to C++ |too... |
|00000940| 20 41 6e 6f 74 68 65 72 | 20 6f 70 74 69 6f 6e 20 | Another| option |
|00000950| 69 73 20 74 6f 20 72 65 | 64 65 73 69 67 6e 20 74 |is to re|design t|
|00000960| 68 65 20 63 6f 64 65 2c | 20 74 61 6b 69 6e 67 20 |he code,| taking |
|00000970| 6f 66 20 63 6f 75 72 73 | 65 20 61 64 76 61 6e 74 |of cours|e advant|
|00000980| 61 67 65 20 6f 66 0a 20 | 20 20 6f 6e 65 27 73 20 |age of. | one's |
|00000990| 6b 6e 6f 77 6c 65 64 67 | 65 20 6f 66 20 74 68 65 |knowledg|e of the|
|000009a0| 20 63 75 72 72 65 6e 74 | 20 73 79 73 74 65 6d 2e | current| system.|
|000009b0| 20 46 6f 72 20 69 6e 73 | 74 61 6e 63 65 2c 20 4a | For ins|tance, J|
|000009c0| 6f 62 a0 48 6f 6e 69 67 | 0a 20 20 20 72 65 70 6f |ob.Honig|. repo|
|000009d0| 72 74 65 64 20 74 68 61 | 74 20 68 65 20 64 69 64 |rted tha|t he did|
|000009e0| 20 74 68 69 73 20 74 77 | 69 63 65 2c 20 6f 6e 63 | this tw|ice, onc|
|000009f0| 65 20 66 6f 72 20 43 6f | 63 6f 2c 20 61 20 70 61 |e for Co|co, a pa|
|00000a00| 72 73 65 72 20 67 65 6e | 65 72 61 74 6f 72 20 66 |rser gen|erator f|
|00000a10| 6f 72 0a 20 20 20 4c 41 | 4c 52 20 6c 65 66 74 20 |or. LA|LR left |
|00000a20| 61 74 74 72 69 62 75 74 | 65 64 20 67 72 61 6d 6d |attribut|ed gramm|
|00000a30| 61 72 73 2c 20 61 6e 64 | 20 6f 6e 63 65 20 66 6f |ars, and| once fo|
|00000a40| 72 20 46 6c 65 78 2c 20 | 74 68 65 20 77 65 6c 6c |r Flex, |the well|
|00000a50| 20 6b 6e 6f 77 6e 0a 20 | 20 20 73 63 61 6e 6e 65 | known. | scanne|
|00000a60| 72 20 67 65 6e 65 72 61 | 74 6f 72 2e 20 42 6f 74 |r genera|tor. Bot|
|00000a70| 68 20 61 74 74 65 6d 70 | 74 73 20 72 65 76 65 61 |h attemp|ts revea|
|00000a80| 6c 65 64 20 65 72 72 6f | 72 73 20 69 6e 20 74 68 |led erro|rs in th|
|00000a90| 65 20 6f 72 69 67 69 6e | 61 6c 0a 20 20 20 73 6f |e origin|al. so|
|00000aa0| 66 74 77 61 72 65 3b 20 | 74 68 65 79 20 77 65 72 |ftware; |they wer|
|00000ab0| 65 20 75 6e 63 6f 76 65 | 72 65 64 20 62 79 20 64 |e uncove|red by d|
|00000ac0| 65 73 69 67 6e 69 6e 67 | 20 74 68 65 20 6e 65 77 |esigning| the new|
|00000ad0| 20 73 79 73 74 65 6d 20 | 75 73 69 6e 67 20 74 68 | system |using th|
|00000ae0| 65 0a 20 20 20 68 69 67 | 68 65 72 20 61 62 73 74 |e. hig|her abst|
|00000af0| 72 61 63 74 69 6f 6e 20 | 6c 65 76 65 6c 20 61 6c |raction |level al|
|00000b00| 6c 6f 77 65 64 20 62 79 | 20 41 64 61 2e 2e 2e 0a |lowed by| Ada....|
|00000b10| 0a 20 20 20 53 6f 20 74 | 68 65 72 65 20 69 73 20 |. So t|here is |
|00000b20| 73 75 70 70 6f 72 74 20 | 66 6f 72 20 74 68 65 20 |support |for the |
|00000b30| 72 65 71 75 69 72 65 6d | 65 6e 74 73 20 61 6e 61 |requirem|ents ana|
|00000b40| 6c 79 73 69 73 20 28 74 | 72 61 6e 73 69 74 69 6f |lysis (t|ransitio|
|00000b50| 6e 20 74 6f 20 41 64 61 | 29 2c 0a 20 20 20 62 75 |n to Ada|),. bu|
|00000b60| 74 20 69 74 20 69 73 20 | 6e 6f 74 20 6f 62 76 69 |t it is |not obvi|
|00000b70| 6f 75 73 20 74 68 61 74 | 20 74 68 65 20 70 72 6f |ous that| the pro|
|00000b80| 70 6f 73 65 64 20 69 6d | 70 6c 65 6d 65 6e 74 61 |posed im|plementa|
|00000b90| 74 69 6f 6e 20 28 75 73 | 69 6e 67 20 61 20 73 6f |tion (us|ing a so|
|00000ba0| 75 72 63 65 0a 20 20 20 | 63 6f 64 65 20 74 72 61 |urce. |code tra|
|00000bb0| 6e 73 6c 61 74 6f 72 29 | 20 69 73 20 61 20 67 6f |nslator)| is a go|
|00000bc0| 6f 64 20 73 6f 6c 75 74 | 69 6f 6e 2e 0a 0a 20 20 |od solut|ion... |
|00000bd0| 20 53 74 69 6c 6c 2c 20 | 79 6f 75 20 6d 61 79 20 | Still, |you may |
|00000be0| 68 61 76 65 20 63 6f 6d | 70 65 6c 6c 69 6e 67 20 |have com|pelling |
|00000bf0| 72 65 61 73 6f 6e 73 20 | 74 6f 20 74 72 61 6e 73 |reasons |to trans|
|00000c00| 6c 61 74 65 20 79 6f 75 | 72 20 65 78 69 73 74 69 |late you|r existi|
|00000c10| 6e 67 0a 20 20 20 73 6f | 75 72 63 65 20 74 6f 20 |ng. so|urce to |
|00000c20| 41 64 61 2e 20 49 6e 20 | 74 68 61 74 20 63 61 73 |Ada. In |that cas|
|00000c30| 65 2c 20 68 65 72 65 20 | 69 73 20 61 20 6c 69 73 |e, here |is a lis|
|00000c40| 74 20 6f 66 20 61 76 61 | 69 6c 61 62 6c 65 20 74 |t of ava|ilable t|
|00000c50| 72 61 6e 73 6c 61 74 6f | 72 73 3a 0a 0a 20 20 20 |ranslato|rs:.. |
|00000c60| 20 20 2a 20 50 61 73 63 | 61 6c 20 74 6f 20 41 64 | * Pasc|al to Ad|
|00000c70| 61 3a 0a 0a 20 20 20 20 | 20 20 20 52 2e 52 2e 20 |a:.. | R.R. |
|00000c80| 53 6f 66 74 77 61 72 65 | 27 73 20 50 61 73 74 72 |Software|'s Pastr|
|00000c90| 61 6e 20 70 72 6f 67 72 | 61 6d 20 28 50 61 73 63 |an progr|am (Pasc|
|00000ca0| 61 6c 20 74 6f 20 41 64 | 61 20 54 72 61 6e 73 6c |al to Ad|a Transl|
|00000cb0| 61 74 6f 72 29 2e 0a 0a | 20 20 20 20 20 20 20 54 |ator)...| T|
|00000cc0| 6f 20 73 65 65 20 74 68 | 65 20 64 69 66 66 65 72 |o see th|e differ|
|00000cd0| 65 6e 63 65 73 20 69 6e | 20 70 72 6f 67 72 61 6d |ences in| program|
|00000ce0| 6d 69 6e 67 20 73 74 79 | 6c 65 2c 20 73 65 65 20 |ming sty|le, see |
|00000cf0| 22 41 64 61 20 66 6f 72 | 0a 20 20 20 20 20 20 20 |"Ada for|. |
|00000d00| 45 78 70 65 72 69 65 6e | 63 65 64 20 50 72 6f 67 |Experien|ced Prog|
|00000d10| 72 61 6d 6d 65 72 73 22 | 2c 20 62 79 20 41 2e 20 |rammers"|, by A. |
|00000d20| 4e 69 63 6f 20 48 61 62 | 65 72 6d 61 6e 6e 20 61 |Nico Hab|ermann a|
|00000d30| 6e 64 20 44 65 77 61 79 | 6e 65 20 45 2e 0a 20 20 |nd Deway|ne E.. |
|00000d40| 20 20 20 20 20 50 65 72 | 72 79 20 28 41 64 64 69 | Per|ry (Addi|
|00000d50| 73 6f 6e 2d 57 65 73 6c | 65 79 20 50 75 62 2e 20 |son-Wesl|ey Pub. |
|00000d60| 43 6f 2e 2c 20 52 65 61 | 64 69 6e 67 2c 20 4d 61 |Co., Rea|ding, Ma|
|00000d70| 73 73 2e 2c 20 31 39 38 | 33 29 2e 20 43 6f 76 65 |ss., 198|3). Cove|
|00000d80| 72 73 20 41 64 61 0a 20 | 20 20 20 20 20 20 61 6e |rs Ada. | an|
|00000d90| 64 20 50 61 73 63 61 6c | 2e 0a 0a 20 20 20 20 20 |d Pascal|... |
|00000da0| 2a 20 46 6f 72 74 72 61 | 6e 20 74 6f 20 41 64 61 |* Fortra|n to Ada|
|00000db0| 3a 20 3f 3f 3f 0a 0a 20 | 20 20 20 20 2a 20 43 4f |: ???.. | * CO|
|00000dc0| 42 4f 4c 20 74 6f 20 41 | 64 61 3a 20 3f 3f 3f 0a |BOL to A|da: ???.|
|00000dd0| 0a 20 20 20 20 20 2a 20 | 43 2b 2b 20 74 6f 20 41 |. * |C++ to A|
|00000de0| 64 61 3a 20 3f 3f 3f 0a | 0a 20 20 20 20 20 2a 20 |da: ???.|. * |
|00000df0| 43 20 74 6f 20 41 64 61 | 3a 20 3f 3f 3f 0a 0a 20 |C to Ada|: ???.. |
|00000e00| 20 20 20 20 2a 20 4d 6f | 64 75 6c 61 2d 32 20 74 | * Mo|dula-2 t|
|00000e10| 6f 20 41 64 61 3a 0a 0a | 20 20 20 20 20 20 20 28 |o Ada:..| (|
|00000e20| 66 72 6f 6d 20 57 61 79 | 6e 65 20 52 2e 20 4c 61 |from Way|ne R. La|
|00000e30| 77 74 6f 6e 29 0a 20 20 | 20 20 20 20 20 54 68 65 |wton). | The|
|00000e40| 20 49 64 61 68 6f 20 4e | 61 74 69 6f 6e 61 6c 20 | Idaho N|ational |
|00000e50| 45 6e 67 69 6e 65 65 72 | 69 6e 67 20 4c 61 62 6f |Engineer|ing Labo|
|00000e60| 72 61 74 6f 72 79 20 28 | 49 4e 45 4c 29 2c 20 61 |ratory (|INEL), a|
|00000e70| 20 44 65 70 74 20 6f 66 | 20 45 6e 65 72 67 79 0a | Dept of| Energy.|
|00000e80| 20 20 20 20 20 20 20 4c | 61 62 20 68 61 73 20 61 | L|ab has a|
|00000e90| 20 62 61 73 69 63 20 63 | 61 70 61 62 69 6c 69 74 | basic c|apabilit|
|00000ea0| 79 20 66 6f 72 20 4d 6f | 64 75 6c 61 2d 32 20 74 |y for Mo|dula-2 t|
|00000eb0| 6f 20 41 64 61 2d 38 33 | 2e 20 54 68 65 20 74 6f |o Ada-83|. The to|
|00000ec0| 6f 6c 20 69 73 0a 20 20 | 20 20 20 20 20 22 72 65 |ol is. | "re|
|00000ed0| 73 65 61 72 63 68 20 67 | 72 61 64 65 22 20 71 75 |search g|rade" qu|
|00000ee0| 61 6c 69 74 79 2c 20 62 | 75 74 20 6d 61 79 20 70 |ality, b|ut may p|
|00000ef0| 72 6f 76 69 64 65 20 61 | 20 73 74 61 72 74 69 6e |rovide a| startin|
|00000f00| 67 20 70 6f 69 6e 74 20 | 66 6f 72 0a 20 20 20 20 |g point |for. |
|00000f10| 20 20 20 77 68 61 74 20 | 79 6f 75 20 6e 65 65 64 | what |you need|
|00000f20| 2e 20 54 68 69 73 20 69 | 73 20 74 68 65 20 73 61 |. This i|s the sa|
|00000f30| 6d 65 20 67 72 6f 75 70 | 20 6f 66 20 70 65 6f 70 |me group| of peop|
|00000f40| 6c 65 20 77 68 6f 20 62 | 72 6f 75 67 68 74 20 79 |le who b|rought y|
|00000f50| 6f 75 0a 20 20 20 20 20 | 20 20 41 64 61 53 41 47 |ou. | AdaSAG|
|00000f60| 45 2e 20 47 69 76 65 20 | 74 68 65 6d 20 61 20 72 |E. Give |them a r|
|00000f70| 69 6e 67 20 61 74 20 28 | 32 30 38 29 20 35 32 36 |ing at (|208) 526|
|00000f80| 2d 30 36 35 36 2e 20 54 | 68 69 73 20 69 73 20 61 |-0656. T|his is a|
|00000f90| 6e 20 61 6e 73 77 65 72 | 0a 20 20 20 20 20 20 20 |n answer|. |
|00000fa0| 64 65 73 6b 20 68 6f 74 | 6c 69 6e 65 20 69 6e 20 |desk hot|line in |
|00000fb0| 74 68 65 20 73 65 63 74 | 69 6f 6e 20 74 68 61 74 |the sect|ion that|
|00000fc0| 20 77 72 6f 74 65 20 74 | 68 65 20 74 6f 6f 6c 2e | wrote t|he tool.|
|00000fd0| 0a 0a 20 20 20 20 20 20 | 20 49 66 20 79 6f 75 20 |.. | If you |
|00000fe0| 61 72 65 20 6c 6f 6f 6b | 69 6e 67 20 66 6f 72 20 |are look|ing for |
|00000ff0| 63 6f 6d 6d 65 72 63 69 | 61 6c 20 71 75 61 6c 69 |commerci|al quali|
|00001000| 74 79 2c 20 49 20 77 69 | 73 68 20 79 6f 75 20 74 |ty, I wi|sh you t|
|00001010| 68 65 20 62 65 73 74 20 | 6f 66 0a 20 20 20 20 20 |he best |of. |
|00001020| 20 20 6c 75 63 6b 2e 20 | 49 66 20 79 6f 75 20 6a | luck. |If you j|
|00001030| 75 73 74 20 6e 65 65 64 | 20 73 6f 6d 65 74 68 69 |ust need| somethi|
|00001040| 6e 67 20 74 6f 20 70 65 | 72 66 6f 72 6d 20 38 30 |ng to pe|rform 80|
|00001050| 25 20 6f 66 20 74 68 65 | 20 67 72 75 6e 74 20 63 |% of the| grunt c|
|00001060| 6f 64 65 0a 20 20 20 20 | 20 20 20 74 72 61 6e 73 |ode. | trans|
|00001070| 6c 61 74 69 6f 6e 2c 20 | 49 20 74 68 69 6e 6b 20 |lation, |I think |
|00001080| 74 68 69 73 20 6d 69 67 | 68 74 20 6d 65 65 74 20 |this mig|ht meet |
|00001090| 79 6f 75 72 20 6e 65 65 | 64 73 2e 20 49 20 6b 6e |your nee|ds. I kn|
|000010a0| 6f 77 20 6f 66 20 74 77 | 6f 0a 20 20 20 20 20 20 |ow of tw|o. |
|000010b0| 20 73 79 73 74 65 6d 73 | 20 63 6f 6d 70 72 69 73 | systems| compris|
|000010c0| 69 6e 67 20 61 62 6f 75 | 74 20 32 35 30 2c 30 30 |ing abou|t 250,00|
|000010d0| 30 20 6c 69 6e 65 73 20 | 6f 66 20 63 6f 64 65 20 |0 lines |of code |
|000010e0| 74 68 61 74 20 77 65 72 | 65 0a 20 20 20 20 20 20 |that wer|e. |
|000010f0| 20 6f 72 69 67 69 6e 61 | 6c 6c 79 20 64 65 76 65 | origina|lly deve|
|00001100| 6c 6f 70 65 64 20 69 6e | 20 4d 6f 64 75 6c 61 2d |loped in| Modula-|
|00001110| 32 20 74 68 65 6e 20 74 | 72 61 6e 73 6c 61 74 65 |2 then t|ranslate|
|00001120| 64 20 61 6e 64 20 63 6c | 65 61 6e 65 64 20 75 70 |d and cl|eaned up|
|00001130| 20 69 6e 0a 20 20 20 20 | 20 20 20 41 64 61 20 38 | in. | Ada 8|
|00001140| 33 20 61 66 74 65 72 20 | 41 6c 73 79 73 20 31 2e |3 after |Alsys 1.|
|00001150| 30 20 66 6f 72 20 74 68 | 65 20 50 43 20 63 61 6d |0 for th|e PC cam|
|00001160| 65 20 6f 75 74 20 62 61 | 63 6b 20 61 72 6f 75 6e |e out ba|ck aroun|
|00001170| 64 20 31 39 38 37 2e 0a | 0a 20 20 20 20 20 2a 20 |d 1987..|. * |
|00001180| 56 69 73 75 61 6c 20 42 | 61 73 69 63 20 74 6f 20 |Visual B|asic to |
|00001190| 41 64 61 3a 20 4e 4f 54 | 21 20 3a 2d 29 0a 0a 0a |Ada: NOT|! :-)...|
|000011a0| 39 2e 32 3a 20 48 6f 77 | 20 63 61 6e 20 49 20 63 |9.2: How| can I c|
|000011b0| 6f 6e 76 65 72 74 20 41 | 64 61 20 38 33 20 73 6f |onvert A|da 83 so|
|000011c0| 75 72 63 65 73 20 74 6f | 20 41 64 61 20 39 58 3f |urces to| Ada 9X?|
|000011d0| 0a 0a 20 20 20 46 69 72 | 73 74 20 79 6f 75 20 73 |.. Fir|st you s|
|000011e0| 68 6f 75 6c 64 20 72 65 | 61 64 20 74 68 65 20 66 |hould re|ad the f|
|000011f0| 6f 6c 6c 6f 77 69 6e 67 | 20 64 6f 63 75 6d 65 6e |ollowing| documen|
|00001200| 74 2c 20 77 68 69 63 68 | 20 77 69 6c 6c 20 70 72 |t, which| will pr|
|00001210| 6f 76 69 64 65 20 79 6f | 75 0a 20 20 20 77 69 74 |ovide yo|u. wit|
|00001220| 68 20 6d 75 63 68 20 75 | 73 65 66 75 6c 20 69 6e |h much u|seful in|
|00001230| 66 6f 72 6d 61 74 69 6f | 6e 3a 20 22 43 68 61 6e |formatio|n: "Chan|
|00001240| 67 65 73 20 74 6f 20 41 | 64 61 20 2d 2d 20 31 39 |ges to A|da -- 19|
|00001250| 38 37 20 74 6f 20 31 39 | 39 35 22 2c 20 66 69 6c |87 to 19|95", fil|
|00001260| 65 0a 20 20 20 63 68 38 | 33 2e 7b 70 73 2c 64 6f |e. ch8|3.{ps,do|
|00001270| 63 7d 2c 20 69 6e 20 64 | 69 72 65 63 74 6f 72 79 |c}, in d|irectory|
|00001280| 0a 20 20 20 66 74 70 3a | 2f 2f 73 77 2d 65 6e 67 |. ftp:|//sw-eng|
|00001290| 2e 66 61 6c 6c 73 2d 63 | 68 75 72 63 68 2e 76 61 |.falls-c|hurch.va|
|000012a0| 2e 75 73 2f 70 75 62 6c | 69 63 2f 41 64 61 49 43 |.us/publ|ic/AdaIC|
|000012b0| 2f 73 74 61 6e 64 61 72 | 64 73 2f 39 35 6c 72 6d |/standar|ds/95lrm|
|000012c0| 5f 72 61 74 2f 76 36 2e | 30 0a 0a 0a 20 20 20 49 |_rat/v6.|0... I|
|000012d0| 66 20 79 6f 75 27 72 65 | 20 75 73 69 6e 67 20 47 |f you're| using G|
|000012e0| 4e 41 54 2c 20 74 68 65 | 20 74 6f 6f 6c 20 79 6f |NAT, the| tool yo|
|000012f0| 75 20 61 72 65 20 70 72 | 6f 62 61 62 6c 79 20 6c |u are pr|obably l|
|00001300| 6f 6f 6b 69 6e 67 20 66 | 6f 72 20 69 73 0a 20 20 |ooking f|or is. |
|00001310| 20 22 67 6e 61 74 63 68 | 6f 70 22 2e 20 49 6e 20 | "gnatch|op". In |
|00001320| 63 73 68 20 79 6f 75 20 | 63 6f 75 6c 64 20 75 73 |csh you |could us|
|00001330| 65 20 73 6f 6d 65 74 68 | 69 6e 67 20 6c 69 6b 65 |e someth|ing like|
|00001340| 20 74 68 69 73 20 74 6f | 20 71 75 69 63 6b 6c 79 | this to| quickly|
|00001350| 0a 20 20 20 70 72 6f 63 | 65 73 73 20 65 78 69 73 |. proc|ess exis|
|00001360| 74 69 6e 67 20 66 69 6c | 65 73 3a 0a 0a 20 20 20 |ting fil|es:.. |
|00001370| 20 20 63 64 20 64 65 73 | 74 5f 64 69 72 20 20 20 | cd des|t_dir |
|00001380| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001390| 20 23 20 54 68 65 20 64 | 65 73 74 69 6e 61 74 69 | # The d|estinati|
|000013a0| 6f 6e 20 64 69 72 65 63 | 74 6f 72 79 0a 20 20 20 |on direc|tory. |
|000013b0| 20 20 66 6f 72 65 61 63 | 68 20 66 20 28 20 2e 2e | foreac|h f ( ..|
|000013c0| 2f 73 72 63 5f 64 69 72 | 2f 2a 2e 61 20 29 20 20 |/src_dir|/*.a ) |
|000013d0| 20 23 20 2e 2e 2f 73 72 | 63 5f 64 69 72 20 69 73 | # ../sr|c_dir is|
|000013e0| 20 74 68 65 20 73 6f 75 | 72 63 65 20 64 69 72 65 | the sou|rce dire|
|000013f0| 63 74 6f 72 79 0a 20 20 | 20 20 20 20 20 67 6e 61 |ctory. | gna|
|00001400| 74 63 68 6f 70 20 24 66 | 0a 20 20 20 20 20 65 6e |tchop $f|. en|
|00001410| 64 0a 0a 20 20 20 67 6e | 61 74 63 68 6f 70 20 77 |d.. gn|atchop w|
|00001420| 69 6c 6c 20 73 68 6f 77 | 20 79 6f 75 20 77 68 61 |ill show| you wha|
|00001430| 74 20 73 6f 75 72 63 65 | 73 20 61 72 65 20 63 61 |t source|s are ca|
|00001440| 75 73 69 6e 67 20 70 72 | 6f 62 6c 65 6d 73 2e 0a |using pr|oblems..|
|00001450| 0a 0a 39 2e 33 3a 20 49 | 20 68 65 61 72 20 74 68 |..9.3: I| hear th|
|00001460| 61 74 20 41 64 61 20 69 | 73 20 73 6c 6f 77 65 72 |at Ada i|s slower|
|00001470| 20 74 68 61 6e 20 46 6f | 72 74 72 61 6e 20 6f 72 | than Fo|rtran or|
|00001480| 20 43 2c 20 69 73 20 74 | 68 61 74 20 74 72 75 65 | C, is t|hat true|
|00001490| 3f 0a 0a 20 20 20 46 69 | 72 73 74 2c 20 6e 6f 74 |?.. Fi|rst, not|
|000014a0| 65 20 74 68 61 74 20 79 | 6f 75 20 61 72 65 20 63 |e that y|ou are c|
|000014b0| 6f 6d 70 61 72 69 6e 67 | 20 63 6f 6d 70 69 6c 65 |omparing| compile|
|000014c0| 72 73 2c 20 6e 6f 74 20 | 6c 61 6e 67 75 61 67 65 |rs, not |language|
|000014d0| 73 2e 20 54 68 65 72 65 | 20 69 73 0a 20 20 20 6e |s. There| is. n|
|000014e0| 6f 20 73 75 63 68 20 74 | 68 69 6e 67 20 61 73 20 |o such t|hing as |
|000014f0| 22 66 61 73 74 22 20 41 | 64 61 20 63 6f 64 65 20 |"fast" A|da code |
|00001500| 61 6e 79 20 6d 6f 72 65 | 20 74 68 61 6e 20 74 68 |any more| than th|
|00001510| 65 72 65 20 69 73 20 22 | 66 61 73 74 22 20 43 2b |ere is "|fast" C+|
|00001520| 2b 20 6f 72 0a 20 20 20 | 46 6f 72 74 72 61 6e 20 |+ or. |Fortran |
|00001530| 63 6f 64 65 2e 20 4e 6f | 77 2c 20 77 68 65 6e 20 |code. No|w, when |
|00001540| 63 6f 6d 70 61 72 69 6e | 67 20 65 78 65 63 75 74 |comparin|g execut|
|00001550| 69 6f 6e 20 73 70 65 65 | 64 73 20 6f 6e 20 73 69 |ion spee|ds on si|
|00001560| 6d 69 6c 61 72 0a 20 20 | 20 70 6c 61 74 66 6f 72 |milar. | platfor|
|00001570| 6d 73 2c 20 79 6f 75 20 | 6d 75 73 74 20 6b 65 65 |ms, you |must kee|
|00001580| 70 20 69 6e 20 6d 69 6e | 64 20 74 68 65 20 6f 70 |p in min|d the op|
|00001590| 74 69 6d 69 7a 61 74 69 | 6f 6e 20 6c 65 76 65 6c |timizati|on level|
|000015a0| 73 2c 20 4f 53 20 74 75 | 6e 69 6e 67 2c 0a 20 20 |s, OS tu|ning,. |
|000015b0| 20 65 74 63 2e 20 77 68 | 69 6c 65 20 6d 61 6b 69 | etc. wh|ile maki|
|000015c0| 6e 67 20 74 68 65 20 63 | 6f 6d 70 61 72 69 73 6f |ng the c|ompariso|
|000015d0| 6e 73 2e 20 54 68 65 20 | 62 6f 74 74 6f 6d 20 6c |ns. The |bottom l|
|000015e0| 69 6e 65 20 69 73 20 74 | 68 61 74 0a 20 20 20 62 |ine is t|hat. b|
|000015f0| 65 6e 63 68 6d 61 72 6b | 69 6e 67 2c 20 65 73 70 |enchmark|ing, esp|
|00001600| 65 63 69 61 6c 6c 79 20 | 62 65 74 77 65 65 6e 20 |ecially |between |
|00001610| 74 77 6f 20 64 69 66 66 | 65 72 65 6e 74 20 6c 61 |two diff|erent la|
|00001620| 6e 67 75 61 67 65 73 2c | 20 72 65 71 75 69 72 65 |nguages,| require|
|00001630| 73 0a 20 20 20 5f 76 65 | 72 79 5f 20 63 61 72 65 |s. _ve|ry_ care|
|00001640| 66 75 6c 20 6d 65 61 73 | 75 72 65 6d 65 6e 74 2e |ful meas|urement.|
|00001650| 20 49 6e 20 67 65 6e 65 | 72 61 6c 2c 20 73 75 63 | In gene|ral, suc|
|00001660| 68 20 72 65 73 75 6c 74 | 73 20 73 68 6f 75 6c 64 |h result|s should|
|00001670| 20 62 65 20 76 69 65 77 | 65 64 0a 20 20 20 77 69 | be view|ed. wi|
|00001680| 74 68 20 63 61 75 74 69 | 6f 6e 2e 0a 0a 20 20 20 |th cauti|on... |
|00001690| 28 41 20 6d 65 73 73 61 | 67 65 20 66 72 6f 6d 20 |(A messa|ge from |
|000016a0| 42 65 76 69 6e 20 42 72 | 65 74 74 20 6f 66 20 44 |Bevin Br|ett of D|
|000016b0| 45 43 29 0a 0a 20 20 20 | 49 20 68 61 76 65 20 62 |EC).. |I have b|
|000016c0| 65 65 6e 20 61 73 6b 65 | 64 20 74 6f 20 63 6f 6d |een aske|d to com|
|000016d0| 6d 65 6e 74 20 6f 6e 20 | 74 68 65 20 72 65 6c 61 |ment on |the rela|
|000016e0| 74 69 76 65 20 70 65 72 | 66 6f 72 6d 61 6e 63 65 |tive per|formance|
|000016f0| 20 6f 66 20 61 6c 67 6f | 72 69 74 68 6d 73 0a 20 | of algo|rithms. |
|00001700| 20 20 63 6f 64 65 64 20 | 69 6e 20 41 64 61 20 61 | coded |in Ada a|
|00001710| 6e 64 20 69 6e 20 46 6f | 72 74 72 61 6e 2e 0a 0a |nd in Fo|rtran...|
|00001720| 20 20 20 54 68 69 73 20 | 71 75 65 73 74 69 6f 6e | This |question|
|00001730| 20 68 61 73 20 63 6f 6d | 65 20 75 70 20 72 65 70 | has com|e up rep|
|00001740| 65 61 74 65 64 6c 79 20 | 6f 76 65 72 20 74 68 65 |eatedly |over the|
|00001750| 20 79 65 61 72 73 2c 20 | 61 6e 64 20 64 65 73 65 | years, |and dese|
|00001760| 72 76 65 73 20 61 0a 20 | 20 20 63 6f 6d 70 6c 65 |rves a. | comple|
|00001770| 74 65 20 61 6e 73 77 65 | 72 2c 20 72 61 74 68 65 |te answe|r, rathe|
|00001780| 72 20 74 68 61 6e 20 61 | 20 73 69 6d 70 6c 69 73 |r than a| simplis|
|00001790| 74 69 63 20 6f 6e 65 2e | 0a 0a 20 20 20 54 68 65 |tic one.|.. The|
|000017a0| 72 65 20 61 72 65 20 6d | 61 6e 79 20 66 61 63 74 |re are m|any fact|
|000017b0| 6f 72 73 20 77 68 69 63 | 68 20 69 6e 66 6c 75 65 |ors whic|h influe|
|000017c0| 6e 63 65 20 74 68 65 20 | 73 69 7a 65 20 61 6e 64 |nce the |size and|
|000017d0| 20 65 78 65 63 75 74 69 | 6f 6e 20 73 70 65 65 64 | executi|on speed|
|000017e0| 20 6f 66 0a 20 20 20 74 | 68 65 20 72 75 6e 6e 69 | of. t|he runni|
|000017f0| 6e 67 20 70 72 6f 67 72 | 61 6d 2c 20 61 6e 64 20 |ng progr|am, and |
|00001800| 74 68 65 79 20 61 6c 6c | 20 70 6c 61 79 20 74 6f |they all| play to|
|00001810| 67 65 74 68 65 72 20 74 | 6f 20 67 65 74 20 61 20 |gether t|o get a |
|00001820| 66 75 6c 6c 20 61 6e 73 | 77 65 72 2e 0a 20 20 20 |full ans|wer.. |
|00001830| 49 20 73 68 61 6c 6c 20 | 74 68 65 6e 20 64 69 73 |I shall |then dis|
|00001840| 63 75 73 73 20 61 6e 20 | 65 78 61 63 74 20 41 64 |cuss an |exact Ad|
|00001850| 61 20 76 2e 20 46 6f 72 | 74 72 61 6e 20 63 6f 6d |a v. For|tran com|
|00001860| 70 61 72 69 73 6f 6e 20 | 74 68 61 74 20 44 69 67 |parison |that Dig|
|00001870| 69 74 61 6c 0a 20 20 20 | 77 61 73 20 69 6e 76 6f |ital. |was invo|
|00001880| 6c 76 65 64 20 69 6e 2e | 0a 0a 20 20 20 46 69 72 |lved in.|.. Fir|
|00001890| 73 74 2c 20 61 20 70 6f | 73 69 74 69 6f 6e 20 73 |st, a po|sition s|
|000018a0| 74 61 74 65 6d 65 6e 74 | 3a 20 54 68 65 20 76 61 |tatement|: The va|
|000018b0| 72 69 61 74 69 6f 6e 20 | 62 65 74 77 65 65 6e 20 |riation |between |
|000018c0| 41 64 61 20 61 6e 64 20 | 46 6f 72 74 72 61 6e 20 |Ada and |Fortran |
|000018d0| 69 73 0a 20 20 20 6c 65 | 73 73 20 74 68 61 6e 20 |is. le|ss than |
|000018e0| 74 68 65 20 76 61 72 69 | 61 74 69 6f 6e 20 77 69 |the vari|ation wi|
|000018f0| 74 68 69 6e 20 74 68 65 | 20 6c 61 6e 67 75 61 67 |thin the| languag|
|00001900| 65 20 63 61 75 73 65 64 | 20 62 79 20 74 68 65 20 |e caused| by the |
|00001910| 65 78 61 63 74 0a 20 20 | 20 69 6d 70 6c 65 6d 65 |exact. | impleme|
|00001920| 6e 74 61 74 69 6f 6e 20 | 64 65 74 61 69 6c 73 2e |ntation |details.|
|00001930| 20 41 20 70 65 72 73 6f | 6e 20 76 65 72 73 65 64 | A perso|n versed|
|00001940| 20 69 6e 20 74 68 65 20 | 41 64 61 20 69 73 73 75 | in the |Ada issu|
|00001950| 65 73 20 73 68 6f 75 6c | 64 20 64 6f 20 61 73 0a |es shoul|d do as.|
|00001960| 20 20 20 77 65 6c 6c 20 | 69 6e 20 41 64 61 20 61 | well |in Ada a|
|00001970| 73 20 61 20 70 65 72 73 | 6f 6e 20 76 65 72 73 65 |s a pers|on verse|
|00001980| 64 20 69 6e 20 74 68 65 | 20 46 6f 72 74 72 61 6e |d in the| Fortran|
|00001990| 20 69 73 73 75 65 73 20 | 77 69 6c 6c 20 64 6f 20 | issues |will do |
|000019a0| 69 6e 0a 20 20 20 46 6f | 72 74 72 61 6e 2e 20 54 |in. Fo|rtran. T|
|000019b0| 68 65 20 73 69 7a 65 20 | 61 6e 64 20 65 78 65 63 |he size |and exec|
|000019c0| 75 74 69 6f 6e 20 73 70 | 65 65 64 20 6f 66 20 74 |ution sp|eed of t|
|000019d0| 68 65 20 72 65 73 75 6c | 74 20 73 68 6f 75 6c 64 |he resul|t should|
|000019e0| 20 62 65 20 77 69 74 68 | 69 6e 20 61 0a 20 20 20 | be with|in a. |
|000019f0| 66 65 77 20 70 65 72 63 | 65 6e 74 20 6f 66 20 65 |few perc|ent of e|
|00001a00| 61 63 68 20 6f 74 68 65 | 72 2e 0a 0a 20 20 20 28 |ach othe|r... (|
|00001a10| 61 29 20 44 69 66 66 65 | 72 65 6e 63 65 73 20 64 |a) Diffe|rences d|
|00001a20| 75 65 20 74 6f 20 74 68 | 65 20 63 6f 6d 70 69 6c |ue to th|e compil|
|00001a30| 65 72 0a 0a 20 20 20 49 | 6e 20 74 68 65 20 63 61 |er.. I|n the ca|
|00001a40| 73 65 20 6f 66 20 74 68 | 65 20 44 45 43 20 41 64 |se of th|e DEC Ad|
|00001a50| 61 20 61 6e 64 20 46 6f | 72 74 72 61 6e 20 63 6f |a and Fo|rtran co|
|00001a60| 6d 70 69 6c 65 72 73 2c | 20 74 68 65 20 6f 70 74 |mpilers,| the opt|
|00001a70| 69 6d 69 7a 65 72 20 61 | 6e 64 0a 20 20 20 20 20 |imizer a|nd. |
|00001a80| 20 20 63 6f 64 65 20 67 | 65 6e 65 72 61 74 6f 72 | code g|enerator|
|00001a90| 20 61 72 65 20 74 68 65 | 20 73 61 6d 65 2e 20 4e | are the| same. N|
|00001aa0| 65 76 65 72 2d 74 68 65 | 2d 6c 65 73 73 2c 20 74 |ever-the|-less, t|
|00001ab0| 68 65 20 65 78 61 63 74 | 20 69 6e 70 75 74 73 20 |he exact| inputs |
|00001ac0| 69 6e 74 6f 0a 20 20 20 | 20 20 20 20 74 68 65 20 |into. | the |
|00001ad0| 6f 70 74 69 6d 69 7a 65 | 72 20 61 6e 64 20 63 6f |optimize|r and co|
|00001ae0| 64 65 20 67 65 6e 65 72 | 61 74 6f 72 20 6d 61 79 |de gener|ator may|
|00001af0| 20 64 69 66 66 65 72 20 | 73 6c 69 67 68 74 6c 79 | differ |slightly|
|00001b00| 20 77 68 65 6e 20 74 68 | 65 20 73 61 6d 65 0a 20 | when th|e same. |
|00001b10| 20 20 20 20 20 20 61 6c | 67 6f 72 69 74 68 6d 20 | al|gorithm |
|00001b20| 69 73 20 63 6f 6d 70 69 | 6c 65 64 20 62 79 20 74 |is compi|led by t|
|00001b30| 68 65 20 41 64 61 20 61 | 6e 64 20 46 6f 72 74 72 |he Ada a|nd Fortr|
|00001b40| 61 6e 20 63 6f 6d 70 69 | 6c 65 72 73 2c 20 61 6e |an compi|lers, an|
|00001b50| 64 20 74 68 69 73 0a 20 | 20 20 20 20 20 20 63 61 |d this. | ca|
|00001b60| 6e 20 72 65 73 75 6c 74 | 20 69 6e 20 6d 61 6a 6f |n result| in majo|
|00001b70| 72 20 64 69 66 66 65 72 | 65 6e 63 65 73 20 69 6e |r differ|ences in|
|00001b80| 20 74 68 65 20 67 65 6e | 65 72 61 74 65 64 20 63 | the gen|erated c|
|00001b90| 6f 64 65 2e 20 49 6e 20 | 74 68 65 73 65 0a 20 20 |ode. In |these. |
|00001ba0| 20 20 20 20 20 63 61 73 | 65 73 20 74 68 65 20 63 | cas|es the c|
|00001bb0| 6f 6d 70 69 6c 65 72 20 | 66 72 6f 6e 74 20 65 6e |ompiler |front en|
|00001bc0| 64 73 20 63 61 6e 20 75 | 73 75 61 6c 6c 79 20 62 |ds can u|sually b|
|00001bd0| 65 20 6d 6f 64 69 66 69 | 65 64 20 74 6f 20 63 6f |e modifi|ed to co|
|00001be0| 72 72 65 63 74 0a 20 20 | 20 20 20 20 20 74 68 65 |rrect. | the|
|00001bf0| 20 73 6c 6f 77 65 72 20 | 6f 6e 65 2e 0a 0a 20 20 | slower |one... |
|00001c00| 20 20 20 20 20 57 65 20 | 68 61 76 65 20 6e 6f 74 | We |have not|
|00001c10| 20 6f 62 73 65 72 76 65 | 64 20 61 6e 79 20 6d 61 | observe|d any ma|
|00001c20| 6a 6f 72 20 64 69 66 66 | 65 72 65 6e 63 65 73 20 |jor diff|erences |
|00001c30| 69 6e 20 67 65 6e 65 72 | 61 74 65 64 20 63 6f 64 |in gener|ated cod|
|00001c40| 65 0a 20 20 20 20 20 20 | 20 71 75 61 6c 69 74 79 |e. | quality|
|00001c50| 20 62 65 74 77 65 65 6e | 20 74 68 65 20 44 45 43 | between| the DEC|
|00001c60| 20 41 64 61 20 61 6e 64 | 20 44 45 43 20 46 6f 72 | Ada and| DEC For|
|00001c70| 74 72 61 6e 20 63 6f 6d | 70 69 6c 65 72 73 20 63 |tran com|pilers c|
|00001c80| 61 75 73 65 64 20 62 79 | 0a 20 20 20 20 20 20 20 |aused by|. |
|00001c90| 73 75 63 68 20 69 73 73 | 75 65 73 2e 0a 0a 0a 20 |such iss|ues.... |
|00001ca0| 20 20 28 62 29 20 44 69 | 66 66 65 72 65 6e 63 65 | (b) Di|fference|
|00001cb0| 73 20 64 75 65 20 74 6f | 20 74 68 65 20 6c 61 6e |s due to| the lan|
|00001cc0| 67 75 61 67 65 0a 0a 20 | 20 20 49 74 20 69 73 20 |guage.. | It is |
|00001cd0| 76 65 72 79 20 69 6d 70 | 6f 72 74 61 6e 74 20 74 |very imp|ortant t|
|00001ce0| 68 61 74 20 74 68 65 20 | 73 61 6d 65 20 61 6c 67 |hat the |same alg|
|00001cf0| 6f 72 69 74 68 6d 20 62 | 65 20 77 72 69 74 74 65 |orithm b|e writte|
|00001d00| 6e 20 69 6e 20 74 68 65 | 20 74 77 6f 0a 20 20 20 |n in the| two. |
|00001d10| 20 20 20 20 6c 61 6e 67 | 75 61 67 65 73 2e 20 54 | lang|uages. T|
|00001d20| 68 65 20 62 69 67 67 65 | 73 74 20 64 69 66 66 65 |he bigge|st diffe|
|00001d30| 72 65 6e 63 65 73 20 77 | 65 20 68 61 76 65 20 6f |rences w|e have o|
|00001d40| 62 73 65 72 76 65 64 20 | 61 72 65 0a 20 20 20 20 |bserved |are. |
|00001d50| 20 20 20 20 20 31 2e 20 | 48 61 76 69 6e 67 20 74 | 1. |Having t|
|00001d60| 68 65 20 77 72 6f 6e 67 | 20 64 69 6d 65 6e 73 69 |he wrong| dimensi|
|00001d70| 6f 6e 20 76 61 72 79 69 | 6e 67 20 66 61 73 74 65 |on varyi|ng faste|
|00001d80| 73 74 2c 20 73 69 6e 63 | 65 20 69 74 20 69 73 0a |st, sinc|e it is.|
|00001d90| 20 20 20 20 20 20 20 20 | 20 20 20 20 64 65 73 69 | | desi|
|00001da0| 72 65 61 62 6c 65 20 74 | 6f 20 68 61 76 65 20 74 |reable t|o have t|
|00001db0| 68 65 20 66 69 72 73 74 | 20 64 69 6d 65 6e 73 69 |he first| dimensi|
|00001dc0| 6f 6e 20 63 68 61 6e 67 | 69 6e 67 20 66 61 73 74 |on chang|ing fast|
|00001dd0| 65 73 74 20 69 6e 0a 20 | 20 20 20 20 20 20 20 20 |est in. | |
|00001de0| 20 20 20 46 6f 72 74 72 | 61 6e 2c 20 61 6e 64 20 | Fortr|an, and |
|00001df0| 74 68 65 20 6c 61 73 74 | 20 64 69 6d 65 6e 73 69 |the last| dimensi|
|00001e00| 6f 6e 20 69 6e 20 41 64 | 61 2e 20 54 68 75 73 20 |on in Ad|a. Thus |
|00001e10| 77 68 65 6e 20 61 6e 0a | 20 20 20 20 20 20 20 20 |when an.| |
|00001e20| 20 20 20 20 61 6c 67 6f | 72 69 74 68 6d 20 69 73 | algo|rithm is|
|00001e30| 20 74 72 61 6e 73 6c 69 | 74 65 72 61 74 65 64 2c | transli|terated,|
|00001e40| 20 74 68 65 20 61 72 72 | 61 79 20 69 6e 64 65 78 | the arr|ay index|
|00001e50| 65 73 20 6d 75 73 74 20 | 62 65 0a 20 20 20 20 20 |es must |be. |
|00001e60| 20 20 20 20 20 20 20 72 | 65 76 65 72 73 65 64 2e | r|eversed.|
|00001e70| 0a 0a 20 20 20 20 20 20 | 20 20 20 32 2e 20 55 73 |.. | 2. Us|
|00001e80| 69 6e 67 20 63 6f 6d 70 | 69 6c 65 2d 74 69 6d 65 |ing comp|ile-time|
|00001e90| 2d 6b 6e 6f 77 6e 20 62 | 6f 75 6e 64 73 20 66 6f |-known b|ounds fo|
|00001ea0| 72 20 61 72 72 61 79 73 | 20 69 6e 20 46 6f 72 74 |r arrays| in Fort|
|00001eb0| 72 61 6e 2c 20 61 6e 64 | 0a 20 20 20 20 20 20 20 |ran, and|. |
|00001ec0| 20 20 20 20 20 75 73 69 | 6e 67 20 75 6e 63 6f 6e | usi|ng uncon|
|00001ed0| 73 74 72 61 69 6e 65 64 | 20 61 72 72 61 79 73 20 |strained| arrays |
|00001ee0| 69 6e 20 74 68 65 20 41 | 64 61 20 63 6f 64 65 2e |in the A|da code.|
|00001ef0| 20 4b 6e 6f 77 69 6e 67 | 20 74 68 65 20 65 78 61 | Knowing| the exa|
|00001f00| 63 74 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 76 |ct. | v|
|00001f10| 61 6c 75 65 73 20 6f 66 | 20 74 68 65 20 64 69 6d |alues of| the dim|
|00001f20| 65 6e 73 69 6f 6e 73 20 | 61 74 20 63 6f 6d 70 69 |ensions |at compi|
|00001f30| 6c 65 2d 74 69 6d 65 20 | 72 65 73 75 6c 74 73 20 |le-time |results |
|00001f40| 69 6e 20 6d 75 63 68 0a | 20 20 20 20 20 20 20 20 |in much.| |
|00001f50| 20 20 20 20 62 65 74 74 | 65 72 20 63 6f 64 65 2e | bett|er code.|
|00001f60| 0a 0a 20 20 20 20 20 20 | 20 20 20 33 2e 20 4e 6f |.. | 3. No|
|00001f70| 74 20 73 75 70 70 72 65 | 73 73 69 6e 67 20 61 6c |t suppre|ssing al|
|00001f80| 6c 20 74 68 65 20 72 75 | 6e 74 69 6d 65 20 63 68 |l the ru|ntime ch|
|00001f90| 65 63 6b 73 20 69 6e 20 | 41 64 61 2e 20 54 68 65 |ecks in |Ada. The|
|00001fa0| 20 46 6f 72 74 72 61 6e | 0a 20 20 20 20 20 20 20 | Fortran|. |
|00001fb0| 20 20 20 20 20 63 6f 6d | 70 69 6c 65 72 20 61 73 | com|piler as|
|00001fc0| 73 75 6d 65 73 20 61 6c | 6c 20 61 72 72 61 79 20 |sumes al|l array |
|00001fd0| 62 6f 75 6e 64 73 20 61 | 72 65 20 69 6e 20 72 61 |bounds a|re in ra|
|00001fe0| 6e 67 65 2c 20 61 6e 64 | 20 61 6c 6c 0a 20 20 20 |nge, and| all. |
|00001ff0| 20 20 20 20 20 20 20 20 | 20 61 72 69 74 68 6d 65 | | arithme|
|00002000| 74 69 63 20 6f 70 65 72 | 61 74 69 6f 6e 73 20 64 |tic oper|ations d|
|00002010| 6f 20 6e 6f 74 20 6f 76 | 65 72 66 6c 6f 77 2e 20 |o not ov|erflow. |
|00002020| 59 6f 75 20 6d 75 73 74 | 20 75 73 65 20 61 20 70 |You must| use a p|
|00002030| 72 61 67 6d 61 0a 20 20 | 20 20 20 20 20 20 20 20 |ragma. | |
|00002040| 20 20 53 75 70 70 72 65 | 73 73 20 74 6f 20 74 65 | Suppre|ss to te|
|00002050| 6c 6c 20 74 68 69 73 20 | 74 6f 20 74 68 65 20 41 |ll this |to the A|
|00002060| 64 61 20 63 6f 6d 70 69 | 6c 65 72 20 61 73 20 77 |da compi|ler as w|
|00002070| 65 6c 6c 2e 0a 0a 20 20 | 20 20 20 20 20 20 20 34 |ell... | 4|
|00002080| 2e 20 44 6f 6e 27 74 20 | 75 73 65 20 61 72 72 61 |. Don't |use arra|
|00002090| 79 73 20 6f 66 20 41 64 | 61 20 42 6f 6f 6c 65 61 |ys of Ad|a Boolea|
|000020a0| 6e 73 20 74 6f 20 6d 61 | 74 63 68 20 61 72 72 61 |ns to ma|tch arra|
|000020b0| 79 73 20 6f 66 20 46 6f | 72 74 72 61 6e 0a 20 20 |ys of Fo|rtran. |
|000020c0| 20 20 20 20 20 20 20 20 | 20 20 49 6e 74 65 67 65 | | Intege|
|000020d0| 72 73 2c 20 62 65 63 61 | 75 73 65 20 61 63 63 65 |rs, beca|use acce|
|000020e0| 73 73 69 6e 67 20 62 79 | 74 65 73 20 6f 6e 20 61 |ssing by|tes on a|
|000020f0| 20 52 49 53 43 20 73 79 | 73 74 65 6d 20 6d 69 67 | RISC sy|stem mig|
|00002100| 68 74 20 62 65 0a 20 20 | 20 20 20 20 20 20 20 20 |ht be. | |
|00002110| 20 20 6d 75 63 68 20 77 | 6f 72 73 65 20 74 68 61 | much w|orse tha|
|00002120| 6e 20 61 63 63 65 73 73 | 69 6e 67 20 66 75 6c 6c |n access|ing full|
|00002130| 77 6f 72 64 73 2e 0a 0a | 0a 20 20 20 28 63 29 20 |words...|. (c) |
|00002140| 44 69 66 66 65 72 65 6e | 63 65 73 20 64 75 65 20 |Differen|ces due |
|00002150| 74 6f 20 74 68 65 20 62 | 69 6e 64 69 6e 67 73 0a |to the b|indings.|
|00002160| 0a 20 20 20 54 68 65 20 | 62 69 67 67 65 73 74 20 |. The |biggest |
|00002170| 62 69 6e 64 69 6e 67 73 | 20 64 69 66 66 65 72 65 |bindings| differe|
|00002180| 6e 63 65 73 20 61 72 65 | 20 72 65 6c 61 74 65 64 |nces are| related|
|00002190| 20 74 6f 20 46 6f 72 74 | 72 61 6e 27 73 20 62 75 | to Fort|ran's bu|
|000021a0| 69 6c 74 2d 69 6e 0a 20 | 20 20 20 20 20 20 73 75 |ilt-in. | su|
|000021b0| 70 70 6f 72 74 20 66 6f | 72 20 63 6f 6d 70 6c 65 |pport fo|r comple|
|000021c0| 78 20 74 79 70 65 73 2c | 20 61 6e 64 20 66 6f 72 |x types,| and for|
|000021d0| 20 76 61 72 69 6f 75 73 | 20 6d 61 74 68 20 72 6f | various| math ro|
|000021e0| 75 74 69 6e 65 73 20 73 | 75 63 68 20 61 73 0a 20 |utines s|uch as. |
|000021f0| 20 20 20 20 20 20 53 51 | 52 54 20 61 6e 64 20 53 | SQ|RT and S|
|00002200| 49 4e 2c 20 63 6f 6d 70 | 61 72 65 64 20 77 69 74 |IN, comp|ared wit|
|00002210| 68 20 41 64 61 20 63 6f | 64 65 20 74 68 61 74 20 |h Ada co|de that |
|00002220| 6f 66 74 65 6e 20 75 73 | 65 73 20 68 61 6e 64 2d |often us|es hand-|
|00002230| 63 6f 64 65 64 20 6f 72 | 0a 20 20 20 20 20 20 20 |coded or|. |
|00002240| 49 53 4f 20 73 74 61 6e | 64 61 72 64 69 73 65 64 |ISO stan|dardised|
|00002250| 20 76 65 72 73 69 6f 6e | 73 20 6f 66 20 74 68 65 | version|s of the|
|00002260| 73 65 20 66 75 6e 63 74 | 69 6f 6e 73 20 77 69 74 |se funct|ions wit|
|00002270| 68 20 64 69 66 66 65 72 | 65 6e 74 0a 20 20 20 20 |h differ|ent. |
|00002280| 20 20 20 72 65 71 75 69 | 72 65 6d 65 6e 74 73 20 | requi|rements |
|00002290| 74 68 61 6e 20 61 72 65 | 20 69 6d 70 6f 73 65 64 |than are| imposed|
|000022a0| 20 6f 6e 20 74 68 65 20 | 46 6f 72 74 72 61 6e 20 | on the |Fortran |
|000022b0| 76 65 72 73 69 6f 6e 73 | 2e 0a 0a 20 20 20 20 20 |versions|... |
|000022c0| 20 20 44 45 43 20 41 64 | 61 20 68 61 73 20 62 75 | DEC Ad|a has bu|
|000022d0| 69 6c 74 2d 69 6e 20 73 | 75 70 70 6f 72 74 20 66 |ilt-in s|upport f|
|000022e0| 6f 72 20 63 6f 6d 70 6c | 65 78 20 74 79 70 65 73 |or compl|ex types|
|000022f0| 2c 20 61 6e 64 20 61 6c | 73 6f 20 68 61 73 0a 20 |, and al|so has. |
|00002300| 20 20 20 20 20 20 62 69 | 6e 64 69 6e 67 73 20 64 | bi|ndings d|
|00002310| 69 72 65 63 74 6c 79 20 | 74 6f 20 74 68 65 20 73 |irectly |to the s|
|00002320| 61 6d 65 20 70 72 69 6d | 69 74 69 76 65 73 20 74 |ame prim|itives t|
|00002330| 68 61 74 20 46 6f 72 74 | 72 61 6e 20 75 73 65 73 |hat Fort|ran uses|
|00002340| 20 66 6f 72 20 69 74 73 | 0a 20 20 20 20 20 20 20 | for its|. |
|00002350| 6d 61 74 68 20 72 6f 75 | 74 69 6e 65 73 20 61 6e |math rou|tines an|
|00002360| 64 20 73 6f 20 67 65 74 | 73 20 74 68 65 20 73 61 |d so get|s the sa|
|00002370| 6d 65 20 70 65 72 66 6f | 72 6d 61 6e 63 65 20 61 |me perfo|rmance a|
|00002380| 73 20 46 6f 72 74 72 61 | 6e 20 64 6f 65 73 2e 0a |s Fortra|n does..|
|00002390| 0a 0a 20 20 20 28 64 29 | 20 44 69 66 66 65 72 65 |.. (d)| Differe|
|000023a0| 6e 63 65 73 20 64 75 65 | 20 74 6f 20 74 68 65 20 |nces due| to the |
|000023b0| 61 75 74 68 6f 72 0a 0a | 20 20 20 54 68 65 20 75 |author..| The u|
|000023c0| 73 65 20 6f 66 20 67 6f | 6f 64 20 41 64 61 20 61 |se of go|od Ada a|
|000023d0| 6e 64 20 46 6f 72 74 72 | 61 6e 20 73 74 79 6c 65 |nd Fortr|an style|
|000023e0| 20 63 61 6e 20 61 6c 73 | 6f 20 65 66 66 65 63 74 | can als|o effect|
|000023f0| 20 74 68 65 20 67 65 6e | 65 72 61 74 65 64 0a 20 | the gen|erated. |
|00002400| 20 20 20 20 20 20 63 6f | 64 65 2e 20 50 72 6f 76 | co|de. Prov|
|00002410| 69 64 65 64 20 74 68 65 | 20 61 75 74 68 6f 72 20 |ided the| author |
|00002420| 77 72 69 74 65 73 20 69 | 6e 20 67 6f 6f 64 20 41 |writes i|n good A|
|00002430| 64 61 20 73 74 79 6c 65 | 2c 20 61 6e 64 20 66 6f |da style|, and fo|
|00002440| 6c 6c 6f 77 73 0a 20 20 | 20 20 20 20 20 74 68 65 |llows. | the|
|00002450| 20 61 62 6f 76 65 20 67 | 75 69 64 65 6c 69 6e 65 | above g|uideline|
|00002460| 73 2c 20 74 68 65 20 67 | 65 6e 65 72 61 74 65 64 |s, the g|enerated|
|00002470| 20 63 6f 64 65 20 73 68 | 6f 75 6c 64 20 64 6f 20 | code sh|ould do |
|00002480| 61 73 20 77 65 6c 6c 20 | 61 73 0a 20 20 20 20 20 |as well |as. |
|00002490| 20 20 46 6f 72 74 72 61 | 6e 2e 0a 0a 0a 20 20 20 | Fortra|n.... |
|000024a0| 20 54 68 65 20 41 64 61 | 20 50 65 72 66 6f 72 6d | The Ada| Perform|
|000024b0| 61 6e 63 65 20 42 65 6e | 63 68 6d 61 72 6b 0a 0a |ance Ben|chmark..|
|000024c0| 20 20 20 41 20 44 45 43 | 20 41 64 61 20 63 75 73 | A DEC| Ada cus|
|000024d0| 74 6f 6d 65 72 20 68 61 | 64 20 61 20 46 6f 72 74 |tomer ha|d a Fort|
|000024e0| 72 61 6e 20 62 65 6e 63 | 68 6d 61 72 6b 20 74 68 |ran benc|hmark th|
|000024f0| 61 74 20 68 61 64 20 62 | 65 65 6e 20 74 72 61 6e |at had b|een tran|
|00002500| 73 6c 61 74 65 64 0a 20 | 20 20 69 6e 74 6f 20 41 |slated. | into A|
|00002510| 64 61 20 77 69 74 68 6f | 75 74 20 61 77 61 72 65 |da witho|ut aware|
|00002520| 6e 65 73 73 20 6f 66 20 | 74 68 65 20 61 62 6f 76 |ness of |the abov|
|00002530| 65 20 69 73 73 75 65 73 | 2c 20 61 6e 64 20 77 61 |e issues|, and wa|
|00002540| 73 20 72 75 6e 6e 69 6e | 67 0a 20 20 20 73 75 62 |s runnin|g. sub|
|00002550| 73 74 61 6e 74 69 61 6c | 6c 79 20 73 6c 6f 77 65 |stantial|ly slowe|
|00002560| 72 20 77 69 74 68 20 44 | 45 43 20 41 64 61 20 74 |r with D|EC Ada t|
|00002570| 68 61 6e 20 74 68 65 20 | 6f 72 69 67 69 6e 61 6c |han the |original|
|00002580| 20 77 61 73 20 77 69 74 | 68 20 44 45 43 0a 20 20 | was wit|h DEC. |
|00002590| 20 46 6f 72 74 72 61 6e | 2e 0a 0a 20 20 20 42 65 | Fortran|... Be|
|000025a0| 76 69 6e 20 42 72 65 74 | 74 2c 20 61 20 44 45 43 |vin Bret|t, a DEC|
|000025b0| 20 41 64 61 20 74 65 61 | 6d 20 6d 65 6d 62 65 72 | Ada tea|m member|
|000025c0| 2c 20 64 65 76 65 6c 6f | 70 65 64 20 74 68 65 20 |, develo|ped the |
|000025d0| 61 62 6f 76 65 20 67 75 | 69 64 65 6c 69 6e 65 73 |above gu|idelines|
|000025e0| 20 69 6e 0a 20 20 20 74 | 68 65 20 70 72 6f 63 65 | in. t|he proce|
|000025f0| 73 73 20 6f 66 20 72 65 | 74 72 61 6e 73 6c 61 74 |ss of re|translat|
|00002600| 69 6e 67 20 74 68 65 20 | 63 6f 64 65 20 69 6e 74 |ing the |code int|
|00002610| 6f 20 41 64 61 2e 0a 0a | 20 20 20 50 6f 72 74 69 |o Ada...| Porti|
|00002620| 6f 6e 73 20 6f 66 20 74 | 68 69 73 20 74 72 61 6e |ons of t|his tran|
|00002630| 73 6c 61 74 69 6f 6e 20 | 61 72 65 20 73 68 6f 77 |slation |are show|
|00002640| 6e 20 68 65 72 65 20 28 | 61 29 20 61 73 20 61 6e |n here (|a) as an|
|00002650| 20 69 6c 6c 75 73 74 72 | 61 74 69 6f 6e 20 6f 66 | illustr|ation of|
|00002660| 0a 20 20 20 74 68 65 20 | 61 70 70 6c 69 63 61 74 |. the |applicat|
|00002670| 69 6f 6e 20 6f 66 20 74 | 68 65 20 61 62 6f 76 65 |ion of t|he above|
|00002680| 20 72 75 6c 65 73 2c 20 | 61 6e 64 20 28 62 29 20 | rules, |and (b) |
|00002690| 61 73 20 61 6e 20 69 6c | 6c 75 73 74 72 61 74 69 |as an il|lustrati|
|000026a0| 6f 6e 20 6f 66 20 74 68 | 65 0a 20 20 20 6b 69 6e |on of th|e. kin|
|000026b0| 64 20 6f 66 20 6f 70 65 | 72 61 74 69 6f 6e 73 20 |d of ope|rations |
|000026c0| 74 68 61 74 20 77 65 72 | 65 20 70 72 65 73 65 6e |that wer|e presen|
|000026d0| 74 20 69 6e 20 74 68 65 | 20 62 65 6e 63 68 6d 61 |t in the| benchma|
|000026e0| 72 6b 2e 0a 0a 20 20 20 | 54 68 65 20 77 68 6f 6c |rk... |The whol|
|000026f0| 65 20 62 65 6e 63 68 6d | 61 72 6b 20 68 61 73 20 |e benchm|ark has |
|00002700| 6e 6f 74 20 62 65 65 6e | 20 70 72 6f 76 69 64 65 |not been| provide|
|00002710| 64 20 74 6f 20 61 76 6f | 69 64 20 70 6f 73 73 69 |d to avo|id possi|
|00002720| 62 6c 65 20 69 73 73 75 | 65 73 20 6f 66 0a 20 20 |ble issu|es of. |
|00002730| 20 6f 77 6e 65 72 73 68 | 69 70 2e 0a 0a 20 20 20 | ownersh|ip... |
|00002740| 54 68 65 20 72 65 73 75 | 6c 74 69 6e 67 20 41 64 |The resu|lting Ad|
|00002750| 61 20 62 65 6e 63 68 6d | 61 72 6b 20 63 6f 6d 70 |a benchm|ark comp|
|00002760| 6f 6e 65 6e 74 73 20 65 | 61 63 68 20 72 61 6e 20 |onents e|ach ran |
|00002770| 77 69 74 68 69 6e 20 61 | 20 66 65 77 20 70 65 72 |within a| few per|
|00002780| 63 65 6e 74 0a 20 20 20 | 6f 66 20 74 68 65 69 72 |cent. |of their|
|00002790| 20 46 6f 72 74 72 61 6e | 20 63 6f 75 6e 74 65 72 | Fortran| counter|
|000027a0| 70 61 72 74 73 2e 20 54 | 68 65 20 41 64 61 20 63 |parts. T|he Ada c|
|000027b0| 6f 64 65 20 69 73 20 61 | 76 61 69 6c 61 62 6c 65 |ode is a|vailable|
|000027c0| 20 62 79 20 46 54 50 2c | 20 69 6e 0a 20 20 20 66 | by FTP,| in. f|
|000027d0| 69 6c 65 20 66 74 70 3a | 2f 2f 6c 67 6c 66 74 70 |ile ftp:|//lglftp|
|000027e0| 2e 65 70 66 6c 2e 63 68 | 2f 70 75 62 2f 41 64 61 |.epfl.ch|/pub/Ada|
|000027f0| 2f 46 41 51 2f 61 64 61 | 2d 76 73 2d 66 6f 72 74 |/FAQ/ada|-vs-fort|
|00002800| 72 61 6e 2e 61 64 61 0a | 0a 0a 39 2e 34 3a 20 49 |ran.ada.|..9.4: I|
|00002810| 73 6e 27 74 20 41 64 61 | 20 6c 65 73 73 20 22 65 |sn't Ada| less "e|
|00002820| 6c 65 67 61 6e 74 22 20 | 74 68 61 6e 20 45 69 66 |legant" |than Eif|
|00002830| 66 65 6c 3f 0a 0a 20 20 | 20 57 68 69 6c 65 20 69 |fel?.. | While i|
|00002840| 74 20 69 73 20 74 72 75 | 65 20 74 68 61 74 20 70 |t is tru|e that p|
|00002850| 72 6f 67 72 61 6d 6d 69 | 6e 67 2d 6c 61 6e 67 75 |rogrammi|ng-langu|
|00002860| 61 67 65 20 73 75 70 70 | 6f 72 74 20 66 6f 72 20 |age supp|ort for |
|00002870| 22 61 73 73 65 72 74 69 | 6f 6e 73 22 0a 20 20 20 |"asserti|ons". |
|00002880| 69 73 20 61 6e 20 69 6d | 70 6f 72 74 61 6e 74 20 |is an im|portant |
|00002890| 63 6f 6e 74 72 69 62 75 | 74 69 6f 6e 20 6f 66 20 |contribu|tion of |
|000028a0| 45 69 66 66 65 6c 20 74 | 6f 20 73 6f 66 74 77 61 |Eiffel t|o softwa|
|000028b0| 72 65 20 63 6f 6e 73 74 | 72 75 63 74 69 6f 6e 2c |re const|ruction,|
|000028c0| 20 74 68 69 73 0a 20 20 | 20 69 73 20 6e 6f 74 20 | this. | is not |
|000028d0| 61 6e 20 69 73 73 75 65 | 20 6f 66 20 22 65 6c 65 |an issue| of "ele|
|000028e0| 67 61 6e 63 65 22 2c 20 | 61 6e 64 20 74 68 65 72 |gance", |and ther|
|000028f0| 65 20 61 72 65 20 6d 61 | 6e 79 20 6f 74 68 65 72 |e are ma|ny other|
|00002900| 20 69 6d 70 6f 72 74 61 | 6e 74 0a 20 20 20 66 61 | importa|nt. fa|
|00002910| 63 74 6f 72 73 20 74 6f | 20 63 6f 6e 73 69 64 65 |ctors to| conside|
|00002920| 72 2e 0a 0a 20 20 20 4e | 6f 74 65 20 61 6c 73 6f |r... N|ote also|
|00002930| 20 74 68 61 74 20 70 72 | 65 63 6f 6e 64 69 74 69 | that pr|econditi|
|00002940| 6f 6e 73 20 61 6e 64 20 | 70 6f 73 74 63 6f 6e 64 |ons and |postcond|
|00002950| 69 74 69 6f 6e 73 20 63 | 61 6e 20 62 65 20 66 61 |itions c|an be fa|
|00002960| 69 72 6c 79 20 65 61 73 | 69 6c 79 0a 20 20 20 61 |irly eas|ily. a|
|00002970| 6e 64 20 65 66 66 69 63 | 69 65 6e 74 6c 79 20 69 |nd effic|iently i|
|00002980| 6e 63 6c 75 64 65 64 20 | 69 6e 20 41 64 61 20 63 |ncluded |in Ada c|
|00002990| 6f 64 65 2e 20 49 6e 76 | 61 72 69 61 6e 74 73 20 |ode. Inv|ariants |
|000029a0| 73 65 65 6d 20 64 69 66 | 66 69 63 75 6c 74 20 74 |seem dif|ficult t|
|000029b0| 6f 0a 20 20 20 65 6d 75 | 6c 61 74 65 20 64 69 72 |o. emu|late dir|
|000029c0| 65 63 74 6c 79 20 69 6e | 20 41 64 61 2e 20 49 66 |ectly in| Ada. If|
|000029d0| 20 79 6f 75 27 72 65 20 | 72 65 61 6c 6c 79 20 69 | you're |really i|
|000029e0| 6e 74 65 72 65 73 74 65 | 64 20 69 6e 20 74 68 65 |ntereste|d in the|
|000029f0| 20 66 6f 72 6d 61 6c 20 | 75 73 65 0a 20 20 20 6f | formal |use. o|
|00002a00| 66 20 61 73 73 65 72 74 | 69 6f 6e 73 20 77 69 74 |f assert|ions wit|
|00002a10| 68 20 41 64 61 2c 20 6d | 61 79 62 65 20 41 6e 6e |h Ada, m|aybe Ann|
|00002a20| 61 20 69 73 20 61 20 73 | 6f 6c 75 74 69 6f 6e 20 |a is a s|olution |
|00002a30| 66 6f 72 20 79 6f 75 2e | 0a 0a 20 20 20 28 54 75 |for you.|.. (Tu|
|00002a40| 63 6b 65 72 20 54 61 66 | 74 20 63 6f 6d 6d 65 6e |cker Taf|t commen|
|00002a50| 74 73 29 0a 0a 20 20 20 | 49 20 67 75 65 73 73 20 |ts).. |I guess |
|00002a60| 6f 6e 65 20 74 68 69 6e | 67 20 74 68 61 74 20 62 |one thin|g that b|
|00002a70| 6f 74 68 65 72 73 20 6d | 65 20 61 20 6c 69 74 74 |others m|e a litt|
|00002a80| 6c 65 20 69 73 20 74 68 | 61 74 20 70 65 6f 70 6c |le is th|at peopl|
|00002a90| 65 20 61 72 65 20 71 75 | 69 63 6b 20 74 6f 0a 20 |e are qu|ick to. |
|00002aa0| 20 20 73 61 79 20 74 68 | 61 74 20 45 69 66 66 65 | say th|at Eiffe|
|00002ab0| 6c 20 69 73 20 22 65 6c | 65 67 61 6e 74 22 20 77 |l is "el|egant" w|
|00002ac0| 69 74 68 6f 75 74 20 72 | 65 61 6c 6c 79 20 6c 6f |ithout r|eally lo|
|00002ad0| 6f 6b 69 6e 67 20 61 74 | 20 69 74 2e 20 49 20 66 |oking at| it. I f|
|00002ae0| 65 61 72 20 74 68 61 74 | 0a 20 20 20 73 75 63 68 |ear that|. such|
|00002af0| 20 73 74 61 74 65 6d 65 | 6e 74 73 20 77 69 6c 6c | stateme|nts will|
|00002b00| 20 62 65 63 6f 6d 65 20 | 73 65 6c 66 2d 66 75 6c | become |self-ful|
|00002b10| 66 69 6c 6c 69 6e 67 20 | 70 72 6f 70 68 65 63 69 |filling |propheci|
|00002b20| 65 73 2c 20 77 69 74 68 | 20 74 68 6f 73 65 0a 20 |es, with| those. |
|00002b30| 20 20 70 72 6f 67 72 61 | 6d 6d 65 72 73 20 69 6e | progra|mmers in|
|00002b40| 74 65 72 65 73 74 65 64 | 20 69 6e 20 65 6c 65 67 |terested| in eleg|
|00002b50| 61 6e 63 65 20 6d 69 67 | 72 61 74 69 6e 67 20 6f |ance mig|rating o|
|00002b60| 76 65 72 20 74 6f 20 45 | 69 66 66 65 6c 20 72 61 |ver to E|iffel ra|
|00002b70| 74 68 65 72 0a 20 20 20 | 74 68 61 6e 20 73 74 69 |ther. |than sti|
|00002b80| 63 6b 69 6e 67 20 77 69 | 74 68 20 41 64 61 2e 0a |cking wi|th Ada..|
|00002b90| 0a 20 20 20 49 6e 20 70 | 61 72 74 69 63 75 6c 61 |. In p|articula|
|00002ba0| 72 2c 20 61 6c 74 68 6f | 75 67 68 20 49 20 6c 69 |r, altho|ugh I li|
|00002bb0| 6b 65 20 74 68 65 20 61 | 73 73 65 72 74 69 6f 6e |ke the a|ssertion|
|00002bc0| 20 73 74 75 66 66 20 69 | 6e 20 45 69 66 66 65 6c | stuff i|n Eiffel|
|00002bd0| 2c 20 49 20 74 68 69 6e | 6b 0a 20 20 20 74 68 65 |, I thin|k. the|
|00002be0| 20 6c 61 6e 67 75 61 67 | 65 20 68 61 73 20 61 20 | languag|e has a |
|00002bf0| 6e 75 6d 62 65 72 20 6f | 66 20 22 69 6e 65 6c 65 |number o|f "inele|
|00002c00| 67 61 6e 74 22 20 61 73 | 70 65 63 74 73 2e 20 46 |gant" as|pects. F|
|00002c10| 6f 72 20 65 78 61 6d 70 | 6c 65 3a 0a 0a 20 20 20 |or examp|le:.. |
|00002c20| 20 31 2e 20 65 78 63 65 | 70 74 69 6f 6e 20 68 61 | 1. exce|ption ha|
|00002c30| 6e 64 6c 65 72 73 20 6f | 6e 6c 79 20 61 74 20 74 |ndlers o|nly at t|
|00002c40| 68 65 20 74 6f 70 20 6c | 65 76 65 6c 20 6f 66 20 |he top l|evel of |
|00002c50| 61 20 72 6f 75 74 69 6e | 65 2c 20 77 69 74 68 20 |a routin|e, with |
|00002c60| 74 68 65 0a 20 20 20 20 | 20 20 20 6f 6e 6c 79 20 |the. | only |
|00002c70| 77 61 79 20 74 6f 20 22 | 68 61 6e 64 6c 65 22 20 |way to "|handle" |
|00002c80| 61 6e 20 65 78 63 65 70 | 74 69 6f 6e 20 62 65 69 |an excep|tion bei|
|00002c90| 6e 67 20 62 79 20 72 65 | 74 72 79 69 6e 67 20 74 |ng by re|trying t|
|00002ca0| 68 65 20 77 68 6f 6c 65 | 0a 20 20 20 20 20 20 20 |he whole|. |
|00002cb0| 72 6f 75 74 69 6e 65 2e | 0a 0a 20 20 20 20 32 2e |routine.|.. 2.|
|00002cc0| 20 4e 6f 20 77 61 79 20 | 74 6f 20 72 65 74 75 72 | No way |to retur|
|00002cd0| 6e 20 66 72 6f 6d 20 61 | 20 72 6f 75 74 69 6e 65 |n from a| routine|
|00002ce0| 20 69 6e 20 74 68 65 20 | 6d 69 64 64 6c 65 2e 20 | in the |middle. |
|00002cf0| 54 68 69 73 20 6d 61 6b | 65 73 20 69 74 20 61 0a |This mak|es it a.|
|00002d00| 20 20 20 20 20 20 20 70 | 61 69 6e 20 69 6e 20 74 | p|ain in t|
|00002d10| 68 65 20 6e 65 63 6b 20 | 74 6f 20 73 65 61 72 63 |he neck |to searc|
|00002d20| 68 20 74 68 72 6f 75 67 | 68 20 61 20 6c 69 73 74 |h throug|h a list|
|00002d30| 20 66 6f 72 20 73 6f 6d | 65 74 68 69 6e 67 20 69 | for som|ething i|
|00002d40| 6e 20 61 20 6c 6f 6f 70 | 2c 0a 20 20 20 20 20 20 |n a loop|,. |
|00002d50| 20 61 6e 64 20 74 68 65 | 6e 20 72 65 74 75 72 6e | and the|n return|
|00002d60| 20 69 6d 6d 65 64 69 61 | 74 65 6c 79 20 77 68 65 | immedia|tely whe|
|00002d70| 6e 20 79 6f 75 20 66 69 | 6e 64 20 77 68 61 74 20 |n you fi|nd what |
|00002d80| 79 6f 75 20 77 61 6e 74 | 2e 20 28 49 20 68 61 76 |you want|. (I hav|
|00002d90| 65 0a 20 20 20 20 20 20 | 20 6e 65 76 65 72 20 66 |e. | never f|
|00002da0| 6f 75 6e 64 20 74 68 65 | 20 61 64 64 69 74 69 6f |ound the| additio|
|00002db0| 6e 20 6f 66 20 65 78 74 | 72 61 20 62 6f 6f 6c 65 |n of ext|ra boole|
|00002dc0| 61 6e 20 63 6f 6e 74 72 | 6f 6c 20 76 61 72 69 61 |an contr|ol varia|
|00002dd0| 62 6c 65 20 61 20 68 65 | 6c 70 0a 20 20 20 20 20 |ble a he|lp. |
|00002de0| 20 20 74 6f 20 74 68 65 | 20 75 6e 64 65 72 73 74 | to the| underst|
|00002df0| 61 6e 64 69 6e 67 20 6f | 66 20 61 6e 20 61 6c 67 |anding o|f an alg|
|00002e00| 6f 72 69 74 68 6d 2e 29 | 0a 0a 20 20 20 20 33 2e |orithm.)|.. 3.|
|00002e10| 20 4e 61 6d 65 73 70 61 | 63 65 20 63 6f 6e 74 72 | Namespa|ce contr|
|00002e20| 6f 6c 20 68 61 6e 64 6c | 65 64 20 62 79 20 61 20 |ol handl|ed by a |
|00002e30| 73 65 70 61 72 61 74 65 | 20 73 75 62 6c 61 6e 67 |separate| sublang|
|00002e40| 75 61 67 65 2c 20 61 6e | 64 20 6e 6f 20 72 65 61 |uage, an|d no rea|
|00002e50| 6c 0a 20 20 20 20 20 20 | 20 68 69 67 68 65 72 20 |l. | higher |
|00002e60| 6c 65 76 65 6c 20 63 6f | 6e 63 65 70 74 20 6f 66 |level co|ncept of|
|00002e70| 20 22 6d 6f 64 75 6c 65 | 22 20 6f 72 20 22 73 75 | "module|" or "su|
|00002e80| 62 73 79 73 74 65 6d 2e | 22 0a 0a 20 20 20 20 34 |bsystem.|".. 4|
|00002e90| 2e 20 41 6e 20 6f 62 73 | 63 75 72 65 20 6e 6f 74 |. An obs|cure not|
|00002ea0| 61 74 69 6f 6e 20 6c 69 | 6b 65 20 22 21 21 22 20 |ation li|ke "!!" |
|00002eb0| 62 65 69 6e 67 20 75 73 | 65 64 20 66 6f 72 20 61 |being us|ed for a|
|00002ec0| 6e 20 69 6d 70 6f 72 74 | 61 6e 74 20 61 6e 64 0a |n import|ant and.|
|00002ed0| 20 20 20 20 20 20 20 66 | 72 65 71 75 65 6e 74 20 | f|requent |
|00002ee0| 6f 70 65 72 61 74 69 6f | 6e 20 28 63 6f 6e 73 74 |operatio|n (const|
|00002ef0| 72 75 63 74 69 6f 6e 29 | 2e 0a 0a 20 20 20 20 35 |ruction)|... 5|
|00002f00| 2e 20 4e 6f 20 77 61 79 | 20 74 6f 20 63 6f 6e 76 |. No way| to conv|
|00002f10| 65 6e 69 65 6e 74 6c 79 | 20 22 75 73 65 22 20 61 |eniently| "use" a|
|00002f20| 6e 6f 74 68 65 72 20 61 | 62 73 74 72 61 63 74 69 |nother a|bstracti|
|00002f30| 6f 6e 20 77 69 74 68 6f | 75 74 0a 20 20 20 20 20 |on witho|ut. |
|00002f40| 20 20 69 6e 68 65 72 69 | 74 69 6e 67 20 66 72 6f | inheri|ting fro|
|00002f50| 6d 20 69 74 2e 0a 0a 20 | 20 20 20 36 2e 20 4e 6f |m it... | 6. No|
|00002f60| 20 73 74 72 6f 6e 67 20 | 64 69 73 74 69 6e 63 74 | strong |distinct|
|00002f70| 69 6f 6e 73 20 62 65 74 | 77 65 65 6e 20 69 6e 74 |ions bet|ween int|
|00002f80| 65 67 65 72 20 74 79 70 | 65 73 20 75 73 65 64 20 |eger typ|es used |
|00002f90| 66 6f 72 20 61 72 72 61 | 79 0a 20 20 20 20 20 20 |for arra|y. |
|00002fa0| 20 69 6e 64 65 78 69 6e | 67 2e 0a 0a 20 20 20 20 | indexin|g... |
|00002fb0| 37 2e 20 55 73 69 6e 67 | 20 74 68 65 20 73 61 6d |7. Using| the sam|
|00002fc0| 65 20 6f 70 65 72 61 74 | 6f 72 20 22 3a 3d 22 20 |e operat|or ":=" |
|00002fd0| 66 6f 72 20 62 6f 74 68 | 20 28 61 6c 69 61 73 69 |for both| (aliasi|
|00002fe0| 6e 67 29 20 70 6f 69 6e | 74 65 72 0a 20 20 20 20 |ng) poin|ter. |
|00002ff0| 20 20 20 61 73 73 69 67 | 6e 6d 65 6e 74 2c 20 61 | assig|nment, a|
|00003000| 6e 64 20 66 6f 72 20 76 | 61 6c 75 65 20 61 73 73 |nd for v|alue ass|
|00003010| 69 67 6e 6d 65 6e 74 2c | 20 64 65 70 65 6e 64 69 |ignment,| dependi|
|00003020| 6e 67 20 6f 6e 20 77 68 | 65 74 68 65 72 20 74 68 |ng on wh|ether th|
|00003030| 65 0a 20 20 20 20 20 20 | 20 74 79 70 65 20 69 73 |e. | type is|
|00003040| 20 22 65 78 70 61 6e 64 | 65 64 2e 22 20 28 53 69 | "expand|ed." (Si|
|00003050| 6d 75 6c 61 27 73 20 73 | 6f 6c 75 74 69 6f 6e 20 |mula's s|olution |
|00003060| 77 61 73 20 66 61 72 20 | 70 72 65 66 65 72 61 62 |was far |preferab|
|00003070| 6c 65 2c 20 49 4d 48 4f | 29 2e 0a 0a 20 20 20 20 |le, IMHO|)... |
|00003080| 41 6e 64 20 6d 6f 73 74 | 20 63 72 69 74 69 63 61 |And most| critica|
|00003090| 6c 6c 79 3a 0a 0a 0a 20 | 20 20 20 38 2e 20 4e 6f |lly:... | 8. No|
|000030a0| 20 73 65 70 61 72 61 74 | 65 20 69 6e 74 65 72 66 | separat|e interf|
|000030b0| 61 63 65 20 66 6f 72 20 | 61 6e 20 61 62 73 74 72 |ace for |an abstr|
|000030c0| 61 63 74 69 6f 6e 2e 20 | 59 6f 75 20 63 61 6e 20 |action. |You can |
|000030d0| 76 69 65 77 20 61 20 69 | 6e 74 65 72 66 61 63 65 |view a i|nterface|
|000030e0| 0a 20 20 20 20 20 20 20 | 62 79 20 72 75 6e 6e 69 |. |by runni|
|000030f0| 6e 67 20 61 20 74 6f 6f | 6c 2c 20 62 75 74 20 74 |ng a too|l, but t|
|00003100| 68 69 73 20 6d 69 73 73 | 65 73 20 63 6f 6d 70 6c |his miss|es compl|
|00003110| 65 74 65 6c 79 20 74 68 | 65 20 69 6d 70 6f 72 74 |etely th|e import|
|00003120| 61 6e 63 65 20 6f 66 0a | 20 20 20 20 20 20 20 68 |ance of.| h|
|00003130| 61 76 69 6e 67 20 61 20 | 70 68 79 73 69 63 61 6c |aving a |physical|
|00003140| 20 6d 6f 64 75 6c 65 20 | 74 68 61 74 20 72 65 70 | module |that rep|
|00003150| 72 65 73 65 6e 74 73 20 | 74 68 65 20 69 6e 74 65 |resents |the inte|
|00003160| 72 66 61 63 65 2c 20 61 | 6e 64 20 61 63 74 73 0a |rface, a|nd acts.|
|00003170| 20 20 20 20 20 20 20 61 | 73 20 61 20 63 6f 6e 74 | a|s a cont|
|00003180| 72 61 63 74 20 62 65 74 | 77 65 65 6e 20 74 68 65 |ract bet|ween the|
|00003190| 20 73 70 65 63 69 66 69 | 65 72 20 6f 72 20 75 73 | specifi|er or us|
|000031a0| 65 72 20 6f 66 20 61 6e | 20 61 62 73 74 72 61 63 |er of an| abstrac|
|000031b0| 74 69 6f 6e 20 61 6e 64 | 0a 20 20 20 20 20 20 20 |tion and|. |
|000031c0| 69 74 73 20 69 6d 70 6c | 65 6d 65 6e 74 6f 72 2e |its impl|ementor.|
|000031d0| 20 49 6e 20 45 69 66 66 | 65 6c 2c 20 6f 6e 65 20 | In Eiff|el, one |
|000031e0| 6d 69 67 68 74 20 6e 6f | 74 20 65 76 65 6e 20 62 |might no|t even b|
|000031f0| 65 20 74 72 75 6c 79 20 | 61 77 61 72 65 20 77 68 |e truly |aware wh|
|00003200| 65 6e 0a 20 20 20 20 20 | 20 20 6f 6e 65 20 69 73 |en. | one is|
|00003210| 20 63 68 61 6e 67 69 6e | 67 20 74 68 65 20 69 6e | changin|g the in|
|00003220| 74 65 72 66 61 63 65 20 | 74 6f 20 61 6e 20 61 62 |terface |to an ab|
|00003230| 73 74 72 61 63 74 69 6f | 6e 2c 20 62 65 63 61 75 |stractio|n, becau|
|00003240| 73 65 20 74 68 65 72 65 | 20 69 73 0a 20 20 20 20 |se there| is. |
|00003250| 20 20 20 6e 6f 20 70 61 | 72 74 69 63 75 6c 61 72 | no pa|rticular|
|00003260| 20 70 68 79 73 69 63 61 | 6c 20 73 65 70 61 72 61 | physica|l separa|
|00003270| 74 69 6f 6e 20 62 65 74 | 77 65 65 6e 20 69 6e 74 |tion bet|ween int|
|00003280| 65 72 66 61 63 65 20 61 | 6e 64 0a 20 20 20 20 20 |erface a|nd. |
|00003290| 20 20 69 6d 70 6c 65 6d | 65 6e 74 61 74 69 6f 6e | implem|entation|
|000032a0| 2e 0a 0a 0a 20 20 20 49 | 20 63 6f 6e 73 69 64 65 |.... I| conside|
|000032b0| 72 20 6d 61 6e 79 20 6f | 66 20 74 68 65 20 61 62 |r many o|f the ab|
|000032c0| 6f 76 65 20 70 72 6f 62 | 6c 65 6d 73 20 71 75 69 |ove prob|lems qui|
|000032d0| 74 65 20 73 65 72 69 6f | 75 73 2c 20 77 69 74 68 |te serio|us, with|
|000032e0| 20 73 6f 6d 65 20 6f 66 | 20 74 68 65 6d 0a 20 20 | some of| them. |
|000032f0| 20 62 65 69 6e 67 20 72 | 65 61 6c 20 74 68 72 6f | being r|eal thro|
|00003300| 77 62 61 63 6b 73 20 74 | 6f 20 74 68 65 20 6f 6c |wbacks t|o the ol|
|00003310| 64 20 73 74 79 6c 65 20 | 6f 66 20 70 72 6f 67 72 |d style |of progr|
|00003320| 61 6d 6d 69 6e 67 20 6c | 61 6e 67 75 61 67 65 73 |amming l|anguages|
|00003330| 20 77 68 65 72 65 0a 20 | 20 20 74 68 65 72 65 20 | where. | there |
|00003340| 77 65 72 65 20 6e 6f 20 | 77 65 6c 6c 20 64 65 66 |were no |well def|
|00003350| 69 6e 65 64 20 69 6e 74 | 65 72 66 61 63 65 73 20 |ined int|erfaces |
|00003360| 6f 72 20 6d 6f 64 75 6c | 65 73 2e 0a 0a 20 20 20 |or modul|es... |
|00003370| 48 65 6e 63 65 2c 20 49 | 20 63 72 69 6e 67 65 20 |Hence, I| cringe |
|00003380| 61 20 62 69 74 20 77 68 | 65 6e 20 70 65 6f 70 6c |a bit wh|en peopl|
|00003390| 65 20 73 61 79 20 74 68 | 61 74 20 45 69 66 66 65 |e say th|at Eiffe|
|000033a0| 6c 20 69 73 20 74 68 65 | 20 22 6d 6f 73 74 0a 20 |l is the| "most. |
|000033b0| 20 20 65 6c 65 67 61 6e | 74 22 20 4f 4f 50 20 61 | elegan|t" OOP a|
|000033c0| 6e 64 20 74 68 61 74 20 | 74 68 65 79 20 77 6f 75 |nd that |they wou|
|000033d0| 6c 64 20 75 73 65 20 69 | 74 20 69 66 20 6f 6e 6c |ld use i|t if onl|
|000033e0| 79 20 69 74 20 77 65 72 | 65 20 70 72 61 63 74 69 |y it wer|e practi|
|000033f0| 63 61 6c 20 74 6f 0a 20 | 20 20 64 6f 20 73 6f 2e |cal to. | do so.|
|00003400| 20 49 6e 20 6d 61 6e 79 | 20 77 61 79 73 2c 20 49 | In many| ways, I|
|00003410| 20 74 68 69 6e 6b 20 41 | 64 61 20 69 73 20 6d 75 | think A|da is mu|
|00003420| 63 68 20 62 65 74 74 65 | 72 20 68 75 6d 61 6e 2d |ch bette|r human-|
|00003430| 65 6e 67 69 6e 65 65 72 | 65 64 20 74 68 61 6e 0a |engineer|ed than.|
|00003440| 20 20 20 45 69 66 66 65 | 6c 2c 20 77 69 74 68 20 | Eiffe|l, with |
|00003450| 69 6d 70 6f 72 74 61 6e | 74 20 74 68 69 6e 67 73 |importan|t things|
|00003460| 20 6c 69 6b 65 20 72 61 | 6e 67 65 20 63 6f 6e 73 | like ra|nge cons|
|00003470| 74 72 61 69 6e 74 73 20 | 62 75 69 6c 74 20 69 6e |traints |built in|
|00003480| 74 6f 20 74 68 65 0a 20 | 20 20 6c 61 6e 67 75 61 |to the. | langua|
|00003490| 67 65 20 69 6e 20 61 20 | 77 61 79 20 74 68 61 74 |ge in a |way that|
|000034a0| 20 6d 61 6b 65 73 20 74 | 68 65 6d 20 63 6f 6e 76 | makes t|hem conv|
|000034b0| 65 6e 69 65 6e 74 20 74 | 6f 20 75 73 65 2e 20 41 |enient t|o use. A|
|000034c0| 6c 74 68 6f 75 67 68 20 | 67 65 6e 65 72 61 6c 0a |lthough |general.|
|000034d0| 20 20 20 61 73 73 65 72 | 74 69 6f 6e 73 20 61 72 | asser|tions ar|
|000034e0| 65 20 6e 69 63 65 2c 20 | 74 68 65 79 20 64 6f 6e |e nice, |they don|
|000034f0| 27 74 20 67 69 76 65 20 | 79 6f 75 20 74 68 65 20 |'t give |you the |
|00003500| 6b 69 6e 64 20 6f 66 20 | 6c 69 6e 65 2d 62 79 2d |kind of |line-by-|
|00003510| 6c 69 6e 65 0a 20 20 20 | 63 6f 6e 73 69 73 74 65 |line. |consiste|
|00003520| 6e 63 79 20 63 68 65 63 | 6b 73 20 74 68 61 74 20 |ncy chec|ks that |
|00003530| 41 64 61 20 63 61 6e 20 | 67 69 76 65 20 79 6f 75 |Ada can |give you|
|00003540| 2e 0a 0a 20 20 20 54 6f | 20 73 75 6d 6d 61 72 69 |... To| summari|
|00003550| 7a 65 20 2d 2d 0a 20 20 | 20 41 6c 74 68 6f 75 67 |ze --. | Althoug|
|00003560| 68 20 45 69 66 66 65 6c | 20 63 65 72 74 61 69 6e |h Eiffel| certain|
|00003570| 6c 79 20 68 61 73 20 61 | 20 6e 75 6d 62 65 72 20 |ly has a| number |
|00003580| 6f 66 20 6e 69 63 65 20 | 66 65 61 74 75 72 65 73 |of nice |features|
|00003590| 2c 20 49 20 64 6f 6e 27 | 74 0a 20 20 20 63 6f 6e |, I don'|t. con|
|000035a0| 73 69 64 65 72 20 69 74 | 20 72 65 61 64 79 20 66 |sider it| ready f|
|000035b0| 6f 72 20 70 72 69 6d 65 | 20 74 69 6d 65 20 61 73 |or prime| time as|
|000035c0| 20 66 61 72 20 61 73 20 | 62 75 69 6c 64 69 6e 67 | far as |building|
|000035d0| 20 61 6e 64 20 6d 61 69 | 6e 74 61 69 6e 69 6e 67 | and mai|ntaining|
|000035e0| 0a 20 20 20 6c 61 72 67 | 65 20 73 79 73 74 65 6d |. larg|e system|
|000035f0| 73 20 77 69 74 68 20 6c | 61 72 67 65 20 6e 75 6d |s with l|arge num|
|00003600| 62 65 72 73 20 6f 66 20 | 70 72 6f 67 72 61 6d 6d |bers of |programm|
|00003610| 65 72 73 2e 20 41 6e 64 | 20 66 72 6f 6d 20 61 20 |ers. And| from a |
|00003620| 68 75 6d 61 6e 0a 20 20 | 20 65 6e 67 69 6e 65 65 |human. | enginee|
|00003630| 72 69 6e 67 20 70 6f 69 | 6e 74 20 6f 66 20 76 69 |ring poi|nt of vi|
|00003640| 65 77 2c 20 49 20 74 68 | 69 6e 6b 20 41 64 61 20 |ew, I th|ink Ada |
|00003650| 69 73 20 73 69 67 6e 69 | 66 69 63 61 6e 74 6c 79 |is signi|ficantly|
|00003660| 20 62 65 74 74 65 72 2e | 0a 0a 0a 39 2e 35 3a 20 | better.|...9.5: |
|00003670| 41 72 65 20 74 68 65 72 | 65 20 61 6e 79 20 70 61 |Are ther|e any pa|
|00003680| 70 65 72 73 20 64 65 74 | 61 69 6c 69 6e 67 20 74 |pers det|ailing t|
|00003690| 68 65 20 64 69 66 66 65 | 72 65 6e 63 65 73 20 62 |he diffe|rences b|
|000036a0| 65 74 77 65 65 6e 20 41 | 64 61 20 61 6e 64 20 43 |etween A|da and C|
|000036b0| 2b 2b 3f 0a 0a 20 20 20 | 42 65 6c 6f 77 20 61 72 |++?.. |Below ar|
|000036c0| 65 20 74 77 6f 20 72 65 | 66 65 72 65 6e 63 65 73 |e two re|ferences|
|000036d0| 2e 20 42 65 61 72 20 69 | 6e 20 6d 69 6e 64 20 74 |. Bear i|n mind t|
|000036e0| 68 61 74 20 69 74 20 69 | 73 20 64 69 66 66 69 63 |hat it i|s diffic|
|000036f0| 75 6c 74 20 74 6f 20 6d | 61 6b 65 0a 20 20 20 73 |ult to m|ake. s|
|00003700| 75 63 68 20 61 20 63 6f | 6d 70 61 72 69 73 6f 6e |uch a co|mparison|
|00003710| 20 77 69 74 68 6f 75 74 | 20 65 78 70 6f 73 69 6e | without| exposin|
|00003720| 67 20 62 69 61 73 65 73 | 2e 20 48 6f 77 65 76 65 |g biases|. Howeve|
|00003730| 72 2c 20 74 68 65 20 74 | 77 6f 20 70 61 70 65 72 |r, the t|wo paper|
|00003740| 73 0a 20 20 20 62 65 6c | 6f 77 20 61 72 65 20 77 |s. bel|ow are w|
|00003750| 65 6c 6c 20 77 6f 72 74 | 68 20 72 65 61 64 69 6e |ell wort|h readin|
|00003760| 67 2e 0a 0a 20 20 20 22 | 41 20 43 6f 6d 70 61 72 |g... "|A Compar|
|00003770| 69 73 6f 6e 20 6f 66 20 | 74 68 65 20 4f 4f 20 66 |ison of |the OO f|
|00003780| 65 61 74 75 72 65 73 20 | 6f 66 20 41 64 61 39 78 |eatures |of Ada9x|
|00003790| 20 61 6e 64 20 43 2b 2b | 22 20 69 6e 20 53 70 72 | and C++|" in Spr|
|000037a0| 69 6e 67 65 72 20 4c 65 | 63 74 75 72 65 0a 20 20 |inger Le|cture. |
|000037b0| 20 4e 6f 74 65 73 20 69 | 6e 20 43 53 3a 20 22 41 | Notes i|n CS: "A|
|000037c0| 64 61 20 45 75 72 6f 70 | 65 20 39 33 22 20 70 70 |da Europ|e 93" pp|
|000037d0| 2e 31 32 35 2d 31 34 31 | 20 28 73 68 6f 72 74 20 |.125-141| (short |
|000037e0| 70 61 70 65 72 2c 20 67 | 6f 6f 64 20 72 65 61 64 |paper, g|ood read|
|000037f0| 69 6e 67 2c 0a 20 20 20 | 65 6e 6c 69 67 68 74 65 |ing,. |enlighte|
|00003800| 6e 73 20 69 64 69 6f 6d | 73 29 0a 0a 20 20 20 66 |ns idiom|s).. f|
|00003810| 74 70 20 61 6a 70 6f 2e | 73 65 69 2e 63 6d 75 2e |tp ajpo.|sei.cmu.|
|00003820| 65 64 75 20 69 6e 20 64 | 69 72 65 63 74 6f 72 79 |edu in d|irectory|
|00003830| 3a 20 2f 70 75 62 6c 69 | 63 2f 61 64 61 39 78 2c |: /publi|c/ada9x,|
|00003840| 20 64 6f 63 75 6d 65 6e | 74 3a 0a 20 20 20 39 78 | documen|t:. 9x|
|00003850| 5f 63 70 6c 75 73 2e 68 | 6c 70 0a 0a 0a 39 2e 36 |_cplus.h|lp...9.6|
|00003860| 3a 20 49 20 6b 65 65 70 | 20 68 65 61 72 69 6e 67 |: I keep| hearing|
|00003870| 20 74 68 61 74 20 41 64 | 61 20 69 73 20 61 20 22 | that Ad|a is a "|
|00003880| 73 74 72 6f 6e 67 6c 79 | 20 74 79 70 65 64 20 6c |strongly| typed l|
|00003890| 61 6e 67 75 61 67 65 22 | 2c 20 62 75 74 20 69 74 |anguage"|, but it|
|000038a0| 20 73 65 65 6d 73 0a 64 | 69 66 66 65 72 65 6e 74 | seems.d|ifferent|
|000038b0| 20 66 72 6f 6d 20 77 68 | 61 74 27 73 20 6d 65 61 | from wh|at's mea|
|000038c0| 6e 74 20 69 6e 20 43 2b | 2b 2e 20 41 72 65 20 74 |nt in C+|+. Are t|
|000038d0| 68 65 79 20 64 69 66 66 | 65 72 65 6e 74 3f 0a 0a |hey diff|erent?..|
|000038e0| 20 20 20 28 54 75 63 6b | 65 72 20 54 61 66 74 20 | (Tuck|er Taft |
|000038f0| 72 65 73 70 6f 6e 64 73 | 29 0a 0a 20 20 20 49 20 |responds|).. I |
|00003900| 63 65 72 74 61 69 6e 6c | 79 20 61 67 72 65 65 20 |certainl|y agree |
|00003910| 74 68 61 74 20 41 4e 53 | 49 20 43 20 61 6e 64 20 |that ANS|I C and |
|00003920| 43 2b 2b 20 61 72 65 20 | 73 74 61 74 69 63 61 6c |C++ are |statical|
|00003930| 6c 79 20 74 79 70 65 64 | 20 6c 61 6e 67 75 61 67 |ly typed| languag|
|00003940| 65 73 2c 0a 20 20 20 62 | 75 74 20 49 20 77 6f 75 |es,. b|ut I wou|
|00003950| 6c 64 20 64 65 62 61 74 | 65 20 74 68 65 20 22 73 |ld debat|e the "s|
|00003960| 74 72 65 6e 67 74 68 22 | 20 6f 66 20 74 68 65 69 |trength"| of thei|
|00003970| 72 20 74 79 70 69 6e 67 | 2e 0a 0a 20 20 20 45 73 |r typing|... Es|
|00003980| 73 65 6e 74 69 61 6c 6c | 79 20 61 6e 79 20 73 75 |sentiall|y any su|
|00003990| 70 70 6f 72 74 20 66 6f | 72 20 69 6d 70 6c 69 63 |pport fo|r implic|
|000039a0| 69 74 20 63 6f 6e 76 65 | 72 73 69 6f 6e 20 28 69 |it conve|rsion (i|
|000039b0| 6d 70 6c 69 63 69 74 20 | 22 63 61 73 74 69 6e 67 |mplicit |"casting|
|000039c0| 2c 22 0a 20 20 20 22 70 | 72 6f 6d 6f 74 69 6f 6e |,". "p|romotion|
|000039d0| 22 2c 20 22 75 73 75 61 | 6c 22 20 61 72 69 74 68 |", "usua|l" arith|
|000039e0| 6d 65 74 69 63 20 63 6f | 6e 76 65 72 73 69 6f 6e |metic co|nversion|
|000039f0| 73 2c 20 65 74 63 2e 29 | 20 22 77 65 61 6b 65 6e |s, etc.)| "weaken|
|00003a00| 73 22 20 61 20 74 79 70 | 65 0a 20 20 20 73 79 73 |s" a typ|e. sys|
|00003a10| 74 65 6d 20 28 62 75 74 | 20 61 6c 73 6f 20 6d 61 |tem (but| also ma|
|00003a20| 6b 65 73 20 69 74 20 22 | 66 72 69 65 6e 64 6c 69 |kes it "|friendli|
|00003a30| 65 72 22 20 69 6e 20 73 | 6f 6d 65 20 77 61 79 73 |er" in s|ome ways|
|00003a40| 29 2e 0a 0a 20 20 20 43 | 20 61 6c 6c 6f 77 73 20 |)... C| allows |
|00003a50| 69 6d 70 6c 69 63 69 74 | 20 63 6f 6e 76 65 72 73 |implicit| convers|
|00003a60| 69 6f 6e 20 62 65 74 77 | 65 65 6e 20 61 6c 6c 20 |ion betw|een all |
|00003a70| 69 6e 74 65 67 65 72 20 | 74 79 70 65 73 20 61 6e |integer |types an|
|00003a80| 64 20 61 6c 6c 0a 20 20 | 20 65 6e 75 6d 65 72 61 |d all. | enumera|
|00003a90| 74 69 6f 6e 20 74 79 70 | 65 73 2e 20 43 2b 2b 20 |tion typ|es. C++ |
|00003aa0| 61 74 20 6c 65 61 73 74 | 20 63 75 74 73 20 6f 66 |at least| cuts of|
|00003ab0| 66 20 69 6d 70 6c 69 63 | 69 74 20 63 6f 6e 76 65 |f implic|it conve|
|00003ac0| 72 73 69 6f 6e 20 74 6f | 0a 20 20 20 65 6e 75 6d |rsion to|. enum|
|00003ad0| 65 72 61 74 69 6f 6e 20 | 74 79 70 65 73 2c 20 62 |eration |types, b|
|00003ae0| 75 74 20 72 65 74 61 69 | 6e 73 20 69 6d 70 6c 69 |ut retai|ns impli|
|00003af0| 63 69 74 20 63 6f 6e 76 | 65 72 73 69 6f 6e 20 61 |cit conv|ersion a|
|00003b00| 6d 6f 6e 67 20 61 6c 6c | 20 69 6e 74 65 67 65 72 |mong all| integer|
|00003b10| 0a 20 20 20 28 61 6e 64 | 20 66 6c 6f 61 74 69 6e |. (and| floatin|
|00003b20| 67 2d 70 6f 69 6e 74 29 | 20 74 79 70 65 73 2e 20 |g-point)| types. |
|00003b30| 41 6c 73 6f 2c 20 69 6e | 20 62 6f 74 68 20 43 20 |Also, in| both C |
|00003b40| 61 6e 64 20 43 2b 2b 2c | 20 74 79 70 65 64 65 66 |and C++,| typedef|
|00003b50| 73 20 66 6f 72 0a 20 20 | 20 70 6f 69 6e 74 65 72 |s for. | pointer|
|00003b60| 2f 61 72 72 61 79 20 74 | 79 70 65 73 20 61 72 65 |/array t|ypes are|
|00003b70| 20 65 73 73 65 6e 74 69 | 61 6c 6c 79 20 22 6d 61 | essenti|ally "ma|
|00003b80| 63 72 6f 73 22 3b 20 61 | 6c 6c 20 70 6f 69 6e 74 |cros"; a|ll point|
|00003b90| 65 72 20 74 79 70 65 73 | 20 77 69 74 68 0a 20 20 |er types| with. |
|00003ba0| 20 74 68 65 20 73 61 6d | 65 20 74 61 72 67 65 74 | the sam|e target|
|00003bb0| 20 74 79 70 65 20 61 72 | 65 20 69 6d 70 6c 69 63 | type ar|e implic|
|00003bc0| 69 74 6c 79 20 69 6e 74 | 65 72 63 6f 6e 76 65 72 |itly int|erconver|
|00003bd0| 74 69 62 6c 65 2e 0a 0a | 20 20 20 46 69 6e 61 6c |tible...| Final|
|00003be0| 6c 79 20 43 2b 2b 20 61 | 6c 6c 6f 77 73 20 74 68 |ly C++ a|llows th|
|00003bf0| 65 20 75 73 65 72 20 74 | 6f 20 64 65 66 69 6e 65 |e user t|o define|
|00003c00| 20 61 20 6e 75 6d 62 65 | 72 20 6f 66 20 74 68 65 | a numbe|r of the|
|00003c10| 69 72 20 6f 77 6e 20 69 | 6d 70 6c 69 63 69 74 0a |ir own i|mplicit.|
|00003c20| 20 20 20 63 6f 6e 76 65 | 72 73 69 6f 6e 20 6f 70 | conve|rsion op|
|00003c30| 65 72 61 74 6f 72 73 2c | 20 77 68 69 63 68 20 62 |erators,| which b|
|00003c40| 61 73 69 63 61 6c 6c 79 | 20 61 6c 6c 6f 77 73 20 |asically| allows |
|00003c50| 74 68 65 20 75 73 65 72 | 20 74 6f 20 22 77 65 61 |the user| to "wea|
|00003c60| 6b 65 6e 22 20 74 68 65 | 0a 20 20 20 74 79 70 65 |ken" the|. type|
|00003c70| 20 73 79 73 74 65 6d 20 | 61 73 20 74 68 65 79 20 | system |as they |
|00003c80| 73 65 65 20 66 69 74 2e | 0a 0a 20 20 20 4f 66 20 |see fit.|.. Of |
|00003c90| 63 6f 75 72 73 65 2c 20 | 61 6c 6c 20 6f 66 20 74 |course, |all of t|
|00003ca0| 68 69 73 20 69 6d 70 6c | 69 63 69 74 20 63 6f 6e |his impl|icit con|
|00003cb0| 76 65 72 73 69 6f 6e 20 | 73 65 72 76 65 73 20 61 |version |serves a|
|00003cc0| 20 70 75 72 70 6f 73 65 | 2c 20 62 75 74 20 69 74 | purpose|, but it|
|00003cd0| 0a 20 20 20 64 6f 65 73 | 20 74 65 6e 64 20 74 6f |. does| tend to|
|00003ce0| 20 6d 6f 76 65 20 43 2f | 43 2b 2b 20 74 6f 77 61 | move C/|C++ towa|
|00003cf0| 72 64 20 74 68 65 20 22 | 77 65 61 6b 65 72 22 20 |rd the "|weaker" |
|00003d00| 65 6e 64 20 6f 66 20 74 | 68 65 20 77 65 61 6b 20 |end of t|he weak |
|00003d10| 76 73 2e 20 73 74 72 6f | 6e 67 0a 20 20 20 74 79 |vs. stro|ng. ty|
|00003d20| 70 69 6e 67 20 73 70 65 | 63 74 72 75 6d 2e 0a 0a |ping spe|ctrum...|
|00003d30| 20 20 20 4e 6f 74 65 20 | 74 68 61 74 20 74 68 65 | Note |that the|
|00003d40| 20 22 73 74 72 6f 6e 67 | 22 20 64 69 73 74 69 6e | "strong|" distin|
|00003d50| 63 74 69 6f 6e 73 20 62 | 65 74 77 65 65 6e 20 69 |ctions b|etween i|
|00003d60| 6e 74 65 67 65 72 20 74 | 79 70 65 73 20 68 65 6c |nteger t|ypes hel|
|00003d70| 70 73 0a 20 20 20 64 72 | 61 6d 61 74 69 63 61 6c |ps. dr|amatical|
|00003d80| 6c 79 20 69 6e 20 63 61 | 74 63 68 69 6e 67 20 28 |ly in ca|tching (|
|00003d90| 61 74 20 63 6f 6d 70 69 | 6c 65 2d 74 69 6d 65 29 |at compi|le-time)|
|00003da0| 20 61 72 72 61 79 20 69 | 6e 64 65 78 69 6e 67 20 | array i|ndexing |
|00003db0| 65 72 72 6f 72 73 20 69 | 6e 0a 20 20 20 41 64 61 |errors i|n. Ada|
|00003dc0| 20 70 72 6f 67 72 61 6d | 73 2c 20 62 79 20 6d 61 | program|s, by ma|
|00003dd0| 6b 69 6e 67 20 73 75 72 | 65 20 74 68 61 74 20 69 |king sur|e that i|
|00003de0| 66 20 79 6f 75 20 68 61 | 76 65 20 61 6e 20 61 72 |f you ha|ve an ar|
|00003df0| 72 61 79 20 69 6e 64 65 | 78 65 64 20 62 79 20 61 |ray inde|xed by a|
|00003e00| 0a 20 20 20 63 6f 75 6e | 74 20 6f 66 20 61 70 70 |. coun|t of app|
|00003e10| 6c 65 73 2c 20 79 6f 75 | 20 64 6f 6e 27 74 20 69 |les, you| don't i|
|00003e20| 6e 64 65 78 20 69 6e 74 | 6f 20 69 74 20 77 69 74 |ndex int|o it wit|
|00003e30| 68 20 61 20 63 6f 75 6e | 74 20 6f 66 20 6f 72 61 |h a coun|t of ora|
|00003e40| 6e 67 65 73 0a 20 20 20 | 28 77 69 74 68 6f 75 74 |nges. |(without|
|00003e50| 20 61 6e 20 2a 65 78 70 | 6c 69 63 69 74 2a 20 63 | an *exp|licit* c|
|00003e60| 6f 6e 76 65 72 73 69 6f | 6e 29 2e 20 54 68 65 20 |onversio|n). The |
|00003e70| 61 64 76 61 6e 74 61 67 | 65 73 20 6f 66 20 22 73 |advantag|es of "s|
|00003e80| 74 72 6f 6e 67 6c 79 22 | 0a 20 20 20 64 69 73 74 |trongly"|. dist|
|00003e90| 69 6e 67 75 69 73 68 69 | 6e 67 20 65 6e 75 6d 65 |inguishi|ng enume|
|00003ea0| 72 61 74 69 6f 6e 20 74 | 79 70 65 73 20 69 73 20 |ration t|ypes is |
|00003eb0| 65 76 65 6e 20 6d 6f 72 | 65 20 6f 62 76 69 6f 75 |even mor|e obviou|
|00003ec0| 73 20 28 61 6e 64 20 74 | 68 65 0a 20 20 20 64 65 |s (and t|he. de|
|00003ed0| 73 69 67 6e 65 72 73 20 | 6f 66 20 43 2b 2b 20 72 |signers |of C++ r|
|00003ee0| 65 63 6f 67 6e 69 7a 65 | 64 20 74 68 69 73 29 2e |ecognize|d this).|
|00003ef0| 0a 0a 20 20 20 54 68 65 | 20 73 74 72 6f 6e 67 20 |.. The| strong |
|00003f00| 64 69 73 74 69 6e 63 74 | 69 6f 6e 73 20 62 65 74 |distinct|ions bet|
|00003f10| 77 65 65 6e 20 61 63 63 | 65 73 73 20 74 79 70 65 |ween acc|ess type|
|00003f20| 73 20 28 70 6f 69 6e 74 | 65 72 20 74 79 70 65 73 |s (point|er types|
|00003f30| 29 20 69 6e 20 41 64 61 | 0a 20 20 20 61 6c 73 6f |) in Ada|. also|
|00003f40| 20 68 61 73 20 61 64 76 | 61 6e 74 61 67 65 73 2c | has adv|antages,|
|00003f50| 20 61 6c 6c 6f 77 69 6e | 67 20 61 63 63 65 73 73 | allowin|g access|
|00003f60| 20 74 79 70 65 73 20 74 | 6f 20 62 65 20 72 65 70 | types t|o be rep|
|00003f70| 72 65 73 65 6e 74 65 64 | 20 61 73 0a 20 20 20 6f |resented| as. o|
|00003f80| 66 66 73 65 74 73 20 77 | 69 74 68 69 6e 20 74 68 |ffsets w|ithin th|
|00003f90| 65 69 72 20 73 74 6f 72 | 61 67 65 20 70 6f 6f 6c |eir stor|age pool|
|00003fa0| 20 72 61 74 68 65 72 20 | 74 68 61 6e 20 61 73 20 | rather |than as |
|00003fb0| 61 64 64 72 65 73 73 65 | 73 2c 20 61 6e 64 20 67 |addresse|s, and g|
|00003fc0| 69 76 69 6e 67 0a 20 20 | 20 6d 6f 72 65 20 68 69 |iving. | more hi|
|00003fd0| 67 68 2d 6c 65 76 65 6c | 20 63 6f 6e 74 72 6f 6c |gh-level| control|
|00003fe0| 20 6f 76 65 72 20 73 74 | 6f 72 61 67 65 20 6d 61 | over st|orage ma|
|00003ff0| 6e 61 67 65 6d 65 6e 74 | 2e 0a 0a 20 20 20 53 74 |nagement|... St|
|00004000| 72 6f 6e 67 20 74 79 70 | 69 6e 67 20 63 61 6e 20 |rong typ|ing can |
|00004010| 62 65 20 63 61 72 72 69 | 65 64 20 74 6f 6f 20 66 |be carri|ed too f|
|00004020| 61 72 2c 20 61 6e 64 20 | 73 6f 6d 65 20 61 6d 6f |ar, and |some amo|
|00004030| 75 6e 74 20 6f 66 20 69 | 6d 70 6c 69 63 69 74 0a |unt of i|mplicit.|
|00004040| 20 20 20 63 6f 6e 76 65 | 72 73 69 6f 6e 20 69 73 | conve|rsion is|
|00004050| 20 65 73 73 65 6e 74 69 | 61 6c 20 74 6f 20 6d 61 | essenti|al to ma|
|00004060| 6b 65 20 4f 4f 50 20 70 | 61 6c 61 74 61 62 6c 65 |ke OOP p|alatable|
|00004070| 2e 20 42 75 74 20 6e 6f | 74 65 20 74 68 61 74 20 |. But no|te that |
|00004080| 69 6e 20 41 64 61 0a 20 | 20 20 39 58 2c 20 65 76 |in Ada. | 9X, ev|
|00004090| 65 6e 20 77 69 74 68 20 | 4f 4f 50 2c 20 77 65 20 |en with |OOP, we |
|000040a0| 64 6f 6e 27 74 20 61 6c | 6c 6f 77 20 69 6d 70 6c |don't al|low impl|
|000040b0| 69 63 69 74 20 63 6f 6e | 76 65 72 73 69 6f 6e 73 |icit con|versions|
|000040c0| 20 74 68 61 74 20 74 72 | 75 6e 63 61 74 65 0a 20 | that tr|uncate. |
|000040d0| 20 20 74 68 65 20 65 78 | 74 65 6e 73 69 6f 6e 20 | the ex|tension |
|000040e0| 70 61 72 74 20 6f 66 20 | 61 20 72 65 63 6f 72 64 |part of |a record|
|000040f0| 20 28 74 68 69 73 20 69 | 73 20 61 20 72 65 6c 61 | (this i|s a rela|
|00004100| 74 69 76 65 6c 79 20 63 | 6f 6d 6d 6f 6e 20 6d 69 |tively c|ommon mi|
|00004110| 73 74 61 6b 65 20 69 6e | 0a 20 20 20 43 2b 2b 20 |stake in|. C++ |
|00004120| 77 68 65 6e 20 70 61 73 | 73 69 6e 67 20 70 61 72 |when pas|sing par|
|00004130| 61 6d 65 74 65 72 73 20 | 62 79 20 76 61 6c 75 65 |ameters |by value|
|00004140| 29 2e 20 49 6e 73 74 65 | 61 64 2c 20 69 6e 20 41 |). Inste|ad, in A|
|00004150| 64 61 20 39 58 2c 20 74 | 68 65 0a 20 20 20 6c 61 |da 9X, t|he. la|
|00004160| 6e 67 75 61 67 65 20 64 | 69 73 74 69 6e 67 75 69 |nguage d|istingui|
|00004170| 73 68 65 73 20 62 65 74 | 77 65 65 6e 20 61 20 73 |shes bet|ween a s|
|00004180| 70 65 63 69 66 69 63 20 | 74 79 70 65 20 54 20 61 |pecific |type T a|
|00004190| 6e 64 20 74 68 65 20 63 | 6c 61 73 73 2d 77 69 64 |nd the c|lass-wid|
|000041a0| 65 0a 20 20 20 74 79 70 | 65 20 54 27 43 6c 61 73 |e. typ|e T'Clas|
|000041b0| 73 2c 20 61 6e 64 20 61 | 6c 6c 6f 77 73 20 69 6d |s, and a|llows im|
|000041c0| 70 6c 69 63 69 74 20 63 | 6f 6e 76 65 72 73 69 6f |plicit c|onversio|
|000041d0| 6e 73 20 74 6f 20 54 27 | 43 6c 61 73 73 20 66 72 |ns to T'|Class fr|
|000041e0| 6f 6d 20 54 20 6f 72 20 | 61 6e 79 0a 20 20 20 6f |om T or |any. o|
|000041f0| 66 20 69 74 73 20 64 65 | 72 69 76 61 74 69 76 65 |f its de|rivative|
|00004200| 73 2c 20 62 75 74 20 6e | 6f 74 20 74 6f 20 74 68 |s, but n|ot to th|
|00004210| 65 20 73 70 65 63 69 66 | 69 63 20 74 79 70 65 20 |e specif|ic type |
|00004220| 54 2e 20 43 6f 6e 76 65 | 72 73 69 6f 6e 73 20 74 |T. Conve|rsions t|
|00004230| 6f 20 74 68 65 0a 20 20 | 20 63 6c 61 73 73 2d 77 |o the. | class-w|
|00004240| 69 64 65 20 74 79 70 65 | 20 6e 65 76 65 72 20 69 |ide type| never i|
|00004250| 6d 70 6c 69 63 69 74 6c | 79 20 74 72 75 6e 63 61 |mplicitl|y trunca|
|00004260| 74 65 20 74 68 65 20 65 | 78 74 65 6e 73 69 6f 6e |te the e|xtension|
|00004270| 20 70 61 72 74 2e 0a 20 | 20 20 43 6f 6e 76 65 72 | part.. | Conver|
|00004280| 73 69 6f 6e 73 20 74 6f | 20 61 20 73 70 65 63 69 |sions to| a speci|
|00004290| 66 69 63 20 74 79 70 65 | 20 63 61 6e 20 74 72 75 |fic type| can tru|
|000042a0| 6e 63 61 74 65 2c 20 61 | 6e 64 20 68 65 6e 63 65 |ncate, a|nd hence|
|000042b0| 20 6d 75 73 74 20 62 65 | 0a 20 20 20 65 78 70 6c | must be|. expl|
|000042c0| 69 63 69 74 2e 0a 0a 20 | 20 20 4e 6f 74 65 20 61 |icit... | Note a|
|000042d0| 6c 73 6f 20 74 68 61 74 | 20 69 6e 20 41 64 61 20 |lso that| in Ada |
|000042e0| 74 68 65 72 65 20 61 72 | 65 20 74 68 72 65 65 20 |there ar|e three |
|000042f0| 64 69 73 74 69 6e 63 74 | 20 6b 69 6e 64 73 20 6f |distinct| kinds o|
|00004300| 66 20 63 6f 6e 76 65 72 | 73 69 6f 6e 73 2c 0a 20 |f conver|sions,. |
|00004310| 20 20 69 6d 70 6c 69 63 | 69 74 20 6f 6e 65 73 2c | implic|it ones,|
|00004320| 20 65 78 70 6c 69 63 69 | 74 20 6f 6e 65 73 2c 20 | explici|t ones, |
|00004330| 61 6e 64 20 75 6e 63 68 | 65 63 6b 65 64 20 6f 6e |and unch|ecked on|
|00004340| 65 73 2e 20 4f 6e 6c 79 | 20 74 68 65 20 75 6e 63 |es. Only| the unc|
|00004350| 68 65 63 6b 65 64 0a 20 | 20 20 6f 6e 65 73 20 61 |hecked. | ones a|
|00004360| 72 65 20 70 6f 74 65 6e | 74 69 61 6c 6c 79 20 75 |re poten|tially u|
|00004370| 6e 73 61 66 65 2e 20 54 | 68 65 20 65 78 70 6c 69 |nsafe. T|he expli|
|00004380| 63 69 74 20 6f 6e 65 73 | 20 61 72 65 20 73 61 66 |cit ones| are saf|
|00004390| 65 2c 20 77 69 74 68 20 | 65 69 74 68 65 72 0a 20 |e, with |either. |
|000043a0| 20 20 63 6f 6d 70 69 6c | 65 2d 74 69 6d 65 20 6f | compil|e-time o|
|000043b0| 72 20 72 75 6e 2d 74 69 | 6d 65 20 63 68 65 63 6b |r run-ti|me check|
|000043c0| 73 20 74 6f 20 65 6e 73 | 75 72 65 20 74 68 61 74 |s to ens|ure that|
|000043d0| 2e 20 49 6e 20 43 20 74 | 68 65 72 65 20 61 72 65 |. In C t|here are|
|000043e0| 20 6f 6e 6c 79 0a 20 20 | 20 69 6d 70 6c 69 63 69 | only. | implici|
|000043f0| 74 20 61 6e 64 20 65 78 | 70 6c 69 63 69 74 2f 75 |t and ex|plicit/u|
|00004400| 6e 63 68 65 63 6b 65 64 | 20 63 6f 6e 76 65 72 73 |nchecked| convers|
|00004410| 69 6f 6e 73 2e 20 43 2b | 2b 20 68 61 73 20 72 65 |ions. C+|+ has re|
|00004420| 63 65 6e 74 6c 79 20 61 | 64 64 65 64 20 61 0a 20 |cently a|dded a. |
|00004430| 20 20 63 68 65 63 6b 65 | 64 2c 20 65 78 70 6c 69 | checke|d, expli|
|00004440| 63 69 74 20 22 64 79 6e | 61 6d 69 63 22 20 63 61 |cit "dyn|amic" ca|
|00004450| 73 74 2c 20 62 75 74 20 | 73 74 69 6c 6c 20 69 74 |st, but |still it|
|00004460| 20 77 69 6c 6c 20 62 65 | 20 63 6f 6d 6d 6f 6e 20 | will be| common |
|00004470| 74 6f 20 75 73 65 0a 20 | 20 20 22 6e 6f 72 6d 61 |to use. | "norma|
|00004480| 6c 22 20 65 78 70 6c 69 | 63 69 74 20 63 61 73 74 |l" expli|cit cast|
|00004490| 73 20 66 6f 72 20 62 6f | 74 68 20 63 68 65 63 6b |s for bo|th check|
|000044a0| 65 64 20 61 6e 64 20 75 | 6e 63 68 65 63 6b 65 64 |ed and u|nchecked|
|000044b0| 20 63 6f 6e 76 65 72 73 | 69 6f 6e 73 2c 0a 20 20 | convers|ions,. |
|000044c0| 20 74 68 65 72 65 62 79 | 20 6d 61 6b 69 6e 67 20 | thereby| making |
|000044d0| 69 74 20 6d 6f 72 65 20 | 64 69 66 66 69 63 75 6c |it more |difficul|
|000044e0| 74 20 74 6f 20 69 64 65 | 6e 74 69 66 79 20 70 6c |t to ide|ntify pl|
|000044f0| 61 63 65 73 20 77 68 65 | 72 65 20 74 68 65 20 74 |aces whe|re the t|
|00004500| 79 70 65 0a 20 20 20 73 | 79 73 74 65 6d 20 6d 69 |ype. s|ystem mi|
|00004510| 67 68 74 20 62 65 20 63 | 6f 6d 70 72 6f 6d 69 73 |ght be c|ompromis|
|00004520| 65 64 2e 0a 0a 20 20 20 | 48 65 6e 63 65 2c 20 74 |ed... |Hence, t|
|00004530| 68 65 20 62 6f 74 74 6f | 6d 20 6c 69 6e 65 20 69 |he botto|m line i|
|00004540| 73 20 74 68 61 74 20 74 | 68 65 20 74 79 70 65 20 |s that t|he type |
|00004550| 63 68 65 63 6b 69 6e 67 | 20 69 73 20 28 6f 62 6a |checking| is (obj|
|00004560| 65 63 74 69 76 65 6c 79 | 29 0a 20 20 20 22 73 74 |ectively|). "st|
|00004570| 72 6f 6e 67 65 72 22 20 | 69 6e 20 41 64 61 20 74 |ronger" |in Ada t|
|00004580| 68 61 6e 20 43 2f 43 2b | 2b 2c 20 74 68 6f 75 67 |han C/C+|+, thoug|
|00004590| 68 20 74 68 61 74 20 64 | 6f 65 73 6e 27 74 20 6e |h that d|oesn't n|
|000045a0| 65 63 65 73 73 61 72 69 | 6c 79 20 6d 65 61 6e 0a |ecessari|ly mean.|
|000045b0| 20 20 20 22 62 65 74 74 | 65 72 22 20 2d 2d 20 77 | "bett|er" -- w|
|000045c0| 68 65 74 68 65 72 20 6f | 6e 65 20 69 73 20 22 62 |hether o|ne is "b|
|000045d0| 65 74 74 65 72 22 20 66 | 6f 72 20 61 20 70 61 72 |etter" f|or a par|
|000045e0| 74 69 63 75 6c 61 72 20 | 73 74 79 6c 65 20 6f 66 |ticular |style of|
|000045f0| 0a 20 20 20 70 72 6f 67 | 72 61 6d 6d 69 6e 67 20 |. prog|ramming |
|00004600| 74 68 61 6e 20 74 68 65 | 20 6f 74 68 65 72 20 69 |than the| other i|
|00004610| 73 20 61 20 22 72 65 6c | 69 67 69 6f 75 73 22 20 |s a "rel|igious" |
|00004620| 69 73 73 75 65 20 49 4d | 48 4f 2e 20 49 20 6b 6e |issue IM|HO. I kn|
|00004630| 6f 77 20 6d 79 0a 20 20 | 20 72 65 6c 69 67 69 6f |ow my. | religio|
|00004640| 6e 20 63 75 72 72 65 6e | 74 6c 79 20 66 61 76 6f |n curren|tly favo|
|00004650| 72 73 20 74 68 65 20 73 | 74 72 6f 6e 67 65 72 20 |rs the s|tronger |
|00004660| 63 68 65 63 6b 69 6e 67 | 20 6f 66 20 41 64 61 20 |checking| of Ada |
|00004670| 69 6e 20 6d 6f 73 74 20 | 63 61 73 65 73 0a 20 20 |in most |cases. |
|00004680| 20 5b 65 78 63 65 70 74 | 20 70 65 72 68 61 70 73 | [except| perhaps|
|00004690| 20 66 6f 72 20 6d 75 6c | 74 69 70 6c 79 2f 64 69 | for mul|tiply/di|
|000046a0| 76 69 64 65 2c 20 77 68 | 65 72 65 20 49 20 70 65 |vide, wh|ere I pe|
|000046b0| 72 73 6f 6e 61 6c 6c 79 | 20 62 65 6c 69 65 76 65 |rsonally| believe|
|000046c0| 20 74 68 65 0a 20 20 20 | 63 68 65 63 6b 69 6e 67 | the. |checking|
|000046d0| 20 73 68 6f 75 6c 64 20 | 65 69 74 68 65 72 20 62 | should |either b|
|000046e0| 65 20 77 65 61 6b 65 72 | 2c 20 6f 72 20 64 69 72 |e weaker|, or dir|
|000046f0| 65 63 74 6c 79 20 73 75 | 70 70 6f 72 74 20 74 68 |ectly su|pport th|
|00004700| 65 20 63 6f 6e 63 65 70 | 74 20 6f 66 0a 20 20 20 |e concep|t of. |
|00004710| 22 75 6e 69 74 73 22 2f | 22 64 69 6d 65 6e 73 69 |"units"/|"dimensi|
|00004720| 6f 6e 73 22 5d 2e 0a 0a | 0a 39 2e 37 3a 20 49 27 |ons"]...|.9.7: I'|
|00004730| 6d 20 74 6f 6c 64 20 41 | 64 61 20 64 6f 65 73 20 |m told A|da does |
|00004740| 61 6c 6c 20 73 6f 72 74 | 73 20 6f 66 20 73 74 61 |all sort|s of sta|
|00004750| 74 69 63 20 74 79 70 65 | 20 63 68 65 63 6b 69 6e |tic type| checkin|
|00004760| 67 2c 20 62 75 74 20 63 | 61 6e 27 74 20 79 6f 75 |g, but c|an't you|
|00004770| 20 67 65 74 0a 74 68 65 | 20 73 61 6d 65 20 65 66 | get.the| same ef|
|00004780| 66 65 63 74 20 75 73 69 | 6e 67 20 61 20 74 6f 6f |fect usi|ng a too|
|00004790| 6c 20 6c 69 6b 65 20 22 | 6c 69 6e 74 22 20 77 69 |l like "|lint" wi|
|000047a0| 74 68 20 43 3f 0a 0a 20 | 20 20 4e 6f 2c 20 68 65 |th C?.. | No, he|
|000047b0| 72 65 20 61 72 65 20 61 | 20 66 65 77 20 72 65 61 |re are a| few rea|
|000047c0| 73 6f 6e 73 20 77 68 79 | 20 28 74 68 69 73 20 6c |sons why| (this l|
|000047d0| 69 73 74 20 69 73 20 62 | 79 20 6e 6f 20 6d 65 61 |ist is b|y no mea|
|000047e0| 6e 73 20 63 6f 6d 70 6c | 65 74 65 29 3a 0a 0a 20 |ns compl|ete):.. |
|000047f0| 20 20 28 53 75 62 6d 69 | 74 74 65 64 20 62 79 20 | (Submi|tted by |
|00004800| 4e 6f 72 6d 20 43 6f 68 | 65 6e 29 0a 20 20 20 20 |Norm Coh|en). |
|00004810| 20 2a 20 52 75 6e 6e 69 | 6e 67 20 62 6f 74 68 20 | * Runni|ng both |
|00004820| 4c 69 6e 74 20 61 6e 64 | 20 61 20 43 20 63 6f 6d |Lint and| a C com|
|00004830| 70 69 6c 65 72 20 72 65 | 71 75 69 72 65 73 20 74 |piler re|quires t|
|00004840| 68 65 20 70 72 6f 67 72 | 61 6d 20 74 65 78 74 20 |he progr|am text |
|00004850| 74 6f 20 62 65 0a 20 20 | 20 20 20 20 20 70 61 72 |to be. | par|
|00004860| 73 65 64 20 61 6e 64 20 | 73 65 6d 61 6e 74 69 63 |sed and |semantic|
|00004870| 61 6c 6c 79 20 61 6e 61 | 6c 79 7a 65 64 20 74 77 |ally ana|lyzed tw|
|00004880| 69 63 65 2e 20 54 68 65 | 20 72 65 73 75 6c 74 73 |ice. The| results|
|00004890| 20 6f 66 20 61 6e 20 41 | 64 61 0a 20 20 20 20 20 | of an A|da. |
|000048a0| 20 20 63 6f 6d 70 69 6c | 65 72 27 73 20 70 61 72 | compil|er's par|
|000048b0| 73 65 20 61 6e 64 20 73 | 65 6d 61 6e 74 69 63 20 |se and s|emantic |
|000048c0| 61 6e 61 6c 79 73 69 73 | 20 61 72 65 20 75 73 65 |analysis| are use|
|000048d0| 64 20 64 69 72 65 63 74 | 6c 79 20 69 6e 0a 20 20 |d direct|ly in. |
|000048e0| 20 20 20 20 20 70 65 72 | 66 6f 72 6d 69 6e 67 20 | per|forming |
|000048f0| 63 6f 6e 73 69 73 74 65 | 6e 63 79 20 63 68 65 63 |consiste|ncy chec|
|00004900| 6b 73 2e 0a 0a 20 20 20 | 20 20 2a 20 54 68 65 20 |ks... | * The |
|00004910| 72 75 6c 65 73 20 6f 66 | 20 41 64 61 20 70 72 6f |rules of| Ada pro|
|00004920| 76 69 64 65 20 74 68 65 | 20 6f 70 70 6f 72 74 75 |vide the| opportu|
|00004930| 6e 69 74 79 20 66 6f 72 | 20 73 74 72 6f 6e 67 65 |nity for| stronge|
|00004940| 72 20 63 6f 6e 73 69 73 | 74 65 6e 63 79 0a 20 20 |r consis|tency. |
|00004950| 20 20 20 20 20 63 68 65 | 63 6b 73 20 74 68 61 6e | che|cks than|
|00004960| 20 61 72 65 20 70 6f 73 | 73 69 62 6c 65 20 77 69 | are pos|sible wi|
|00004970| 74 68 20 43 2e 20 46 6f | 72 20 65 78 61 6d 70 6c |th C. Fo|r exampl|
|00004980| 65 2c 20 61 6e 20 41 64 | 61 20 70 72 6f 67 72 61 |e, an Ad|a progra|
|00004990| 6d 6d 65 72 0a 20 20 20 | 20 20 20 20 63 61 6e 20 |mmer. | can |
|000049a0| 64 65 63 6c 61 72 65 20 | 64 69 73 74 69 6e 63 74 |declare |distinct|
|000049b0| 20 69 6e 74 65 67 65 72 | 20 74 79 70 65 73 20 74 | integer| types t|
|000049c0| 6f 20 72 65 70 72 65 73 | 65 6e 74 20 64 69 73 74 |o repres|ent dist|
|000049d0| 69 6e 63 74 0a 20 20 20 | 20 20 20 20 61 62 73 74 |inct. | abst|
|000049e0| 72 61 63 74 69 6f 6e 73 | 2e 20 41 6e 20 41 64 61 |ractions|. An Ada|
|000049f0| 20 63 6f 6d 70 69 6c 65 | 72 20 77 69 6c 6c 20 63 | compile|r will c|
|00004a00| 61 74 63 68 20 61 6e 20 | 69 6e 61 64 76 65 72 74 |atch an |inadvert|
|00004a10| 65 6e 74 0a 20 20 20 20 | 20 20 20 69 6e 74 65 72 |ent. | inter|
|00004a20| 6d 69 78 69 6e 67 20 6f | 66 20 74 68 65 73 65 20 |mixing o|f these |
|00004a30| 74 77 6f 20 74 79 70 65 | 73 2c 20 62 75 74 20 74 |two type|s, but t|
|00004a40| 68 65 72 65 20 69 73 20 | 6e 6f 20 77 61 79 20 61 |here is |no way a|
|00004a50| 0a 20 20 20 20 20 20 20 | 63 6f 72 72 65 73 70 6f |. |correspo|
|00004a60| 6e 64 69 6e 67 20 64 69 | 73 74 69 6e 63 74 69 6f |nding di|stinctio|
|00004a70| 6e 20 63 61 6e 20 62 65 | 20 6d 61 64 65 20 69 6e |n can be| made in|
|00004a80| 20 43 2c 20 73 6f 20 74 | 68 65 72 65 20 69 73 20 | C, so t|here is |
|00004a90| 6e 6f 20 77 61 79 20 66 | 6f 72 0a 20 20 20 20 20 |no way f|or. |
|00004aa0| 20 20 4c 69 6e 74 20 74 | 6f 20 70 65 72 66 6f 72 | Lint t|o perfor|
|00004ab0| 6d 20 61 20 63 6f 72 72 | 65 73 70 6f 6e 64 69 6e |m a corr|espondin|
|00004ac0| 67 20 63 68 65 63 6b 2e | 20 53 69 6d 69 6c 61 72 |g check.| Similar|
|00004ad0| 6c 79 2c 20 69 6e 20 43 | 2c 20 61 20 70 6f 69 6e |ly, in C|, a poin|
|00004ae0| 74 65 72 0a 20 20 20 20 | 20 20 20 74 6f 20 61 6e |ter. | to an|
|00004af0| 20 6f 62 6a 65 63 74 20 | 6f 66 20 74 79 70 65 20 | object |of type |
|00004b00| 54 20 69 73 20 69 6e 64 | 69 73 74 69 6e 67 75 69 |T is ind|istingui|
|00004b10| 73 68 61 62 6c 65 20 66 | 72 6f 6d 20 61 6e 20 61 |shable f|rom an a|
|00004b20| 72 72 61 79 20 6f 66 0a | 20 20 20 20 20 20 20 6f |rray of.| o|
|00004b30| 62 6a 65 63 74 73 20 6f | 66 20 74 79 70 65 20 54 |bjects o|f type T|
|00004b40| 2e 0a 0a 20 20 20 20 20 | 2a 20 54 68 65 20 72 75 |... |* The ru|
|00004b50| 6c 65 73 20 6f 66 20 74 | 68 65 20 41 64 61 20 6c |les of t|he Ada l|
|00004b60| 61 6e 67 75 61 67 65 20 | 65 6e 73 75 72 65 20 74 |anguage |ensure t|
|00004b70| 68 61 74 20 74 68 65 20 | 70 72 6f 67 72 61 6d 20 |hat the |program |
|00004b80| 74 65 78 74 0a 20 20 20 | 20 20 20 20 70 72 6f 76 |text. | prov|
|00004b90| 69 64 65 73 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |ides inf|ormation|
|00004ba0| 20 61 6c 6c 6f 77 69 6e | 67 20 50 52 45 43 49 53 | allowin|g PRECIS|
|00004bb0| 45 20 63 6f 6e 73 69 73 | 74 65 6e 63 79 20 63 68 |E consis|tency ch|
|00004bc0| 65 63 6b 73 2e 20 46 6f | 72 0a 20 20 20 20 20 20 |ecks. Fo|r. |
|00004bd0| 20 65 78 61 6d 70 6c 65 | 2c 20 74 68 65 20 65 78 | example|, the ex|
|00004be0| 70 72 65 73 73 69 6f 6e | 20 69 6e 20 61 6e 20 41 |pression| in an A|
|00004bf0| 64 61 20 63 61 73 65 20 | 73 74 61 74 65 6d 65 6e |da case |statemen|
|00004c00| 74 20 63 61 6e 20 62 65 | 20 77 72 69 74 74 65 6e |t can be| written|
|00004c10| 20 74 6f 0a 20 20 20 20 | 20 20 20 68 61 76 65 20 | to. | have |
|00004c20| 61 20 73 74 61 74 69 63 | 20 73 75 62 74 79 70 65 |a static| subtype|
|00004c30| 2c 20 61 6c 6c 6f 77 69 | 6e 67 20 74 68 65 20 63 |, allowi|ng the c|
|00004c40| 6f 6d 70 69 6c 65 72 20 | 74 6f 20 61 73 63 65 72 |ompiler |to ascer|
|00004c50| 74 61 69 6e 20 74 68 61 | 74 20 61 6c 6c 0a 20 20 |tain tha|t all. |
|00004c60| 20 20 20 20 20 70 6f 73 | 73 69 62 6c 65 20 76 61 | pos|sible va|
|00004c70| 6c 75 65 73 20 68 61 76 | 65 20 62 65 65 6e 20 63 |lues hav|e been c|
|00004c80| 6f 76 65 72 65 64 20 77 | 69 74 68 6f 75 74 20 72 |overed w|ithout r|
|00004c90| 65 73 6f 72 74 69 6e 67 | 20 74 6f 20 61 20 64 65 |esorting| to a de|
|00004ca0| 66 61 75 6c 74 0a 20 20 | 20 20 20 20 20 28 77 68 |fault. | (wh|
|00004cb0| 65 6e 20 6f 74 68 65 72 | 73 29 20 61 72 6d 2e 0a |en other|s) arm..|
|00004cc0| 0a 20 20 20 20 20 2a 20 | 57 69 74 68 20 6c 61 63 |. * |With lac|
|00004cd0| 6b 20 6f 66 20 70 72 65 | 63 69 73 65 20 69 6e 66 |k of pre|cise inf|
|00004ce0| 6f 72 6d 61 74 69 6f 6e | 2c 20 4c 69 6e 74 20 68 |ormation|, Lint h|
|00004cf0| 61 73 20 6e 6f 20 63 68 | 6f 69 63 65 20 62 75 74 |as no ch|oice but|
|00004d00| 20 74 6f 20 62 65 0a 20 | 20 20 20 20 20 20 6f 76 | to be. | ov|
|00004d10| 65 72 6c 79 20 70 65 73 | 73 69 6d 69 73 74 69 63 |erly pes|simistic|
|00004d20| 20 6f 72 2c 20 77 69 74 | 68 20 64 69 66 66 65 72 | or, wit|h differ|
|00004d30| 65 6e 74 20 73 65 74 74 | 69 6e 67 73 20 66 6f 72 |ent sett|ings for|
|00004d40| 20 61 20 63 6f 6d 70 6c | 69 63 61 74 65 64 0a 20 | a compl|icated. |
|00004d50| 20 20 20 20 20 20 73 65 | 74 20 6f 66 20 6f 70 74 | se|t of opt|
|00004d60| 69 6f 6e 73 2c 20 6f 76 | 65 72 6c 79 20 6f 70 74 |ions, ov|erly opt|
|00004d70| 69 6d 69 73 74 69 63 2e | 20 57 68 65 6e 20 69 74 |imistic.| When it|
|00004d80| 20 69 73 20 6f 76 65 72 | 6c 79 20 70 65 73 73 69 | is over|ly pessi|
|00004d90| 6d 69 73 74 69 63 2c 0a | 20 20 20 20 20 20 20 74 |mistic,.| t|
|00004da0| 68 65 20 75 73 65 72 20 | 73 65 65 73 20 74 6f 6f |he user |sees too|
|00004db0| 20 6d 61 6e 79 20 22 66 | 61 6c 73 65 20 61 6c 61 | many "f|alse ala|
|00004dc0| 72 6d 73 22 20 61 6e 64 | 20 6d 61 79 20 65 6e 64 |rms" and| may end|
|00004dd0| 20 75 70 20 69 67 6e 6f | 72 69 6e 67 0a 20 20 20 | up igno|ring. |
|00004de0| 20 20 20 20 76 61 6c 69 | 64 20 77 61 72 6e 69 6e | vali|d warnin|
|00004df0| 67 73 2e 20 57 68 65 6e | 20 69 74 20 69 73 20 6f |gs. When| it is o|
|00004e00| 76 65 72 6c 79 20 6f 70 | 74 69 6d 69 73 74 69 63 |verly op|timistic|
|00004e10| 2c 20 4c 69 6e 74 20 6f | 76 65 72 6c 6f 6f 6b 73 |, Lint o|verlooks|
|00004e20| 0a 20 20 20 20 20 20 20 | 63 65 72 74 61 69 6e 20 |. |certain |
|00004e30| 65 72 72 6f 72 73 2e 0a | 0a 20 20 20 20 20 2a 20 |errors..|. * |
|00004e40| 49 74 20 69 73 20 69 6d | 70 6f 73 73 69 62 6c 65 |It is im|possible|
|00004e50| 20 74 6f 20 66 6f 72 67 | 65 74 20 74 6f 20 72 75 | to forg|et to ru|
|00004e60| 6e 20 63 6f 6e 73 69 73 | 74 65 6e 63 79 20 63 68 |n consis|tency ch|
|00004e70| 65 63 6b 73 20 77 68 65 | 6e 20 75 73 69 6e 67 20 |ecks whe|n using |
|00004e80| 61 6e 0a 20 20 20 20 20 | 20 20 41 64 61 20 63 6f |an. | Ada co|
|00004e90| 6d 70 69 6c 65 72 2e 20 | 28 4f 66 20 63 6f 75 72 |mpiler. |(Of cour|
|00004ea0| 73 65 20 61 20 43 20 70 | 72 6f 67 72 61 6d 6d 69 |se a C p|rogrammi|
|00004eb0| 6e 67 20 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 20 63 |ng envir|onment c|
|00004ec0| 6f 75 6c 64 20 62 65 20 | 73 65 74 0a 20 20 20 20 |ould be |set. |
|00004ed0| 20 20 20 75 70 20 73 6f | 20 74 68 61 74 20 74 68 | up so| that th|
|00004ee0| 65 20 43 20 63 6f 6d 70 | 69 6c 65 72 20 63 6f 75 |e C comp|iler cou|
|00004ef0| 6c 64 20 6f 6e 6c 79 20 | 62 65 20 69 6e 76 6f 6b |ld only |be invok|
|00004f00| 65 64 20 66 72 6f 6d 20 | 61 20 73 63 72 69 70 74 |ed from |a script|
|00004f10| 20 74 68 61 74 0a 20 20 | 20 20 20 20 20 61 6c 73 | that. | als|
|00004f20| 6f 20 69 6e 76 6f 6b 65 | 73 20 4c 69 6e 74 2e 29 |o invoke|s Lint.)|
|00004f30| 0a 0a 20 20 20 20 20 2a | 20 41 20 63 6f 6d 70 69 |.. *| A compi|
|00004f40| 6c 61 74 69 6f 6e 20 74 | 68 61 74 20 66 61 69 6c |lation t|hat fail|
|00004f50| 73 20 41 64 61 20 63 6f | 6e 73 69 73 74 65 6e 63 |s Ada co|nsistenc|
|00004f60| 79 20 63 68 65 63 6b 73 | 20 69 73 20 72 65 6a 65 |y checks| is reje|
|00004f70| 63 74 65 64 2e 20 41 0a | 20 20 20 20 20 20 20 63 |cted. A.| c|
|00004f80| 6f 6d 70 69 6c 61 74 69 | 6f 6e 20 74 68 61 74 20 |ompilati|on that |
|00004f90| 66 61 69 6c 73 20 4c 69 | 6e 74 20 63 6f 6e 73 69 |fails Li|nt consi|
|00004fa0| 73 74 65 6e 63 79 20 63 | 68 65 63 6b 73 20 6d 61 |stency c|hecks ma|
|00004fb0| 79 20 73 74 69 6c 6c 20 | 62 65 0a 20 20 20 20 20 |y still |be. |
|00004fc0| 20 20 63 6f 6d 70 69 6c | 65 64 2c 20 61 6e 64 20 | compil|ed, and |
|00004fd0| 69 74 73 20 6f 62 6a 65 | 63 74 20 66 69 6c 65 20 |its obje|ct file |
|00004fe0| 75 73 65 64 20 28 69 6e | 74 65 6e 74 69 6f 6e 61 |used (in|tentiona|
|00004ff0| 6c 6c 79 20 6f 72 20 61 | 63 63 69 64 65 6e 74 6c |lly or a|ccidentl|
|00005000| 79 29 0a 20 20 20 20 20 | 20 20 69 6e 20 62 75 69 |y). | in bui|
|00005010| 6c 64 69 6e 67 20 74 68 | 65 20 73 79 73 74 65 6d |lding th|e system|
|00005020| 2e 20 28 4f 6e 65 20 63 | 61 6e 6e 6f 74 20 61 75 |. (One c|annot au|
|00005030| 74 6f 6d 61 74 65 20 74 | 68 65 20 72 65 6a 65 63 |tomate t|he rejec|
|00005040| 74 69 6f 6e 20 6f 66 0a | 20 20 20 20 20 20 20 70 |tion of.| p|
|00005050| 72 6f 67 72 61 6d 73 20 | 74 68 61 74 20 66 61 69 |rograms |that fai|
|00005060| 6c 20 4c 69 6e 74 20 75 | 6e 6c 65 73 73 20 6f 6e |l Lint u|nless on|
|00005070| 65 20 69 73 20 63 65 72 | 74 61 69 6e 20 74 68 61 |e is cer|tain tha|
|00005080| 74 20 74 68 65 72 65 20 | 77 69 6c 6c 0a 20 20 20 |t there |will. |
|00005090| 20 20 20 20 6e 65 76 65 | 72 20 62 65 20 61 6e 79 | neve|r be any|
|000050a0| 20 66 61 6c 73 65 20 77 | 61 72 6e 69 6e 67 73 2e | false w|arnings.|
|000050b0| 29 0a 0a 20 20 20 20 20 | 2a 20 41 64 61 20 65 6e |).. |* Ada en|
|000050c0| 66 6f 72 63 65 73 20 63 | 6f 6e 73 69 73 74 65 6e |forces c|onsisten|
|000050d0| 63 79 20 61 6d 6f 6e 67 | 20 73 65 70 61 72 61 74 |cy among| separat|
|000050e0| 65 6c 79 20 63 6f 6d 70 | 69 6c 65 64 20 75 6e 69 |ely comp|iled uni|
|000050f0| 74 73 2e 0a 0a 0a 20 20 | 20 4f 66 20 63 6f 75 72 |ts.... | Of cour|
|00005100| 73 65 20 65 76 65 6e 20 | 73 74 72 6f 6e 67 65 72 |se even |stronger|
|00005110| 20 61 72 67 75 6d 65 6e | 74 73 20 63 61 6e 20 62 | argumen|ts can b|
|00005120| 65 20 6d 61 64 65 20 61 | 62 6f 75 74 20 41 64 61 |e made a|bout Ada|
|00005130| 27 73 20 52 55 4e 2d 54 | 49 4d 45 0a 20 20 20 63 |'s RUN-T|IME. c|
|00005140| 68 65 63 6b 73 20 28 77 | 68 69 63 68 20 63 61 6e |hecks (w|hich can|
|00005150| 20 62 65 20 75 73 65 64 | 20 77 69 74 68 20 6c 69 | be used| with li|
|00005160| 74 74 6c 65 20 61 64 64 | 69 74 69 6f 6e 61 6c 20 |ttle add|itional |
|00005170| 6f 76 65 72 68 65 61 64 | 20 62 65 63 61 75 73 65 |overhead| because|
|00005180| 20 74 68 65 0a 20 20 20 | 69 6e 66 6f 72 6d 61 74 | the. |informat|
|00005190| 69 6f 6e 20 63 6f 6e 74 | 61 69 6e 65 64 20 69 6e |ion cont|ained in|
|000051a0| 20 61 6e 20 41 64 61 20 | 70 72 6f 67 72 61 6d 20 | an Ada |program |
|000051b0| 61 6e 64 20 74 68 65 20 | 6b 6e 6f 77 6c 65 64 67 |and the |knowledg|
|000051c0| 65 20 74 68 61 74 20 74 | 68 65 0a 20 20 20 70 72 |e that t|he. pr|
|000051d0| 6f 67 72 61 6d 20 68 61 | 73 20 70 61 73 73 65 64 |ogram ha|s passed|
|000051e0| 20 63 6f 6d 70 69 6c 65 | 2d 74 69 6d 65 20 63 6f | compile|-time co|
|000051f0| 6e 73 69 73 74 65 6e 63 | 79 20 63 68 65 63 6b 73 |nsistenc|y checks|
|00005200| 20 6d 61 6b 65 20 69 74 | 20 70 6f 73 73 69 62 6c | make it| possibl|
|00005210| 65 20 74 6f 0a 20 20 20 | 6f 70 74 69 6d 69 7a 65 |e to. |optimize|
|00005220| 20 61 77 61 79 20 74 68 | 65 20 6d 61 6a 6f 72 69 | away th|e majori|
|00005230| 74 79 20 6f 66 20 74 68 | 65 20 63 68 65 63 6b 73 |ty of th|e checks|
|00005240| 29 2e 20 54 68 65 73 65 | 20 63 68 65 63 6b 73 2c |). These| checks,|
|00005250| 20 77 68 69 63 68 20 61 | 72 65 0a 20 20 20 61 62 | which a|re. ab|
|00005260| 73 65 6e 74 20 69 6e 20 | 43 2c 20 74 65 6e 64 20 |sent in |C, tend |
|00005270| 74 6f 20 73 6d 6f 6b 65 | 20 6f 75 74 20 65 72 72 |to smoke| out err|
|00005280| 6f 72 73 20 65 61 72 6c | 79 20 62 79 20 64 65 74 |ors earl|y by det|
|00005290| 65 63 74 69 6e 67 20 69 | 6e 74 65 72 6e 61 6c 0a |ecting i|nternal.|
|000052a0| 20 20 20 69 6e 63 6f 6e | 73 69 73 74 65 6e 63 69 | incon|sistenci|
|000052b0| 65 73 20 74 68 61 74 20 | 6d 69 67 68 74 20 6e 6f |es that |might no|
|000052c0| 74 20 6f 74 68 65 72 77 | 69 73 65 20 62 65 20 64 |t otherw|ise be d|
|000052d0| 65 74 65 63 74 65 64 20 | 64 75 72 69 6e 67 20 74 |etected |during t|
|000052e0| 65 73 74 69 6e 67 2e 0a | 20 20 20 54 68 69 73 20 |esting..| This |
|000052f0| 72 65 64 75 63 65 73 20 | 74 68 65 20 6c 69 6b 65 |reduces |the like|
|00005300| 6c 69 68 6f 6f 64 20 6f | 66 20 66 69 65 6c 64 69 |lihood o|f fieldi|
|00005310| 6e 67 20 61 20 73 79 73 | 74 65 6d 20 74 68 61 74 |ng a sys|tem that|
|00005320| 20 61 70 70 65 61 72 73 | 20 74 6f 20 77 6f 72 6b | appears| to work|
|00005330| 0a 20 20 20 77 65 6c 6c | 20 64 75 72 69 6e 67 20 |. well| during |
|00005340| 74 65 73 74 69 6e 67 20 | 62 75 74 20 66 61 69 6c |testing |but fail|
|00005350| 73 20 69 6e 20 6f 70 65 | 72 61 74 69 6f 6e 61 6c |s in ope|rational|
|00005360| 20 75 73 65 2e 0a 0a 0a | 39 2e 38 3a 20 44 6f 65 | use....|9.8: Doe|
|00005370| 73 20 41 64 61 20 68 61 | 76 65 20 73 6f 6d 65 74 |s Ada ha|ve somet|
|00005380| 68 69 6e 67 20 6c 69 6b | 65 20 74 68 65 20 53 74 |hing lik|e the St|
|00005390| 61 6e 64 61 72 64 20 54 | 65 6d 70 6c 61 74 65 20 |andard T|emplate |
|000053a0| 4c 69 62 72 61 72 79 20 | 28 53 54 4c 29 20 69 6e |Library |(STL) in|
|000053b0| 20 43 2b 2b 2c 0a 6f 72 | 20 63 6f 6d 70 6f 6e 65 | C++,.or| compone|
|000053c0| 6e 74 73 20 6c 69 6b 65 | 20 79 6f 75 20 66 69 6e |nts like| you fin|
|000053d0| 64 20 69 6e 20 53 6d 61 | 6c 6c 74 61 6c 6b 20 65 |d in Sma|lltalk e|
|000053e0| 6e 76 69 72 6f 6e 6d 65 | 6e 74 73 3f 0a 0a 20 20 |nvironme|nts?.. |
|000053f0| 20 59 65 73 2c 20 69 6e | 20 76 61 72 69 6f 75 73 | Yes, in| various|
|00005400| 20 77 61 79 73 2e 0a 0a | 20 20 20 46 65 77 20 63 | ways...| Few c|
|00005410| 6f 6d 70 6f 6e 65 6e 74 | 73 20 61 72 65 20 70 61 |omponent|s are pa|
|00005420| 72 74 20 6f 66 20 74 68 | 65 20 49 53 4f 20 73 74 |rt of th|e ISO st|
|00005430| 61 6e 64 61 72 64 2e 20 | 41 64 61 20 39 35 20 68 |andard. |Ada 95 h|
|00005440| 61 73 20 61 6e 20 65 78 | 70 61 6e 64 65 64 0a 20 |as an ex|panded. |
|00005450| 20 20 73 65 74 20 6f 66 | 20 70 72 65 64 65 66 69 | set of| predefi|
|00005460| 6e 65 64 20 6c 69 62 72 | 61 72 79 20 75 6e 69 74 |ned libr|ary unit|
|00005470| 73 2c 20 63 6f 76 65 72 | 69 6e 67 20 65 2e 67 2e |s, cover|ing e.g.|
|00005480| 20 73 74 72 69 6e 67 73 | 20 6f 66 20 76 61 72 79 | strings| of vary|
|00005490| 69 6e 67 2d 20 6f 72 0a | 20 20 20 64 79 6e 61 6d |ing- or.| dynam|
|000054a0| 69 63 2d 6c 65 6e 67 74 | 68 2c 20 65 6c 65 6d 65 |ic-lengt|h, eleme|
|000054b0| 6e 74 61 72 79 20 6e 75 | 6d 65 72 69 63 61 6c 20 |ntary nu|merical |
|000054c0| 66 75 6e 63 74 69 6f 6e | 73 2c 20 72 61 6e 64 6f |function|s, rando|
|000054d0| 6d 20 6e 75 6d 62 65 72 | 0a 20 20 20 67 65 6e 65 |m number|. gene|
|000054e0| 72 61 74 6f 72 73 2c 20 | 63 6f 6d 70 6c 65 78 20 |rators, |complex |
|000054f0| 6e 75 6d 62 65 72 73 2c | 20 61 6e 64 20 6d 6f 72 |numbers,| and mor|
|00005500| 65 3b 20 69 6e 20 61 64 | 64 69 74 69 6f 6e 2c 20 |e; in ad|dition, |
|00005510| 74 68 65 20 53 70 65 63 | 69 61 6c 20 4e 65 65 64 |the Spec|ial Need|
|00005520| 73 0a 20 20 20 41 6e 6e | 65 78 65 73 20 73 74 61 |s. Ann|exes sta|
|00005530| 6e 64 61 72 64 69 7a 65 | 20 6d 61 6e 79 20 61 64 |ndardize| many ad|
|00005540| 76 61 6e 63 65 64 20 73 | 65 72 76 69 63 65 73 20 |vanced s|ervices |
|00005550| 77 68 69 63 68 20 68 61 | 76 65 20 63 6f 6d 6d 6f |which ha|ve commo|
|00005560| 6e 6c 79 20 62 65 65 6e | 0a 20 20 20 70 72 6f 76 |nly been|. prov|
|00005570| 69 64 65 64 20 62 79 20 | 73 65 70 61 72 61 74 65 |ided by |separate|
|00005580| 20 63 6f 6d 70 6f 6e 65 | 6e 74 73 20 69 6e 20 74 | compone|nts in t|
|00005590| 68 65 20 70 61 73 74 2e | 0a 0a 20 20 20 41 20 6c |he past.|.. A l|
|000055a0| 6f 74 20 6f 66 20 66 72 | 65 65 20 41 64 61 20 73 |ot of fr|ee Ada s|
|000055b0| 6f 66 74 77 61 72 65 20 | 63 6f 6d 70 6f 6e 65 6e |oftware |componen|
|000055c0| 74 73 20 61 72 65 20 61 | 76 61 69 6c 61 62 6c 65 |ts are a|vailable|
|000055d0| 20 66 72 6f 6d 20 61 6e | 6f 6e 79 6d 6f 75 73 20 | from an|onymous |
|000055e0| 46 54 50 0a 20 20 20 73 | 69 74 65 73 2e 20 54 68 |FTP. s|ites. Th|
|000055f0| 65 72 65 20 69 73 20 61 | 6c 73 6f 20 61 6e 20 75 |ere is a|lso an u|
|00005600| 70 63 6f 6d 69 6e 67 20 | 72 65 6c 65 61 73 65 20 |pcoming |release |
|00005610| 6f 66 20 74 68 65 20 42 | 6f 6f 63 68 20 43 6f 6d |of the B|ooch Com|
|00005620| 70 6f 6e 65 6e 74 73 20 | 66 6f 72 0a 20 20 20 41 |ponents |for. A|
|00005630| 64 61 20 39 35 20 75 6e | 64 65 72 20 74 68 65 20 |da 95 un|der the |
|00005640| 47 4e 55 20 4c 69 62 72 | 61 72 79 20 47 65 6e 65 |GNU Libr|ary Gene|
|00005650| 72 61 6c 20 50 75 62 6c | 69 63 20 4c 69 63 65 6e |ral Publ|ic Licen|
|00005660| 73 65 20 28 4c 47 50 4c | 29 3b 20 74 68 69 73 20 |se (LGPL|); this |
|00005670| 77 69 6c 6c 0a 20 20 20 | 67 69 76 65 20 79 6f 75 |will. |give you|
|00005680| 20 74 68 65 20 61 62 69 | 6c 69 74 79 20 74 6f 20 | the abi|lity to |
|00005690| 66 72 65 65 6c 79 20 69 | 6e 63 6c 75 64 65 20 74 |freely i|nclude t|
|000056a0| 68 65 20 6c 69 62 72 61 | 72 79 20 63 6f 6d 70 6f |he libra|ry compo|
|000056b0| 6e 65 6e 74 73 20 69 6e | 20 79 6f 75 72 0a 20 20 |nents in| your. |
|000056c0| 20 61 70 70 6c 69 63 61 | 74 69 6f 6e 20 77 69 74 | applica|tion wit|
|000056d0| 68 6f 75 74 20 61 6e 79 | 20 63 6f 73 74 20 6f 72 |hout any| cost or|
|000056e0| 20 6f 62 6c 69 67 61 74 | 69 6f 6e 2e 20 28 43 6f | obligat|ion. (Co|
|000056f0| 6e 74 61 63 74 20 64 77 | 65 6c 6c 65 72 40 64 66 |ntact dw|eller@df|
|00005700| 77 2e 6e 65 74 0a 20 20 | 20 66 6f 72 20 6d 6f 72 |w.net. | for mor|
|00005710| 65 20 64 65 74 61 69 6c | 73 2e 29 0a 0a 20 20 20 |e detail|s.).. |
|00005720| 20 57 68 61 74 20 61 62 | 6f 75 74 20 53 54 4c 20 | What ab|out STL |
|00005730| 61 6e 64 20 74 68 65 20 | 53 6d 61 6c 6c 74 61 6c |and the |Smalltal|
|00005740| 6b 20 6c 69 62 72 61 72 | 79 3f 0a 0a 20 20 20 54 |k librar|y?.. T|
|00005750| 68 65 20 43 2b 2b 20 53 | 54 4c 20 64 6f 65 73 6e |he C++ S|TL doesn|
|00005760| 27 74 20 63 6f 6e 74 61 | 69 6e 20 6d 75 63 68 2e |'t conta|in much.|
|00005770| 20 52 65 61 6c 6c 79 2e | 20 42 72 65 61 6b 69 6e | Really.| Breakin|
|00005780| 67 20 69 74 73 20 73 6f | 75 72 63 65 20 63 6f 64 |g its so|urce cod|
|00005790| 65 0a 20 20 20 64 6f 77 | 6e 2c 20 69 74 20 63 6f |e. dow|n, it co|
|000057a0| 6e 74 61 69 6e 73 20 6c | 65 73 73 20 74 68 61 6e |ntains l|ess than|
|000057b0| 20 33 30 30 30 20 73 65 | 6d 69 63 6f 6c 6f 6e 73 | 3000 se|micolons|
|000057c0| 20 28 7e 37 30 30 30 20 | 74 6f 74 61 6c 20 6c 69 | (~7000 |total li|
|000057d0| 6e 65 73 29 2e 20 54 68 | 65 0a 20 20 20 65 6e 74 |nes). Th|e. ent|
|000057e0| 69 72 65 20 6c 69 62 72 | 61 72 79 20 65 78 69 73 |ire libr|ary exis|
|000057f0| 74 73 20 69 6e 20 43 2b | 2b 20 68 65 61 64 65 72 |ts in C+|+ header|
|00005800| 20 66 69 6c 65 73 20 61 | 73 20 69 6e 6c 69 6e 65 | files a|s inline|
|00005810| 61 62 6c 65 20 63 6f 64 | 65 0a 20 20 20 28 73 75 |able cod|e. (su|
|00005820| 70 70 6f 73 65 64 6c 79 | 20 77 69 74 68 69 6e 20 |pposedly| within |
|00005830| 61 20 66 65 77 20 70 65 | 72 63 65 6e 74 20 6f 66 |a few pe|rcent of|
|00005840| 20 74 68 65 20 65 66 66 | 69 63 69 65 6e 63 79 20 | the eff|iciency |
|00005850| 6f 66 20 68 61 6e 64 2d | 6f 70 74 69 6d 69 7a 65 |of hand-|optimize|
|00005860| 64 0a 20 20 20 63 6f 64 | 65 29 2e 0a 0a 20 20 20 |d. cod|e)... |
|00005870| 53 54 4c 20 63 6c 61 73 | 73 20 68 69 65 72 61 72 |STL clas|s hierar|
|00005880| 63 68 79 0a 0a 20 20 20 | 20 20 62 6f 6f 6c 2c 20 |chy.. | bool, |
|00005890| 68 65 61 70 20 20 20 20 | 20 2d 2d 20 6f 66 20 63 |heap | -- of c|
|000058a0| 6f 75 72 73 65 20 41 64 | 61 20 64 6f 65 73 20 6e |ourse Ad|a does n|
|000058b0| 6f 74 20 6e 65 65 64 20 | 61 20 62 6f 6f 6c 20 63 |ot need |a bool c|
|000058c0| 6c 61 73 73 21 0a 20 20 | 20 20 20 20 5c 20 66 75 |lass!. | \ fu|
|000058d0| 6e 63 74 69 6f 6e 2c 20 | 70 61 69 72 2c 20 73 74 |nction, |pair, st|
|000058e0| 61 63 6b 0a 20 20 20 20 | 20 20 20 20 20 5c 20 69 |ack. | \ i|
|000058f0| 74 65 72 61 74 6f 72 2c | 20 74 65 6d 70 62 75 66 |terator,| tempbuf|
|00005900| 2c 20 70 72 6f 6a 65 63 | 74 69 6f 6e 0a 20 20 20 |, projec|tion. |
|00005910| 20 20 20 20 20 20 20 20 | 20 5c 20 61 6c 67 6f 62 | | \ algob|
|00005920| 61 73 65 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |ase. | |
|00005930| 20 20 20 5c 20 61 6c 67 | 6f 72 69 74 68 6d 73 2c | \ alg|orithms,|
|00005940| 20 62 69 74 76 65 63 74 | 6f 72 2c 20 64 65 71 75 | bitvect|or, dequ|
|00005950| 65 2c 20 6c 69 73 74 2c | 20 74 72 65 65 2c 20 76 |e, list,| tree, v|
|00005960| 65 63 74 6f 72 0a 20 20 | 20 20 20 20 20 20 20 20 |ector. | |
|00005970| 20 20 20 20 20 20 20 20 | 5c 20 6d 61 70 2c 20 6d | |\ map, m|
|00005980| 75 6c 74 69 6d 61 70 2c | 20 73 65 74 2c 20 6d 75 |ultimap,| set, mu|
|00005990| 6c 74 69 73 65 74 0a 0a | 0a 20 20 20 54 68 65 20 |ltiset..|. The |
|000059a0| 6d 61 69 6e 20 61 75 74 | 68 6f 72 20 6f 66 20 74 |main aut|hor of t|
|000059b0| 68 65 20 6c 69 62 72 61 | 72 79 2c 20 41 6c 65 78 |he libra|ry, Alex|
|000059c0| 61 6e 64 65 72 20 53 74 | 65 70 61 6e 6f 76 2c 20 |ander St|epanov, |
|000059d0| 63 72 65 61 74 65 64 20 | 74 68 65 20 41 64 61 0a |created |the Ada.|
|000059e0| 20 20 20 47 65 6e 65 72 | 69 63 20 4c 69 62 72 61 | Gener|ic Libra|
|000059f0| 72 79 20 69 6e 20 74 68 | 65 20 31 39 38 30 27 73 |ry in th|e 1980's|
|00005a00| 20 2d 2d 20 61 6e 64 20 | 6c 61 74 65 72 20 62 6f | -- and |later bo|
|00005a10| 72 72 6f 77 65 64 20 66 | 72 6f 6d 20 74 68 69 73 |rrowed f|rom this|
|00005a20| 20 74 6f 0a 20 20 20 63 | 72 65 61 74 65 20 53 54 | to. c|reate ST|
|00005a30| 4c 2e 20 28 54 68 65 72 | 65 20 69 73 20 61 6e 20 |L. (Ther|e is an |
|00005a40| 69 6e 74 65 72 76 69 65 | 77 20 77 69 74 68 20 53 |intervie|w with S|
|00005a50| 74 65 70 61 6e 6f 76 20 | 69 6e 20 74 68 65 20 4d |tepanov |in the M|
|00005a60| 61 72 63 68 20 31 39 39 | 35 0a 20 20 20 69 73 73 |arch 199|5. iss|
|00005a70| 75 65 20 6f 66 20 44 72 | 2e 20 44 6f 62 62 27 73 |ue of Dr|. Dobb's|
|00005a80| 20 4a 6f 75 72 6e 61 6c | 20 2d 2d 20 69 6e 20 74 | Journal| -- in t|
|00005a90| 68 65 20 43 20 50 72 6f | 67 72 61 6d 6d 69 6e 67 |he C Pro|gramming|
|00005aa0| 20 63 6f 6c 75 6d 6e 20 | 62 65 67 69 6e 6e 69 6e | column |beginnin|
|00005ab0| 67 0a 20 20 20 6f 6e 20 | 70 61 67 65 20 31 31 35 |g. on |page 115|
|00005ac0| 2e 20 53 74 65 70 61 6e | 6f 76 20 65 78 70 6c 61 |. Stepan|ov expla|
|00005ad0| 69 6e 73 20 74 68 61 74 | 20 74 68 65 73 65 20 63 |ins that| these c|
|00005ae0| 6f 6d 70 6f 6e 65 6e 74 | 73 20 77 65 72 65 20 66 |omponent|s were f|
|00005af0| 69 72 73 74 20 64 6f 6e | 65 0a 20 20 20 69 6e 20 |irst don|e. in |
|00005b00| 41 64 61 2e 29 0a 0a 20 | 20 20 54 68 65 20 53 6d |Ada.).. | The Sm|
|00005b10| 61 6c 6c 74 61 6c 6b 20 | 6c 69 62 72 61 72 79 20 |alltalk |library |
|00005b20| 69 73 20 71 75 69 74 65 | 20 65 63 6c 65 63 74 69 |is quite| eclecti|
|00005b30| 63 2e 20 49 74 20 63 6f | 76 65 72 73 20 65 76 65 |c. It co|vers eve|
|00005b40| 72 79 74 68 69 6e 67 20 | 66 72 6f 6d 0a 20 20 20 |rything |from. |
|00005b50| 42 6f 6f 6c 65 61 6e 20 | 74 6f 20 62 69 74 6d 61 |Boolean |to bitma|
|00005b60| 70 73 2c 20 64 69 63 74 | 69 6f 6e 61 72 69 65 73 |ps, dict|ionaries|
|00005b70| 20 61 6e 64 20 6f 74 68 | 65 72 20 63 6f 6c 6c 65 | and oth|er colle|
|00005b80| 63 74 69 6f 6e 73 2e 20 | 50 61 72 74 73 20 6f 66 |ctions. |Parts of|
|00005b90| 20 69 74 0a 20 20 20 68 | 61 76 65 20 64 69 72 65 | it. h|ave dire|
|00005ba0| 63 74 20 65 71 75 69 76 | 61 6c 65 6e 74 73 20 69 |ct equiv|alents i|
|00005bb0| 6e 20 41 64 61 20 39 35 | 2c 20 70 61 72 74 73 20 |n Ada 95|, parts |
|00005bc0| 61 72 65 20 61 6c 72 65 | 61 64 79 20 61 76 61 69 |are alre|ady avai|
|00005bd0| 6c 61 62 6c 65 20 69 6e | 0a 20 20 20 63 6f 6d 70 |lable in|. comp|
|00005be0| 6f 6e 65 6e 74 73 20 66 | 72 6f 6d 20 61 6e 6f 6e |onents f|rom anon|
|00005bf0| 79 6d 6f 75 73 20 46 54 | 50 20 73 69 74 65 73 20 |ymous FT|P sites |
|00005c00| 61 6e 64 2f 6f 72 20 77 | 69 6c 6c 20 62 65 20 69 |and/or w|ill be i|
|00005c10| 6e 20 74 68 65 20 42 6f | 6f 63 68 20 41 64 61 20 |n the Bo|och Ada |
|00005c20| 39 35 0a 20 20 20 63 6f | 6d 70 6f 6e 65 6e 74 73 |95. co|mponents|
|00005c30| 2c 20 61 6e 64 20 6f 74 | 68 65 72 20 70 61 72 74 |, and ot|her part|
|00005c40| 73 20 61 72 65 20 61 76 | 61 69 6c 61 62 6c 65 20 |s are av|ailable |
|00005c50| 66 72 6f 6d 20 63 6f 6d | 6d 65 72 63 69 61 6c 20 |from com|mercial |
|00005c60| 41 64 61 0a 20 20 20 63 | 6f 6d 70 6f 6e 65 6e 74 |Ada. c|omponent|
|00005c70| 20 73 75 70 70 6c 69 65 | 72 73 2e 0a 0a 0a 39 2e | supplie|rs....9.|
|00005c80| 39 3a 20 57 68 65 72 65 | 20 63 61 6e 20 49 20 66 |9: Where| can I f|
|00005c90| 69 6e 64 20 74 68 65 20 | 65 71 75 69 76 61 6c 65 |ind the |equivale|
|00005ca0| 6e 74 20 6f 66 20 22 70 | 72 69 6e 74 66 22 20 69 |nt of "p|rintf" i|
|00005cb0| 6e 20 41 64 61 3f 0a 0a | 20 20 20 57 68 69 6c 65 |n Ada?..| While|
|00005cc0| 20 74 68 65 20 73 74 61 | 6e 64 61 72 64 20 70 61 | the sta|ndard pa|
|00005cd0| 63 6b 61 67 65 20 54 65 | 78 74 5f 49 4f 20 70 72 |ckage Te|xt_IO pr|
|00005ce0| 6f 76 69 64 65 73 20 6d | 61 6e 79 20 66 65 61 74 |ovides m|any feat|
|00005cf0| 75 72 65 73 2c 20 74 68 | 65 0a 20 20 20 72 65 71 |ures, th|e. req|
|00005d00| 75 65 73 74 20 66 6f 72 | 20 61 20 70 72 69 6e 74 |uest for| a print|
|00005d10| 66 2d 6c 69 6b 65 20 66 | 75 6e 63 74 69 6f 6e 20 |f-like f|unction |
|00005d20| 69 73 20 6e 6f 74 20 75 | 6e 75 73 75 61 6c 2e 0a |is not u|nusual..|
|00005d30| 0a 20 20 20 28 73 6f 6c | 75 74 69 6f 6e 20 62 61 |. (sol|ution ba|
|00005d40| 73 65 64 20 6f 6e 20 61 | 20 73 75 67 67 65 73 74 |sed on a| suggest|
|00005d50| 69 6f 6e 20 62 79 20 54 | 75 63 6b 65 72 20 54 61 |ion by T|ucker Ta|
|00005d60| 66 74 29 0a 0a 20 20 20 | 49 74 20 69 73 20 70 6f |ft).. |It is po|
|00005d70| 73 73 69 62 6c 65 20 74 | 6f 20 70 72 6f 64 75 63 |ssible t|o produc|
|00005d80| 65 20 61 20 70 72 69 6e | 74 66 2d 6c 69 6b 65 20 |e a prin|tf-like |
|00005d90| 63 61 70 61 62 69 6c 69 | 74 79 20 62 79 20 6f 76 |capabili|ty by ov|
|00005da0| 65 72 6c 6f 61 64 69 6e | 67 20 74 68 65 0a 20 20 |erloadin|g the. |
|00005db0| 20 22 26 22 20 6f 70 65 | 72 61 74 6f 72 20 74 6f | "&" ope|rator to|
|00005dc0| 20 74 61 6b 65 20 61 6e | 20 6f 62 6a 65 63 74 20 | take an| object |
|00005dd0| 6f 66 20 74 79 70 65 20 | 46 6f 72 6d 61 74 20 61 |of type |Format a|
|00005de0| 6e 64 20 61 6e 20 6f 62 | 6a 65 63 74 20 6f 66 20 |nd an ob|ject of |
|00005df0| 73 6f 6d 65 0a 20 20 20 | 74 79 70 65 20 61 6e 64 |some. |type and|
|00005e00| 20 72 65 74 75 72 6e 20 | 74 68 65 20 46 6f 72 6d | return |the Form|
|00005e10| 61 74 2c 20 70 72 6f 70 | 65 72 6c 79 20 61 64 76 |at, prop|erly adv|
|00005e20| 61 6e 63 65 64 2c 20 61 | 66 74 65 72 20 68 61 76 |anced, a|fter hav|
|00005e30| 69 6e 67 20 70 65 72 66 | 6f 72 6d 65 64 0a 20 20 |ing perf|ormed. |
|00005e40| 20 74 68 65 20 61 70 70 | 72 6f 70 72 69 61 74 65 | the app|ropriate|
|00005e50| 20 6f 75 74 70 75 74 2e | 20 54 68 65 20 72 65 6d | output.| The rem|
|00005e60| 61 69 6e 69 6e 67 20 66 | 6f 72 6d 61 74 20 63 61 |aining f|ormat ca|
|00005e70| 6e 20 62 65 20 63 6f 6e | 76 65 72 74 65 64 20 62 |n be con|verted b|
|00005e80| 61 63 6b 20 74 6f 0a 20 | 20 20 61 20 73 74 72 69 |ack to. | a stri|
|00005e90| 6e 67 2d 2d 65 2e 67 2e | 20 74 6f 20 65 78 61 6d |ng--e.g.| to exam|
|00005ea0| 69 6e 65 20 77 68 61 74 | 20 69 73 20 6c 65 66 74 |ine what| is left|
|00005eb0| 20 61 74 20 74 68 65 20 | 65 6e 64 20 6f 66 20 74 | at the |end of t|
|00005ec0| 68 65 20 66 6f 72 6d 61 | 74 0a 20 20 20 73 74 72 |he forma|t. str|
|00005ed0| 69 6e 67 2d 2d 20 6f 72 | 20 73 69 6d 70 6c 79 20 |ing-- or| simply |
|00005ee0| 70 72 69 6e 74 65 64 20 | 74 6f 20 64 69 73 70 6c |printed |to displ|
|00005ef0| 61 79 20 77 68 61 74 65 | 76 65 72 20 72 65 6d 61 |ay whate|ver rema|
|00005f00| 69 6e 73 20 61 74 20 74 | 68 65 20 65 6e 64 2e 20 |ins at t|he end. |
|00005f10| 46 6f 72 0a 20 20 20 65 | 78 61 6d 70 6c 65 3a 0a |For. e|xample:.|
|00005f20| 0a 20 20 20 20 20 77 69 | 74 68 20 54 65 78 74 5f |. wi|th Text_|
|00005f30| 49 4f 3b 0a 20 20 20 20 | 20 70 61 63 6b 61 67 65 |IO;. | package|
|00005f40| 20 46 6f 72 6d 61 74 74 | 65 64 5f 4f 75 74 70 75 | Formatt|ed_Outpu|
|00005f50| 74 20 69 73 0a 20 20 20 | 20 20 20 20 74 79 70 65 |t is. | type|
|00005f60| 20 46 6f 72 6d 61 74 20 | 69 73 0a 20 20 20 20 20 | Format |is. |
|00005f70| 20 20 20 20 6c 69 6d 69 | 74 65 64 20 70 72 69 76 | limi|ted priv|
|00005f80| 61 74 65 3b 0a 0a 20 20 | 20 20 20 20 20 66 75 6e |ate;.. | fun|
|00005f90| 63 74 69 6f 6e 20 46 6d | 74 20 28 53 74 72 20 3a |ction Fm|t (Str :|
|00005fa0| 20 53 74 72 69 6e 67 29 | 0a 20 20 20 20 20 20 20 | String)|. |
|00005fb0| 20 20 72 65 74 75 72 6e | 20 46 6f 72 6d 61 74 3b | return| Format;|
|00005fc0| 0a 0a 20 20 20 20 20 20 | 20 66 75 6e 63 74 69 6f |.. | functio|
|00005fd0| 6e 20 22 26 22 20 28 4c | 65 66 74 20 3a 20 46 6f |n "&" (L|eft : Fo|
|00005fe0| 72 6d 61 74 3b 20 52 69 | 67 68 74 20 3a 20 49 6e |rmat; Ri|ght : In|
|00005ff0| 74 65 67 65 72 29 0a 20 | 20 20 20 20 20 20 20 20 |teger). | |
|00006000| 72 65 74 75 72 6e 20 46 | 6f 72 6d 61 74 3b 0a 20 |return F|ormat;. |
|00006010| 20 20 20 20 20 20 66 75 | 6e 63 74 69 6f 6e 20 22 | fu|nction "|
|00006020| 26 22 20 28 4c 65 66 74 | 20 3a 20 46 6f 72 6d 61 |&" (Left| : Forma|
|00006030| 74 3b 20 52 69 67 68 74 | 20 3a 20 46 6c 6f 61 74 |t; Right| : Float|
|00006040| 29 0a 20 20 20 20 20 20 | 20 20 20 72 65 74 75 72 |). | retur|
|00006050| 6e 20 46 6f 72 6d 61 74 | 3b 0a 20 20 20 20 20 20 |n Format|;. |
|00006060| 20 66 75 6e 63 74 69 6f | 6e 20 22 26 22 20 28 4c | functio|n "&" (L|
|00006070| 65 66 74 20 3a 20 46 6f | 72 6d 61 74 3b 20 52 69 |eft : Fo|rmat; Ri|
|00006080| 67 68 74 20 3a 20 53 74 | 72 69 6e 67 29 0a 20 20 |ght : St|ring). |
|00006090| 20 20 20 20 20 20 20 72 | 65 74 75 72 6e 20 46 6f | r|eturn Fo|
|000060a0| 72 6d 61 74 3b 0a 20 20 | 20 20 20 20 20 2e 2e 2e |rmat;. | ...|
|000060b0| 20 2d 2d 20 6f 74 68 65 | 72 20 6f 76 65 72 6c 6f | -- othe|r overlo|
|000060c0| 61 64 69 6e 67 73 20 6f | 66 20 22 26 22 0a 0a 20 |adings o|f "&".. |
|000060d0| 20 20 20 20 20 20 70 72 | 6f 63 65 64 75 72 65 20 | pr|ocedure |
|000060e0| 50 72 69 6e 74 20 28 46 | 6d 74 20 3a 20 46 6f 72 |Print (F|mt : For|
|000060f0| 6d 61 74 29 3b 0a 0a 20 | 20 20 20 20 20 20 66 75 |mat);.. | fu|
|00006100| 6e 63 74 69 6f 6e 20 54 | 6f 5f 53 74 72 69 6e 67 |nction T|o_String|
|00006110| 20 28 46 6d 74 20 3a 20 | 46 6f 72 6d 61 74 29 0a | (Fmt : |Format).|
|00006120| 20 20 20 20 20 20 20 20 | 20 72 65 74 75 72 6e 20 | | return |
|00006130| 53 74 72 69 6e 67 3b 0a | 0a 20 20 20 20 20 70 72 |String;.|. pr|
|00006140| 69 76 61 74 65 0a 20 20 | 20 20 20 20 20 2e 2e 2e |ivate. | ...|
|00006150| 0a 20 20 20 20 20 65 6e | 64 20 46 6f 72 6d 61 74 |. en|d Format|
|00006160| 74 65 64 5f 4f 75 74 70 | 75 74 3b 0a 0a 20 20 20 |ted_Outp|ut;.. |
|00006170| 20 20 77 69 74 68 20 46 | 6f 72 6d 61 74 74 65 64 | with F|ormatted|
|00006180| 5f 4f 75 74 70 75 74 3b | 20 75 73 65 20 46 6f 72 |_Output;| use For|
|00006190| 6d 61 74 74 65 64 5f 4f | 75 74 70 75 74 3b 0a 20 |matted_O|utput;. |
|000061a0| 20 20 20 20 70 72 6f 63 | 65 64 75 72 65 20 54 65 | proc|edure Te|
|000061b0| 73 74 20 69 73 0a 20 20 | 20 20 20 20 20 58 2c 20 |st is. | X, |
|000061c0| 59 20 3a 20 46 6c 6f 61 | 74 3b 0a 20 20 20 20 20 |Y : Floa|t;. |
|000061d0| 62 65 67 69 6e 0a 20 20 | 20 20 20 20 20 50 72 69 |begin. | Pri|
|000061e0| 6e 74 20 28 46 6d 74 28 | 22 25 64 20 2a 20 25 64 |nt (Fmt(|"%d * %d|
|000061f0| 20 3d 20 25 64 5c 6e 22 | 29 20 26 20 58 20 26 20 | = %d\n"|) & X & |
|00006200| 59 20 26 20 58 2a 59 29 | 3b 0a 20 20 20 20 20 65 |Y & X*Y)|;. e|
|00006210| 6e 64 20 54 65 73 74 3b | 0a 0a 20 20 20 54 68 65 |nd Test;|.. The|
|00006220| 20 70 72 69 76 61 74 65 | 20 70 61 72 74 20 61 6e | private| part an|
|00006230| 64 20 62 6f 64 79 20 6f | 66 20 46 6f 72 6d 61 74 |d body o|f Format|
|00006240| 74 65 64 5f 4f 75 74 70 | 75 74 20 61 72 65 20 6c |ted_Outp|ut are l|
|00006250| 65 66 74 20 61 73 20 61 | 6e 20 65 78 65 72 63 69 |eft as a|n exerci|
|00006260| 73 65 0a 20 20 20 66 6f | 72 20 74 68 65 20 72 65 |se. fo|r the re|
|00006270| 61 64 65 72 20 3b 2d 29 | 2e 0a 0a 20 20 20 41 20 |ader ;-)|... A |
|00006280| 22 46 69 6c 65 20 3a 20 | 46 69 6c 65 5f 54 79 70 |"File : |File_Typ|
|00006290| 65 22 20 70 61 72 61 6d | 65 74 65 72 20 63 6f 75 |e" param|eter cou|
|000062a0| 6c 64 20 62 65 20 61 64 | 64 65 64 20 74 6f 20 61 |ld be ad|ded to a|
|000062b0| 6e 20 6f 76 65 72 6c 6f | 61 64 69 6e 67 20 6f 66 |n overlo|ading of|
|000062c0| 20 46 6d 74 0a 20 20 20 | 69 66 20 64 65 73 69 72 | Fmt. |if desir|
|000062d0| 65 64 20 28 74 6f 20 63 | 72 65 61 74 65 20 73 6f |ed (to c|reate so|
|000062e0| 6d 65 74 68 69 6e 67 20 | 61 6e 61 6c 6f 67 6f 75 |mething |analogou|
|000062f0| 73 20 74 6f 20 66 70 72 | 69 6e 74 66 29 2e 0a 0a |s to fpr|intf)...|
|00006300| 20 20 20 54 68 69 73 20 | 63 61 70 61 62 69 6c 69 | This |capabili|
|00006310| 74 79 20 69 73 20 61 6e | 61 6c 6f 67 6f 75 73 20 |ty is an|alogous |
|00006320| 74 6f 20 74 68 61 74 20 | 70 72 6f 76 69 64 65 64 |to that |provided|
|00006330| 20 62 79 20 74 68 65 20 | 22 3c 3c 22 20 73 74 72 | by the |"<<" str|
|00006340| 65 61 6d 0a 20 20 20 6f | 70 65 72 61 74 6f 72 20 |eam. o|perator |
|00006350| 6f 66 20 43 2b 2b 2e 0a | 0a 20 20 20 20 20 5f 5f |of C++..|. __|
|00006360| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00006370| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00006380| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 5f |________|________|
|00006390| 5f 5f 5f 5f 5f 5f 5f 5f | 5f 5f 5f 5f 5f 5f 5f 0a |________|_______.|
|000063a0| 0a 0a 31 30 3a 20 49 6e | 74 65 72 66 61 63 69 6e |..10: In|terfacin|
|000063b0| 67 20 77 69 74 68 20 41 | 64 61 0a 0a 0a 31 30 2e |g with A|da...10.|
|000063c0| 31 3a 20 49 20 61 6d 20 | 77 72 69 74 69 6e 67 20 |1: I am |writing |
|000063d0| 73 6f 66 74 77 61 72 65 | 20 74 68 61 74 20 75 73 |software| that us|
|000063e0| 65 64 20 74 68 65 20 44 | 69 73 74 72 69 62 75 74 |ed the D|istribut|
|000063f0| 65 64 20 49 6e 74 65 72 | 61 63 74 69 76 65 20 53 |ed Inter|active S|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.