home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / OB3.2D1.DMS / in.adf / ModulaToOberon < prev    next >
Mailbox/MIME Entity  |  1992-10-15  |  29.0 KB

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: Mailbox/MIME Entity (archive/mbox).

You can browse this item here: ModulaToOberon

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file Mailbox text, 1st line "From Modula to Oberon", ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried x-fmt/111 Plain Text File default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime application/mbox default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 46 72 6f 6d 20 4d 6f 64 | 75 6c 61 20 74 6f 20 4f |From Mod|ula to O|
|00000010| 62 65 72 6f 6e 0a 0a 4e | 2e 20 57 69 72 74 68 0a |beron..N|. Wirth.|
|00000020| 0a 41 62 73 74 72 61 63 | 74 0a 0a 54 68 65 20 70 |.Abstrac|t..The p|
|00000030| 72 6f 67 72 61 6d 6d 69 | 6e 67 20 6c 61 6e 67 75 |rogrammi|ng langu|
|00000040| 61 67 65 20 4f 62 65 72 | 6f 6e 20 69 73 20 74 68 |age Ober|on is th|
|00000050| 65 20 72 65 73 75 6c 74 | 20 6f 66 20 61 20 63 6f |e result| of a co|
|00000060| 6e 63 65 6e 74 72 61 74 | 65 64 20 65 66 66 6f 72 |ncentrat|ed effor|
|00000070| 74 20 74 6f 0a 69 6e 63 | 72 65 61 73 65 20 74 68 |t to.inc|rease th|
|00000080| 65 20 70 6f 77 65 72 20 | 6f 66 20 4d 6f 64 75 6c |e power |of Modul|
|00000090| 61 2d 32 20 61 6e 64 20 | 73 69 6d 75 6c 74 61 6e |a-2 and |simultan|
|000000a0| 65 6f 75 73 6c 79 20 74 | 6f 20 72 65 64 75 63 65 |eously t|o reduce|
|000000b0| 20 69 74 73 20 63 6f 6d | 70 6c 65 78 69 74 79 2e | its com|plexity.|
|000000c0| 0a 53 65 76 65 72 61 6c | 20 66 65 61 74 75 72 65 |.Several| feature|
|000000d0| 73 20 77 65 72 65 20 65 | 6c 69 6d 69 6e 61 74 65 |s were e|liminate|
|000000e0| 64 2c 20 61 6e 64 20 61 | 20 66 65 77 20 77 65 72 |d, and a| few wer|
|000000f0| 65 20 61 64 64 65 64 20 | 69 6e 20 6f 72 64 65 72 |e added |in order|
|00000100| 20 74 6f 20 69 6e 63 72 | 65 61 73 65 0a 74 68 65 | to incr|ease.the|
|00000110| 20 65 78 70 72 65 73 73 | 69 76 65 20 70 6f 77 65 | express|ive powe|
|00000120| 72 20 61 6e 64 20 66 6c | 65 78 69 62 69 6c 69 74 |r and fl|exibilit|
|00000130| 79 20 6f 66 20 74 68 65 | 20 6c 61 6e 67 75 61 67 |y of the| languag|
|00000140| 65 2e 20 54 68 69 73 20 | 70 61 70 65 72 20 64 65 |e. This |paper de|
|00000150| 73 63 72 69 62 65 73 0a | 61 6e 64 20 6d 6f 74 69 |scribes.|and moti|
|00000160| 76 61 74 65 73 20 74 68 | 65 20 63 68 61 6e 67 65 |vates th|e change|
|00000170| 73 2e 20 54 68 65 20 6c | 61 6e 67 75 61 67 65 20 |s. The l|anguage |
|00000180| 69 73 20 64 65 66 69 6e | 65 64 20 69 6e 20 61 20 |is defin|ed in a |
|00000190| 63 6f 6e 63 69 73 65 20 | 72 65 70 6f 72 74 2e 0a |concise |report..|
|000001a0| 0a 49 6e 74 72 6f 64 75 | 63 74 69 6f 6e 0a 0a 54 |.Introdu|ction..T|
|000001b0| 68 65 20 70 72 6f 67 72 | 61 6d 6d 69 6e 67 20 6c |he progr|amming l|
|000001c0| 61 6e 67 75 61 67 65 20 | 4f 62 65 72 6f 6e 20 65 |anguage |Oberon e|
|000001d0| 76 6f 6c 76 65 64 20 66 | 72 6f 6d 20 61 20 70 72 |volved f|rom a pr|
|000001e0| 6f 6a 65 63 74 20 77 68 | 6f 73 65 20 67 6f 61 6c |oject wh|ose goal|
|000001f0| 20 77 61 73 20 74 68 65 | 0a 64 65 73 69 67 6e 20 | was the|.design |
|00000200| 6f 66 20 61 20 6d 6f 64 | 65 72 6e 2c 20 66 6c 65 |of a mod|ern, fle|
|00000210| 78 69 62 6c 65 2c 20 61 | 6e 64 20 65 66 66 69 63 |xible, a|nd effic|
|00000220| 69 65 6e 74 20 6f 70 65 | 72 61 74 69 6e 67 20 73 |ient ope|rating s|
|00000230| 79 73 74 65 6d 20 66 6f | 72 20 61 0a 73 69 6e 67 |ystem fo|r a.sing|
|00000240| 6c 65 2d 75 73 65 72 20 | 77 6f 72 6b 73 74 61 74 |le-user |workstat|
|00000250| 69 6f 6e 2e 20 41 20 70 | 72 69 6e 63 69 70 61 6c |ion. A p|rincipal|
|00000260| 20 67 75 69 64 65 6c 69 | 6e 65 20 77 61 73 20 74 | guideli|ne was t|
|00000270| 6f 20 63 6f 6e 63 65 6e | 74 72 61 74 65 20 6f 6e |o concen|trate on|
|00000280| 0a 70 72 6f 70 65 72 74 | 69 65 73 20 74 68 61 74 |.propert|ies that|
|00000290| 20 61 72 65 20 67 65 6e | 75 69 6e 65 6c 79 20 65 | are gen|uinely e|
|000002a0| 73 73 65 6e 74 69 61 6c | 20 61 6e 64 20 2d 20 61 |ssential| and - a|
|000002b0| 73 20 61 20 63 6f 6e 73 | 65 71 75 65 6e 63 65 20 |s a cons|equence |
|000002c0| 2d 20 74 6f 20 6f 6d 69 | 74 0a 65 70 68 65 6d 65 |- to omi|t.epheme|
|000002d0| 72 61 6c 20 69 73 73 75 | 65 73 2e 20 49 74 20 69 |ral issu|es. It i|
|000002e0| 73 20 74 68 65 20 62 65 | 73 74 20 77 61 79 20 74 |s the be|st way t|
|000002f0| 6f 20 6b 65 65 70 20 61 | 20 73 79 73 74 65 6d 20 |o keep a| system |
|00000300| 69 6e 20 68 61 6e 64 2c | 20 74 6f 20 6d 61 6b 65 |in hand,| to make|
|00000310| 20 69 74 0a 75 6e 64 65 | 72 73 74 61 6e 64 61 62 | it.unde|rstandab|
|00000320| 6c 65 2c 20 65 78 70 6c | 69 63 61 62 6c 65 2c 20 |le, expl|icable, |
|00000330| 72 65 6c 69 61 62 6c 65 | 2c 20 61 6e 64 20 65 66 |reliable|, and ef|
|00000340| 66 69 63 69 65 6e 74 6c | 79 20 69 6d 70 6c 65 6d |ficientl|y implem|
|00000350| 65 6e 74 61 62 6c 65 2e | 0a 0a 49 6e 69 74 69 61 |entable.|..Initia|
|00000360| 6c 6c 79 2c 20 69 74 20 | 77 61 73 20 70 6c 61 6e |lly, it |was plan|
|00000370| 6e 65 64 20 74 6f 20 65 | 78 70 72 65 73 73 20 74 |ned to e|xpress t|
|00000380| 68 65 20 73 79 73 74 65 | 6d 20 69 6e 20 4d 6f 64 |he syste|m in Mod|
|00000390| 75 6c 61 2d 32 20 5b 31 | 5d 0a 28 73 75 62 73 65 |ula-2 [1|].(subse|
|000003a0| 71 75 65 6e 74 6c 79 20 | 63 61 6c 6c 65 64 20 4d |quently |called M|
|000003b0| 6f 64 75 6c 61 29 2c 20 | 61 73 20 74 68 61 74 20 |odula), |as that |
|000003c0| 6c 61 6e 67 75 61 67 65 | 20 73 75 70 70 6f 72 74 |language| support|
|000003d0| 73 20 74 68 65 20 6e 6f | 74 69 6f 6e 20 6f 66 0a |s the no|tion of.|
|000003e0| 6d 6f 64 75 6c 61 72 20 | 64 65 73 69 67 6e 20 71 |modular |design q|
|000003f0| 75 69 74 65 20 65 66 66 | 65 63 74 69 76 65 6c 79 |uite eff|ectively|
|00000400| 2c 20 61 6e 64 20 62 65 | 63 61 75 73 65 20 61 6e |, and be|cause an|
|00000410| 20 6f 70 65 72 61 74 69 | 6e 67 20 73 79 73 74 65 | operati|ng syste|
|00000420| 6d 20 68 61 73 20 74 6f | 20 62 65 0a 64 65 73 69 |m has to| be.desi|
|00000430| 67 6e 65 64 20 69 6e 20 | 74 65 72 6d 73 20 6f 66 |gned in |terms of|
|00000440| 20 73 65 70 61 72 61 74 | 65 6c 79 20 63 6f 6d 70 | separat|ely comp|
|00000450| 69 6c 61 62 6c 65 20 70 | 61 72 74 73 20 77 69 74 |ilable p|arts wit|
|00000460| 68 20 63 6f 6e 73 63 69 | 65 6e 74 69 6f 75 73 6c |h consci|entiousl|
|00000470| 79 0a 63 68 6f 73 65 6e | 20 69 6e 74 65 72 66 61 |y.chosen| interfa|
|00000480| 63 65 73 2e 20 49 6e 20 | 66 61 63 74 2c 20 61 6e |ces. In |fact, an|
|00000490| 20 6f 70 65 72 61 74 69 | 6e 67 20 73 79 73 74 65 | operati|ng syste|
|000004a0| 6d 20 73 68 6f 75 6c 64 | 20 62 65 20 6e 6f 20 6d |m should| be no m|
|000004b0| 6f 72 65 20 74 68 61 6e | 20 61 0a 73 65 74 20 6f |ore than| a.set o|
|000004c0| 66 20 62 61 73 69 63 20 | 6d 6f 64 75 6c 65 73 2c |f basic |modules,|
|000004d0| 20 61 6e 64 20 74 68 65 | 20 64 65 73 69 67 6e 20 | and the| design |
|000004e0| 6f 66 20 61 6e 20 61 70 | 70 6c 69 63 61 74 69 6f |of an ap|plicatio|
|000004f0| 6e 20 6d 75 73 74 20 62 | 65 20 63 6f 6e 73 69 64 |n must b|e consid|
|00000500| 65 72 65 64 0a 61 73 20 | 61 20 67 6f 61 6c 2d 6f |ered.as |a goal-o|
|00000510| 72 69 65 6e 74 65 64 20 | 65 78 74 65 6e 73 69 6f |riented |extensio|
|00000520| 6e 20 6f 66 20 74 68 61 | 74 20 62 61 73 69 63 20 |n of tha|t basic |
|00000530| 73 65 74 3a 20 50 72 6f | 67 72 61 6d 6d 69 6e 67 |set: Pro|gramming|
|00000540| 20 69 73 20 61 6c 77 61 | 79 73 0a 65 78 74 65 6e | is alwa|ys.exten|
|00000550| 64 69 6e 67 20 61 20 67 | 69 76 65 6e 20 73 79 73 |ding a g|iven sys|
|00000560| 74 65 6d 2e 0a 0a 57 68 | 65 72 65 61 73 20 6d 6f |tem...Wh|ereas mo|
|00000570| 64 65 72 6e 20 6c 61 6e | 67 75 61 67 65 73 2c 20 |dern lan|guages, |
|00000580| 73 75 63 68 20 61 73 20 | 4d 6f 64 75 6c 61 2c 20 |such as |Modula, |
|00000590| 73 75 70 70 6f 72 74 20 | 74 68 65 20 6e 6f 74 69 |support |the noti|
|000005a0| 6f 6e 20 6f 66 0a 65 78 | 74 65 6e 73 69 62 69 6c |on of.ex|tensibil|
|000005b0| 69 74 79 20 69 6e 20 74 | 68 65 20 70 72 6f 63 65 |ity in t|he proce|
|000005c0| 64 75 72 61 6c 20 72 65 | 61 6c 6d 2c 20 74 68 65 |dural re|alm, the|
|000005d0| 20 6e 6f 74 69 6f 6e 20 | 69 73 20 6c 65 73 73 20 | notion |is less |
|000005e0| 77 65 6c 6c 20 65 73 74 | 61 62 6c 69 73 68 65 64 |well est|ablished|
|000005f0| 0a 69 6e 20 74 68 65 20 | 64 6f 6d 61 69 6e 20 6f |.in the |domain o|
|00000600| 66 20 64 61 74 61 20 74 | 79 70 65 73 2e 20 49 6e |f data t|ypes. In|
|00000610| 20 70 61 72 74 69 63 75 | 6c 61 72 2c 20 4d 6f 64 | particu|lar, Mod|
|00000620| 75 6c 61 20 64 6f 65 73 | 20 6e 6f 74 20 61 6c 6c |ula does| not all|
|00000630| 6f 77 20 74 68 65 0a 64 | 65 66 69 6e 69 74 69 6f |ow the.d|efinitio|
|00000640| 6e 20 6f 66 20 6e 65 77 | 20 64 61 74 61 20 74 79 |n of new| data ty|
|00000650| 70 65 73 20 61 73 20 65 | 78 74 65 6e 73 69 6f 6e |pes as e|xtension|
|00000660| 73 20 6f 66 20 6f 74 68 | 65 72 2c 20 70 72 6f 67 |s of oth|er, prog|
|00000670| 72 61 6d 6d 65 72 2d 64 | 65 66 69 6e 65 64 0a 74 |rammer-d|efined.t|
|00000680| 79 70 65 73 20 69 6e 20 | 61 6e 20 61 64 65 71 75 |ypes in |an adequ|
|00000690| 61 74 65 20 6d 61 6e 6e | 65 72 2e 20 41 6e 20 61 |ate mann|er. An a|
|000006a0| 64 64 69 74 69 6f 6e 61 | 6c 20 66 65 61 74 75 72 |dditiona|l featur|
|000006b0| 65 20 77 61 73 20 63 61 | 6c 6c 65 64 20 66 6f 72 |e was ca|lled for|
|000006c0| 2c 20 74 68 65 72 65 62 | 79 0a 67 69 76 69 6e 67 |, thereb|y.giving|
|000006d0| 20 72 69 73 65 20 74 6f | 20 61 6e 20 65 78 74 65 | rise to| an exte|
|000006e0| 6e 73 69 6f 6e 20 6f 66 | 20 4d 6f 64 75 6c 61 2e |nsion of| Modula.|
|000006f0| 0a 0a 54 68 65 20 63 6f | 6e 63 65 70 74 20 6f 66 |..The co|ncept of|
|00000700| 20 74 68 65 20 70 6c 61 | 6e 6e 65 64 20 6f 70 65 | the pla|nned ope|
|00000710| 72 61 74 69 6e 67 20 73 | 79 73 74 65 6d 20 61 6c |rating s|ystem al|
|00000720| 73 6f 20 63 61 6c 6c 65 | 64 20 66 6f 72 20 61 20 |so calle|d for a |
|00000730| 68 69 67 68 6c 79 0a 64 | 79 6e 61 6d 69 63 2c 20 |highly.d|ynamic, |
|00000740| 63 65 6e 74 72 61 6c 69 | 7a 65 64 20 73 74 6f 72 |centrali|zed stor|
|00000750| 61 67 65 20 6d 61 6e 61 | 67 65 6d 65 6e 74 20 72 |age mana|gement r|
|00000760| 65 6c 79 69 6e 67 20 6f | 6e 20 74 68 65 20 74 65 |elying o|n the te|
|00000770| 63 68 6e 69 71 75 65 20 | 6f 66 20 67 61 72 62 61 |chnique |of garba|
|00000780| 67 65 0a 63 6f 6c 6c 65 | 63 74 69 6f 6e 2e 20 41 |ge.colle|ction. A|
|00000790| 6c 74 68 6f 75 67 68 20 | 4d 6f 64 75 6c 61 20 64 |lthough |Modula d|
|000007a0| 6f 65 73 20 6e 6f 74 20 | 70 72 65 76 65 6e 74 20 |oes not |prevent |
|000007b0| 74 68 65 20 69 6e 63 6f | 72 70 6f 72 61 74 69 6f |the inco|rporatio|
|000007c0| 6e 20 6f 66 20 61 20 67 | 61 72 62 61 67 65 0a 63 |n of a g|arbage.c|
|000007d0| 6f 6c 6c 65 63 74 6f 72 | 20 69 6e 20 70 72 69 6e |ollector| in prin|
|000007e0| 63 69 70 6c 65 2c 20 69 | 74 73 20 76 61 72 69 61 |ciple, i|ts varia|
|000007f0| 6e 74 20 72 65 63 6f 72 | 64 20 66 65 61 74 75 72 |nt recor|d featur|
|00000800| 65 20 63 6f 6e 73 74 69 | 74 75 74 65 73 20 61 20 |e consti|tutes a |
|00000810| 67 65 6e 75 69 6e 65 0a | 6f 62 73 74 61 63 6c 65 |genuine.|obstacle|
|00000820| 2e 20 41 73 20 74 68 65 | 20 6e 65 77 20 66 61 63 |. As the| new fac|
|00000830| 69 6c 69 74 79 20 66 6f | 72 20 65 78 74 65 6e 64 |ility fo|r extend|
|00000840| 69 6e 67 20 74 79 70 65 | 73 20 77 6f 75 6c 64 20 |ing type|s would |
|00000850| 6d 61 6b 65 20 74 68 65 | 20 76 61 72 69 61 6e 74 |make the| variant|
|00000860| 0a 72 65 63 6f 72 64 20 | 66 65 61 74 75 72 65 20 |.record |feature |
|00000870| 73 75 70 65 72 66 6c 75 | 6f 75 73 2c 20 74 68 65 |superflu|ous, the|
|00000880| 20 72 65 6d 6f 76 61 6c | 20 6f 66 20 74 68 69 73 | removal| of this|
|00000890| 20 73 74 75 6d 62 6c 69 | 6e 67 20 62 6c 6f 63 6b | stumbli|ng block|
|000008a0| 20 77 61 73 20 61 0a 6c | 6f 67 69 63 61 6c 20 64 | was a.l|ogical d|
|000008b0| 65 63 69 73 69 6f 6e 2e | 20 54 68 69 73 20 73 74 |ecision.| This st|
|000008c0| 65 70 2c 20 68 6f 77 65 | 76 65 72 2c 20 67 61 76 |ep, howe|ver, gav|
|000008d0| 65 20 72 69 73 65 20 74 | 6f 20 61 20 72 65 73 74 |e rise t|o a rest|
|000008e0| 72 69 63 74 69 6f 6e 20 | 28 73 75 62 73 65 74 29 |riction |(subset)|
|000008f0| 0a 6f 66 20 4d 6f 64 75 | 6c 61 2e 0a 0a 49 74 20 |.of Modu|la...It |
|00000900| 73 6f 6f 6e 20 62 65 63 | 61 6d 65 20 63 6c 65 61 |soon bec|ame clea|
|00000910| 72 20 74 68 61 74 20 74 | 68 65 20 72 75 6c 65 20 |r that t|he rule |
|00000920| 74 6f 20 63 6f 6e 63 65 | 6e 74 72 61 74 65 20 6f |to conce|ntrate o|
|00000930| 6e 20 74 68 65 20 65 73 | 73 65 6e 74 69 61 6c 20 |n the es|sential |
|00000940| 61 6e 64 20 74 6f 0a 65 | 6c 69 6d 69 6e 61 74 65 |and to.e|liminate|
|00000950| 20 74 68 65 20 69 6e 65 | 73 73 65 6e 74 69 61 6c | the ine|ssential|
|00000960| 20 73 68 6f 75 6c 64 20 | 6e 6f 74 20 6f 6e 6c 79 | should |not only|
|00000970| 20 62 65 20 61 70 70 6c | 69 65 64 20 74 6f 20 74 | be appl|ied to t|
|00000980| 68 65 20 64 65 73 69 67 | 6e 20 6f 66 20 74 68 65 |he desig|n of the|
|00000990| 0a 6e 65 77 20 73 79 73 | 74 65 6d 2c 20 62 75 74 |.new sys|tem, but|
|000009a0| 20 65 71 75 61 6c 6c 79 | 20 73 74 72 69 6e 67 65 | equally| stringe|
|000009b0| 6e 74 6c 79 20 74 6f 20 | 74 68 65 20 6c 61 6e 67 |ntly to |the lang|
|000009c0| 75 61 67 65 20 69 6e 20 | 77 68 69 63 68 20 74 68 |uage in |which th|
|000009d0| 65 20 73 79 73 74 65 6d | 20 69 73 0a 66 6f 72 6d |e system| is.form|
|000009e0| 75 6c 61 74 65 64 2e 20 | 54 68 65 20 61 70 70 6c |ulated. |The appl|
|000009f0| 69 63 61 74 69 6f 6e 20 | 6f 66 20 74 68 65 20 70 |ication |of the p|
|00000a00| 72 69 6e 63 69 70 6c 65 | 20 74 68 75 73 20 6c 65 |rinciple| thus le|
|00000a10| 64 20 66 72 6f 6d 20 4d | 6f 64 75 6c 61 20 74 6f |d from M|odula to|
|00000a20| 20 61 20 6e 65 77 0a 6c | 61 6e 67 75 61 67 65 2e | a new.l|anguage.|
|00000a30| 20 48 6f 77 65 76 65 72 | 2c 20 74 68 65 20 61 64 | However|, the ad|
|00000a40| 6a 65 63 74 69 76 65 20 | 22 6e 65 77 22 20 68 61 |jective |"new" ha|
|00000a50| 73 20 74 6f 20 62 65 20 | 75 6e 64 65 72 73 74 6f |s to be |understo|
|00000a60| 6f 64 20 69 6e 20 70 72 | 6f 70 65 72 0a 63 6f 6e |od in pr|oper.con|
|00000a70| 74 65 78 74 3a 20 4f 62 | 65 72 6f 6e 20 65 76 6f |text: Ob|eron evo|
|00000a80| 6c 76 65 64 20 66 72 6f | 6d 20 4d 6f 64 75 6c 61 |lved fro|m Modula|
|00000a90| 20 62 79 20 76 65 72 79 | 20 66 65 77 20 61 64 64 | by very| few add|
|00000aa0| 69 74 69 6f 6e 73 20 61 | 6e 64 20 73 65 76 65 72 |itions a|nd sever|
|00000ab0| 61 6c 0a 73 75 62 74 72 | 61 63 74 69 6f 6e 73 2e |al.subtr|actions.|
|00000ac0| 20 49 6e 20 72 65 6c 79 | 69 6e 67 20 6f 6e 20 65 | In rely|ing on e|
|00000ad0| 76 6f 6c 75 74 69 6f 6e | 20 72 61 74 68 65 72 20 |volution| rather |
|00000ae0| 74 68 61 6e 20 72 65 76 | 6f 6c 75 74 69 6f 6e 20 |than rev|olution |
|00000af0| 77 65 20 72 65 6d 61 69 | 6e 20 69 6e 0a 74 68 65 |we remai|n in.the|
|00000b00| 20 74 72 61 64 69 74 69 | 6f 6e 20 6f 66 20 61 20 | traditi|on of a |
|00000b10| 6c 6f 6e 67 20 64 65 76 | 65 6c 6f 70 6d 65 6e 74 |long dev|elopment|
|00000b20| 20 74 68 61 74 20 6c 65 | 64 20 66 72 6f 6d 20 41 | that le|d from A|
|00000b30| 6c 67 6f 6c 20 74 6f 20 | 50 61 73 63 61 6c 2c 20 |lgol to |Pascal, |
|00000b40| 74 68 65 6e 20 74 6f 0a | 4d 6f 64 75 6c 61 2d 32 |then to.|Modula-2|
|00000b50| 2c 20 61 6e 64 20 65 76 | 65 6e 74 75 61 6c 6c 79 |, and ev|entually|
|00000b60| 20 74 6f 20 4f 62 65 72 | 6f 6e 2e 20 54 68 65 20 | to Ober|on. The |
|00000b70| 63 6f 6d 6d 6f 6e 20 74 | 72 61 69 74 73 20 6f 66 |common t|raits of|
|00000b80| 20 74 68 65 73 65 20 6c | 61 6e 67 75 61 67 65 73 | these l|anguages|
|00000b90| 0a 61 72 65 20 74 68 65 | 69 72 20 70 72 6f 63 65 |.are the|ir proce|
|00000ba0| 64 75 72 61 6c 20 72 61 | 74 68 65 72 20 74 68 61 |dural ra|ther tha|
|00000bb0| 6e 20 66 75 6e 63 74 69 | 6f 6e 61 6c 20 6d 6f 64 |n functi|onal mod|
|00000bc0| 65 6c 20 61 6e 64 20 74 | 68 65 20 73 74 72 69 63 |el and t|he stric|
|00000bd0| 74 20 74 79 70 69 6e 67 | 20 6f 66 0a 64 61 74 61 |t typing| of.data|
|00000be0| 2e 20 45 76 65 6e 20 6d | 6f 72 65 20 66 75 6e 64 |. Even m|ore fund|
|00000bf0| 61 6d 65 6e 74 61 6c 2c | 20 70 65 72 68 61 70 73 |amental,| perhaps|
|00000c00| 2c 20 69 73 20 74 68 65 | 20 69 64 65 61 20 6f 66 |, is the| idea of|
|00000c10| 20 61 62 73 74 72 61 63 | 74 69 6f 6e 3a 20 74 68 | abstrac|tion: th|
|00000c20| 65 0a 6c 61 6e 67 75 61 | 67 65 20 6d 75 73 74 20 |e.langua|ge must |
|00000c30| 62 65 20 64 65 66 69 6e | 65 64 20 69 6e 20 74 65 |be defin|ed in te|
|00000c40| 72 6d 73 20 6f 66 20 6d | 61 74 68 65 6d 61 74 69 |rms of m|athemati|
|00000c50| 63 61 6c 2c 20 61 62 73 | 74 72 61 63 74 20 63 6f |cal, abs|tract co|
|00000c60| 6e 63 65 70 74 73 0a 77 | 69 74 68 6f 75 74 20 72 |ncepts.w|ithout r|
|00000c70| 65 66 65 72 65 6e 63 65 | 20 74 6f 20 61 6e 79 20 |eference| to any |
|00000c80| 63 6f 6d 70 75 74 69 6e | 67 20 6d 65 63 68 61 6e |computin|g mechan|
|00000c90| 69 73 6d 2e 20 4f 6e 6c | 79 20 69 66 20 61 20 6c |ism. Onl|y if a l|
|00000ca0| 61 6e 67 75 61 67 65 20 | 73 61 74 69 73 66 69 65 |anguage |satisfie|
|00000cb0| 73 0a 74 68 69 73 20 63 | 72 69 74 65 72 69 6f 6e |s.this c|riterion|
|00000cc0| 2c 20 63 61 6e 20 69 74 | 20 62 65 20 63 61 6c 6c |, can it| be call|
|00000cd0| 65 64 20 22 68 69 67 68 | 65 72 2d 6c 65 76 65 6c |ed "high|er-level|
|00000ce0| 22 2e 20 4e 6f 20 73 79 | 6e 74 61 63 74 69 63 20 |". No sy|ntactic |
|00000cf0| 63 6f 61 74 69 6e 67 0a | 77 68 61 74 73 6f 65 76 |coating.|whatsoev|
|00000d00| 65 72 20 63 61 6e 20 65 | 61 72 6e 20 61 20 6c 61 |er can e|arn a la|
|00000d10| 6e 67 75 61 67 65 20 74 | 68 69 73 20 61 74 74 72 |nguage t|his attr|
|00000d20| 69 62 75 74 65 20 61 6c | 6f 6e 65 2e 0a 0a 54 68 |ibute al|one...Th|
|00000d30| 65 20 64 65 66 69 6e 69 | 74 69 6f 6e 20 6f 66 20 |e defini|tion of |
|00000d40| 61 20 6c 61 6e 67 75 61 | 67 65 20 6d 75 73 74 20 |a langua|ge must |
|00000d50| 62 65 20 63 6f 68 65 72 | 65 6e 74 20 61 6e 64 20 |be coher|ent and |
|00000d60| 63 6f 6e 63 69 73 65 2e | 20 54 68 69 73 20 63 61 |concise.| This ca|
|00000d70| 6e 20 6f 6e 6c 79 20 62 | 65 0a 61 63 68 69 65 76 |n only b|e.achiev|
|00000d80| 65 64 20 62 79 20 61 20 | 63 61 72 65 66 75 6c 20 |ed by a |careful |
|00000d90| 63 68 6f 69 63 65 20 6f | 66 20 74 68 65 20 75 6e |choice o|f the un|
|00000da0| 64 65 72 6c 79 69 6e 67 | 20 61 62 73 74 72 61 63 |derlying| abstrac|
|00000db0| 74 69 6f 6e 73 20 61 6e | 64 20 61 6e 0a 61 70 70 |tions an|d an.app|
|00000dc0| 72 6f 70 72 69 61 74 65 | 20 73 74 72 75 63 74 75 |ropriate| structu|
|00000dd0| 72 65 20 63 6f 6d 62 69 | 6e 69 6e 67 20 74 68 65 |re combi|ning the|
|00000de0| 6d 2e 20 54 68 65 20 6c | 61 6e 67 75 61 67 65 20 |m. The l|anguage |
|00000df0| 6d 61 6e 75 61 6c 20 6d | 75 73 74 20 62 65 0a 72 |manual m|ust be.r|
|00000e00| 65 61 73 6f 6e 61 62 6c | 79 20 73 68 6f 72 74 2c |easonabl|y short,|
|00000e10| 20 61 76 6f 69 64 69 6e | 67 20 74 68 65 20 65 78 | avoidin|g the ex|
|00000e20| 70 6c 61 6e 61 74 69 6f | 6e 20 6f 66 20 69 6e 64 |planatio|n of ind|
|00000e30| 69 76 69 64 75 61 6c 20 | 63 61 73 65 73 20 64 65 |ividual |cases de|
|00000e40| 72 69 76 61 62 6c 65 0a | 66 72 6f 6d 20 74 68 65 |rivable.|from the|
|00000e50| 20 67 65 6e 65 72 61 6c | 20 72 75 6c 65 73 2e 20 | general| rules. |
|00000e60| 54 68 65 20 70 6f 77 65 | 72 20 6f 66 20 61 20 66 |The powe|r of a f|
|00000e70| 6f 72 6d 61 6c 69 73 6d | 20 6d 75 73 74 20 6e 6f |ormalism| must no|
|00000e80| 74 20 62 65 20 6d 65 61 | 73 75 72 65 64 20 62 79 |t be mea|sured by|
|00000e90| 0a 74 68 65 20 6c 65 6e | 67 74 68 20 6f 66 20 69 |.the len|gth of i|
|00000ea0| 74 73 20 64 65 73 63 72 | 69 70 74 69 6f 6e 2e 20 |ts descr|iption. |
|00000eb0| 54 6f 20 74 68 65 20 63 | 6f 6e 74 72 61 72 79 2c |To the c|ontrary,|
|00000ec0| 20 61 6e 20 6f 76 65 72 | 6c 79 20 6c 65 6e 67 74 | an over|ly lengt|
|00000ed0| 68 79 0a 64 65 66 69 6e | 69 74 69 6f 6e 20 69 73 |hy.defin|ition is|
|00000ee0| 20 61 20 73 75 72 65 20 | 73 79 6d 70 74 6f 6d 20 | a sure |symptom |
|00000ef0| 6f 66 20 69 6e 61 64 65 | 71 75 61 63 79 2e 20 49 |of inade|quacy. I|
|00000f00| 6e 20 74 68 69 73 20 72 | 65 73 70 65 63 74 2c 20 |n this r|espect, |
|00000f10| 6e 6f 74 20 63 6f 6d 70 | 6c 65 78 69 74 79 0a 62 |not comp|lexity.b|
|00000f20| 75 74 20 73 69 6d 70 6c | 69 63 69 74 79 20 6d 75 |ut simpl|icity mu|
|00000f30| 73 74 20 62 65 20 74 68 | 65 20 67 6f 61 6c 2e 0a |st be th|e goal..|
|00000f40| 0a 49 6e 20 73 70 69 74 | 65 20 6f 66 20 69 74 73 |.In spit|e of its|
|00000f50| 20 62 72 65 76 69 74 79 | 2c 20 61 20 64 65 73 63 | brevity|, a desc|
|00000f60| 72 69 70 74 69 6f 6e 20 | 6d 75 73 74 20 62 65 20 |ription |must be |
|00000f70| 63 6f 6d 70 6c 65 74 65 | 2e 20 43 6f 6d 70 6c 65 |complete|. Comple|
|00000f80| 74 65 6e 65 73 73 20 69 | 73 20 74 6f 0a 62 65 20 |teness i|s to.be |
|00000f90| 61 63 68 69 65 76 65 64 | 20 77 69 74 68 69 6e 20 |achieved| within |
|00000fa0| 74 68 65 20 66 72 61 6d | 65 77 6f 72 6b 20 6f 66 |the fram|ework of|
|00000fb0| 20 74 68 65 20 63 68 6f | 73 65 6e 20 61 62 73 74 | the cho|sen abst|
|00000fc0| 72 61 63 74 69 6f 6e 73 | 2e 20 4c 69 6d 69 74 61 |ractions|. Limita|
|00000fd0| 74 69 6f 6e 73 0a 69 6d | 70 6f 73 65 64 20 62 79 |tions.im|posed by|
|00000fe0| 20 70 61 72 74 69 63 75 | 6c 61 72 20 69 6d 70 6c | particu|lar impl|
|00000ff0| 65 6d 65 6e 74 61 74 69 | 6f 6e 73 20 64 6f 20 6e |ementati|ons do n|
|00001000| 6f 74 20 62 65 6c 6f 6e | 67 20 74 6f 20 61 20 6c |ot belon|g to a l|
|00001010| 61 6e 67 75 61 67 65 0a | 64 65 66 69 6e 69 74 69 |anguage.|definiti|
|00001020| 6f 6e 20 70 72 6f 70 65 | 72 2e 20 45 78 61 6d 70 |on prope|r. Examp|
|00001030| 6c 65 73 20 6f 66 20 73 | 75 63 68 20 72 65 73 74 |les of s|uch rest|
|00001040| 72 69 63 74 69 6f 6e 73 | 20 61 72 65 20 74 68 65 |rictions| are the|
|00001050| 20 6d 61 78 69 6d 75 6d | 20 76 61 6c 75 65 73 20 | maximum| values |
|00001060| 6f 66 0a 6e 75 6d 62 65 | 72 73 2c 20 72 6f 75 6e |of.numbe|rs, roun|
|00001070| 64 69 6e 67 20 61 6e 64 | 20 74 72 75 6e 63 61 74 |ding and| truncat|
|00001080| 69 6f 6e 20 65 72 72 6f | 72 73 20 69 6e 20 61 72 |ion erro|rs in ar|
|00001090| 69 74 68 6d 65 74 69 63 | 2c 20 61 6e 64 20 61 63 |ithmetic|, and ac|
|000010a0| 74 69 6f 6e 73 20 74 61 | 6b 65 6e 0a 77 68 65 6e |tions ta|ken.when|
|000010b0| 20 61 20 70 72 6f 67 72 | 61 6d 20 76 69 6f 6c 61 | a progr|am viola|
|000010c0| 74 65 73 20 74 68 65 20 | 73 74 61 74 65 64 20 72 |tes the |stated r|
|000010d0| 75 6c 65 73 2e 20 49 74 | 20 73 68 6f 75 6c 64 20 |ules. It| should |
|000010e0| 6e 6f 74 20 62 65 20 6e | 65 63 65 73 73 61 72 79 |not be n|ecessary|
|000010f0| 20 74 6f 0a 73 75 70 70 | 6c 65 6d 65 6e 74 20 61 | to.supp|lement a|
|00001100| 20 6c 61 6e 67 75 61 67 | 65 20 64 65 66 69 6e 69 | languag|e defini|
|00001110| 74 69 6f 6e 20 77 69 74 | 68 20 61 20 76 6f 6c 75 |tion wit|h a volu|
|00001120| 6d 69 6e 6f 75 73 20 73 | 74 61 6e 64 61 72 64 73 |minous s|tandards|
|00001130| 20 64 6f 63 75 6d 65 6e | 74 20 74 6f 0a 63 6f 76 | documen|t to.cov|
|00001140| 65 72 20 22 75 6e 66 6f | 72 65 73 65 65 6e 22 20 |er "unfo|reseen" |
|00001150| 63 61 73 65 73 2e 0a 0a | 42 75 74 20 6e 65 69 74 |cases...|But neit|
|00001160| 68 65 72 20 73 68 6f 75 | 6c 64 20 61 20 70 72 6f |her shou|ld a pro|
|00001170| 67 72 61 6d 6d 69 6e 67 | 20 6c 61 6e 67 75 61 67 |gramming| languag|
|00001180| 65 20 62 65 20 61 20 6d | 61 74 68 65 6d 61 74 69 |e be a m|athemati|
|00001190| 63 61 6c 20 74 68 65 6f | 72 79 20 6f 6e 6c 79 2e |cal theo|ry only.|
|000011a0| 20 49 74 0a 6d 75 73 74 | 20 62 65 20 61 20 70 72 | It.must| be a pr|
|000011b0| 61 63 74 69 63 61 6c 20 | 74 6f 6f 6c 2e 20 54 68 |actical |tool. Th|
|000011c0| 69 73 20 69 6d 70 6f 73 | 65 73 20 63 65 72 74 61 |is impos|es certa|
|000011d0| 69 6e 20 6c 69 6d 69 74 | 73 20 6f 6e 20 74 68 65 |in limit|s on the|
|000011e0| 20 74 65 72 73 65 6e 65 | 73 73 20 6f 66 0a 74 68 | tersene|ss of.th|
|000011f0| 65 20 66 6f 72 6d 61 6c | 69 73 6d 2e 20 53 65 76 |e formal|ism. Sev|
|00001200| 65 72 61 6c 20 66 65 61 | 74 75 72 65 73 20 6f 66 |eral fea|tures of|
|00001210| 20 4f 62 65 72 6f 6e 20 | 61 72 65 20 73 75 70 65 | Oberon |are supe|
|00001220| 72 66 6c 75 6f 75 73 20 | 66 72 6f 6d 20 61 20 70 |rfluous |from a p|
|00001230| 75 72 65 6c 79 0a 74 68 | 65 6f 72 65 74 69 63 61 |urely.th|eoretica|
|00001240| 6c 20 70 6f 69 6e 74 20 | 6f 66 20 76 69 65 77 2e |l point |of view.|
|00001250| 20 54 68 65 79 20 61 72 | 65 20 6e 65 76 65 72 74 | They ar|e nevert|
|00001260| 68 65 6c 65 73 73 20 72 | 65 74 61 69 6e 65 64 20 |heless r|etained |
|00001270| 66 6f 72 20 70 72 61 63 | 74 69 63 61 6c 0a 72 65 |for prac|tical.re|
|00001280| 61 73 6f 6e 73 2c 20 65 | 69 74 68 65 72 20 66 6f |asons, e|ither fo|
|00001290| 72 20 70 72 6f 67 72 61 | 6d 6d 65 72 73 27 20 63 |r progra|mmers' c|
|000012a0| 6f 6e 76 65 6e 69 65 6e | 63 65 20 6f 72 20 74 6f |onvenien|ce or to|
|000012b0| 20 61 6c 6c 6f 77 20 66 | 6f 72 20 65 66 66 69 63 | allow f|or effic|
|000012c0| 69 65 6e 74 20 63 6f 64 | 65 0a 67 65 6e 65 72 61 |ient cod|e.genera|
|000012d0| 74 69 6f 6e 20 77 69 74 | 68 6f 75 74 20 74 68 65 |tion wit|hout the|
|000012e0| 20 6e 65 63 65 73 73 69 | 74 79 20 6f 66 20 63 6f | necessi|ty of co|
|000012f0| 6d 70 6c 65 78 2c 20 22 | 6f 70 74 69 6d 69 7a 69 |mplex, "|optimizi|
|00001300| 6e 67 22 20 70 61 74 74 | 65 72 6e 20 6d 61 74 63 |ng" patt|ern matc|
|00001310| 68 69 6e 67 0a 61 6c 67 | 6f 72 69 74 68 6d 73 20 |hing.alg|orithms |
|00001320| 69 6e 20 63 6f 6d 70 69 | 6c 65 72 73 2e 20 45 78 |in compi|lers. Ex|
|00001330| 61 6d 70 6c 65 73 20 6f | 66 20 73 75 63 68 20 66 |amples o|f such f|
|00001340| 65 61 74 75 72 65 73 20 | 61 72 65 20 74 68 65 20 |eatures |are the |
|00001350| 70 72 65 73 65 6e 63 65 | 20 6f 66 0a 73 65 76 65 |presence| of.seve|
|00001360| 72 61 6c 20 66 6f 72 6d | 73 20 6f 66 20 72 65 70 |ral form|s of rep|
|00001370| 65 74 69 74 69 76 65 20 | 73 74 61 74 65 6d 65 6e |etitive |statemen|
|00001380| 74 73 2c 20 61 6e 64 20 | 6f 66 20 73 74 61 6e 64 |ts, and |of stand|
|00001390| 61 72 64 20 70 72 6f 63 | 65 64 75 72 65 73 20 73 |ard proc|edures s|
|000013a0| 75 63 68 20 61 73 0a 49 | 4e 43 2c 20 44 45 43 2c |uch as.I|NC, DEC,|
|000013b0| 20 61 6e 64 20 4f 44 44 | 2e 20 54 68 65 79 20 63 | and ODD|. They c|
|000013c0| 6f 6d 70 6c 69 63 61 74 | 65 20 6e 65 69 74 68 65 |omplicat|e neithe|
|000013d0| 72 20 74 68 65 20 6c 61 | 6e 67 75 61 67 65 20 63 |r the la|nguage c|
|000013e0| 6f 6e 63 65 70 74 75 61 | 6c 6c 79 20 6e 6f 72 0a |onceptua|lly nor.|
|000013f0| 74 68 65 20 63 6f 6d 70 | 69 6c 65 72 20 74 6f 20 |the comp|iler to |
|00001400| 61 6e 79 20 73 69 67 6e | 69 66 69 63 61 6e 74 20 |any sign|ificant |
|00001410| 64 65 67 72 65 65 2e 0a | 0a 54 68 65 73 65 20 75 |degree..|.These u|
|00001420| 6e 64 65 72 6c 79 69 6e | 67 20 70 72 65 6d 69 73 |nderlyin|g premis|
|00001430| 65 73 20 6d 75 73 74 20 | 62 65 20 6b 65 70 74 20 |es must |be kept |
|00001440| 69 6e 20 6d 69 6e 64 20 | 77 68 65 6e 20 63 6f 6d |in mind |when com|
|00001450| 70 61 72 69 6e 67 20 4f | 62 65 72 6f 6e 20 77 69 |paring O|beron wi|
|00001460| 74 68 0a 6f 74 68 65 72 | 20 6c 61 6e 67 75 61 67 |th.other| languag|
|00001470| 65 73 2e 20 4e 65 69 74 | 68 65 72 20 74 68 65 20 |es. Neit|her the |
|00001480| 6c 61 6e 67 75 61 67 65 | 20 6e 6f 72 20 69 74 73 |language| nor its|
|00001490| 20 64 65 66 69 6e 69 6e | 67 20 64 6f 63 75 6d 65 | definin|g docume|
|000014a0| 6e 74 20 72 65 61 63 68 | 20 74 68 65 0a 69 64 65 |nt reach| the.ide|
|000014b0| 61 6c 3b 20 62 75 74 20 | 4f 62 65 72 6f 6e 20 61 |al; but |Oberon a|
|000014c0| 70 70 72 6f 78 69 6d 61 | 74 65 73 20 74 68 65 73 |pproxima|tes thes|
|000014d0| 65 20 67 6f 61 6c 73 20 | 6d 75 63 68 20 62 65 74 |e goals |much bet|
|000014e0| 74 65 72 20 74 68 61 6e | 20 69 74 73 0a 70 72 65 |ter than| its.pre|
|000014f0| 64 65 63 65 73 73 6f 72 | 73 2e 0a 0a 41 20 63 6f |decessor|s...A co|
|00001500| 6d 70 69 6c 65 72 20 66 | 6f 72 20 4f 62 65 72 6f |mpiler f|or Obero|
|00001510| 6e 20 68 61 73 20 62 65 | 65 6e 20 69 6d 70 6c 65 |n has be|en imple|
|00001520| 6d 65 6e 74 65 64 20 66 | 6f 72 20 74 68 65 20 4e |mented f|or the N|
|00001530| 53 33 32 30 30 30 20 70 | 72 6f 63 65 73 73 6f 72 |S32000 p|rocessor|
|00001540| 20 66 61 6d 69 6c 79 0a | 61 6e 64 20 69 73 20 65 | family.|and is e|
|00001550| 6d 62 65 64 64 65 64 20 | 69 6e 20 74 68 65 20 4f |mbedded |in the O|
|00001560| 62 65 72 6f 6e 20 6f 70 | 65 72 61 74 69 6e 67 20 |beron op|erating |
|00001570| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 20 5b 38 5d 2e |environm|ent [8].|
|00001580| 20 54 68 65 20 63 6f 6d | 70 69 6c 65 72 0a 72 65 | The com|piler.re|
|00001590| 71 75 69 72 65 73 20 6c | 65 73 73 20 74 68 61 6e |quires l|ess than|
|000015a0| 20 35 30 20 4b 42 79 74 | 65 20 6f 66 20 6d 65 6d | 50 KByt|e of mem|
|000015b0| 6f 72 79 2c 20 63 6f 6e | 73 69 73 74 73 20 6f 66 |ory, con|sists of|
|000015c0| 20 36 20 6d 6f 64 75 6c | 65 73 20 77 69 74 68 20 | 6 modul|es with |
|000015d0| 61 20 74 6f 74 61 6c 0a | 6f 66 20 61 62 6f 75 74 |a total.|of about|
|000015e0| 20 34 30 30 30 20 6c 69 | 6e 65 73 20 6f 66 20 73 | 4000 li|nes of s|
|000015f0| 6f 75 72 63 65 20 63 6f | 64 65 2c 20 61 6e 64 20 |ource co|de, and |
|00001600| 63 6f 6d 70 69 6c 65 73 | 20 69 74 73 65 6c 66 20 |compiles| itself |
|00001610| 69 6e 20 61 62 6f 75 74 | 20 31 35 20 73 65 63 6f |in about| 15 seco|
|00001620| 6e 64 73 0a 6f 6e 20 61 | 20 77 6f 72 6b 73 74 61 |nds.on a| worksta|
|00001630| 74 69 6f 6e 20 77 69 74 | 68 20 61 20 32 35 4d 48 |tion wit|h a 25MH|
|00001640| 7a 20 4e 53 33 32 35 33 | 32 20 70 72 6f 63 65 73 |z NS3253|2 proces|
|00001650| 73 6f 72 2e 0a 0a 41 66 | 74 65 72 20 65 78 74 65 |sor...Af|ter exte|
|00001660| 6e 73 69 76 65 20 65 78 | 70 65 72 69 65 6e 63 65 |nsive ex|perience|
|00001670| 20 69 6e 20 70 72 6f 67 | 72 61 6d 6d 69 6e 67 20 | in prog|ramming |
|00001680| 77 69 74 68 20 4f 62 65 | 72 6f 6e 2c 20 61 20 72 |with Obe|ron, a r|
|00001690| 65 76 69 73 69 6f 6e 20 | 77 61 73 0a 64 65 66 69 |evision |was.defi|
|000016a0| 6e 65 64 20 61 6e 64 20 | 69 6d 70 6c 65 6d 65 6e |ned and |implemen|
|000016b0| 74 65 64 2e 20 54 68 65 | 20 64 69 66 66 65 72 65 |ted. The| differe|
|000016c0| 6e 63 65 73 20 62 65 74 | 77 65 65 6e 20 74 68 65 |nces bet|ween the|
|000016d0| 20 74 77 6f 20 76 65 72 | 73 69 6f 6e 73 20 61 72 | two ver|sions ar|
|000016e0| 65 0a 73 75 6d 6d 61 72 | 69 73 65 64 20 74 6f 77 |e.summar|ised tow|
|000016f0| 61 72 64 73 20 74 68 65 | 20 65 6e 64 20 6f 66 20 |ards the| end of |
|00001700| 74 68 65 20 70 61 70 65 | 72 2e 20 53 75 62 73 65 |the pape|r. Subse|
|00001710| 71 75 65 6e 74 6c 79 2c | 20 77 65 20 70 72 65 73 |quently,| we pres|
|00001720| 65 6e 74 20 61 20 62 72 | 69 65 66 0a 69 6e 74 72 |ent a br|ief.intr|
|00001730| 6f 64 75 63 74 69 6f 6e | 20 74 6f 20 28 72 65 76 |oduction| to (rev|
|00001740| 69 73 65 64 29 20 4f 62 | 65 72 6f 6e 20 61 73 73 |ised) Ob|eron ass|
|00001750| 75 6d 69 6e 67 20 66 61 | 6d 69 6c 69 61 72 69 74 |uming fa|miliarit|
|00001760| 79 20 77 69 74 68 20 4d | 6f 64 75 6c 61 20 28 6f |y with M|odula (o|
|00001770| 72 0a 50 61 73 63 61 6c | 29 2c 20 63 6f 6e 63 65 |r.Pascal|), conce|
|00001780| 6e 74 72 61 74 69 6e 67 | 20 6f 6e 20 74 68 65 20 |ntrating| on the |
|00001790| 61 64 64 65 64 20 66 65 | 61 74 75 72 65 73 20 61 |added fe|atures a|
|000017a0| 6e 64 20 6c 69 73 74 69 | 6e 67 20 74 68 65 20 65 |nd listi|ng the e|
|000017b0| 6c 69 6d 69 6e 61 74 65 | 64 0a 6f 6e 65 73 2e 20 |liminate|d.ones. |
|000017c0| 49 6e 20 6f 72 64 65 72 | 20 74 6f 20 62 65 20 61 |In order| to be a|
|000017d0| 62 6c 65 20 74 6f 20 73 | 74 61 72 74 20 77 69 74 |ble to s|tart wit|
|000017e0| 68 20 61 20 63 6c 65 61 | 6e 20 73 6c 61 74 65 2c |h a clea|n slate,|
|000017f0| 20 74 68 65 20 6c 61 74 | 74 65 72 20 61 72 65 20 | the lat|ter are |
|00001800| 74 61 6b 65 6e 0a 66 69 | 72 73 74 2e 0a 0a 46 65 |taken.fi|rst...Fe|
|00001810| 61 74 75 72 65 73 20 6f | 6d 69 74 74 65 64 20 66 |atures o|mitted f|
|00001820| 72 6f 6d 20 4d 6f 64 75 | 6c 61 0a 0a 44 61 74 61 |rom Modu|la..Data|
|00001830| 20 74 79 70 65 73 0a 0a | 56 61 72 69 61 6e 74 20 | types..|Variant |
|00001840| 72 65 63 6f 72 64 73 20 | 61 72 65 20 65 6c 69 6d |records |are elim|
|00001850| 69 6e 61 74 65 64 2c 20 | 62 65 63 61 75 73 65 20 |inated, |because |
|00001860| 74 68 65 79 20 63 6f 6e | 73 74 69 74 75 74 65 20 |they con|stitute |
|00001870| 61 20 67 65 6e 75 69 6e | 65 0a 64 69 66 66 69 63 |a genuin|e.diffic|
|00001880| 75 6c 74 79 20 66 6f 72 | 20 74 68 65 20 69 6d 70 |ulty for| the imp|
|00001890| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 20 6f 66 20 61 |lementat|ion of a|
|000018a0| 20 72 65 6c 69 61 62 6c | 65 20 73 74 6f 72 61 67 | reliabl|e storag|
|000018b0| 65 20 6d 61 6e 61 67 65 | 6d 65 6e 74 20 73 79 73 |e manage|ment sys|
|000018c0| 74 65 6d 0a 62 61 73 65 | 64 20 6f 6e 20 61 75 74 |tem.base|d on aut|
|000018d0| 6f 6d 61 74 69 63 20 67 | 61 72 62 61 67 65 20 63 |omatic g|arbage c|
|000018e0| 6f 6c 6c 65 63 74 69 6f | 6e 2e 20 54 68 65 20 66 |ollectio|n. The f|
|000018f0| 75 6e 63 74 69 6f 6e 61 | 6c 69 74 79 20 6f 66 20 |unctiona|lity of |
|00001900| 76 61 72 69 61 6e 74 20 | 72 65 63 6f 72 64 73 0a |variant |records.|
|00001910| 69 73 20 70 72 65 73 65 | 72 76 65 64 20 62 79 20 |is prese|rved by |
|00001920| 74 68 65 20 69 6e 74 72 | 6f 64 75 63 74 69 6f 6e |the intr|oduction|
|00001930| 20 6f 66 20 65 78 74 65 | 6e 73 69 62 6c 65 20 64 | of exte|nsible d|
|00001940| 61 74 61 20 74 79 70 65 | 73 2e 0a 0a 4f 70 61 71 |ata type|s...Opaq|
|00001950| 75 65 20 74 79 70 65 73 | 20 63 61 74 65 72 20 66 |ue types| cater f|
|00001960| 6f 72 20 74 68 65 20 63 | 6f 6e 63 65 70 74 20 6f |or the c|oncept o|
|00001970| 66 20 61 62 73 74 72 61 | 63 74 20 64 61 74 61 20 |f abstra|ct data |
|00001980| 74 79 70 65 20 61 6e 64 | 20 69 6e 66 6f 72 6d 61 |type and| informa|
|00001990| 74 69 6f 6e 0a 68 69 64 | 69 6e 67 2e 20 54 68 65 |tion.hid|ing. The|
|000019a0| 79 20 61 72 65 20 65 6c | 69 6d 69 6e 61 74 65 64 |y are el|iminated|
|000019b0| 20 61 73 20 73 75 63 68 | 2c 20 62 65 63 61 75 73 | as such|, becaus|
|000019c0| 65 20 61 67 61 69 6e 20 | 74 68 65 20 63 6f 6e 63 |e again |the conc|
|000019d0| 65 70 74 20 69 73 20 63 | 6f 76 65 72 65 64 0a 62 |ept is c|overed.b|
|000019e0| 79 20 74 68 65 20 6e 65 | 77 20 66 61 63 69 6c 69 |y the ne|w facili|
|000019f0| 74 79 20 6f 66 20 65 78 | 74 65 6e 64 65 64 20 72 |ty of ex|tended r|
|00001a00| 65 63 6f 72 64 20 74 79 | 70 65 73 2e 0a 0a 45 6e |ecord ty|pes...En|
|00001a10| 75 6d 65 72 61 74 69 6f | 6e 20 74 79 70 65 73 20 |umeratio|n types |
|00001a20| 61 70 70 65 61 72 20 74 | 6f 20 62 65 20 61 20 73 |appear t|o be a s|
|00001a30| 69 6d 70 6c 65 20 65 6e | 6f 75 67 68 20 66 65 61 |imple en|ough fea|
|00001a40| 74 75 72 65 20 74 6f 20 | 62 65 0a 75 6e 63 6f 6e |ture to |be.uncon|
|00001a50| 74 72 6f 76 65 72 73 69 | 61 6c 2e 20 48 6f 77 65 |troversi|al. Howe|
|00001a60| 76 65 72 2c 20 74 68 65 | 79 20 64 65 66 79 20 65 |ver, the|y defy e|
|00001a70| 78 74 65 6e 73 69 62 69 | 6c 69 74 79 20 6f 76 65 |xtensibi|lity ove|
|00001a80| 72 20 6d 6f 64 75 6c 65 | 20 62 6f 75 6e 64 61 72 |r module| boundar|
|00001a90| 69 65 73 2e 0a 45 69 74 | 68 65 72 20 61 20 66 61 |ies..Eit|her a fa|
|00001aa0| 63 69 6c 69 74 79 20 74 | 6f 20 65 78 74 65 6e 64 |cility t|o extend|
|00001ab0| 20 67 69 76 65 6e 20 65 | 6e 75 6d 65 72 61 74 69 | given e|numerati|
|00001ac0| 6f 6e 20 74 79 70 65 73 | 20 68 61 73 20 74 6f 20 |on types| has to |
|00001ad0| 62 65 20 69 6e 74 72 6f | 64 75 63 65 64 2c 0a 6f |be intro|duced,.o|
|00001ae0| 72 20 74 68 65 79 20 68 | 61 76 65 20 74 6f 20 62 |r they h|ave to b|
|00001af0| 65 20 64 72 6f 70 70 65 | 64 2e 20 41 20 72 65 61 |e droppe|d. A rea|
|00001b00| 73 6f 6e 20 69 6e 20 66 | 61 76 6f 75 72 20 6f 66 |son in f|avour of|
|00001b10| 20 74 68 65 20 6c 61 74 | 74 65 72 2c 20 72 61 64 | the lat|ter, rad|
|00001b20| 69 63 61 6c 0a 73 6f 6c | 75 74 69 6f 6e 20 77 61 |ical.sol|ution wa|
|00001b30| 73 20 74 68 65 20 6f 62 | 73 65 72 76 61 74 69 6f |s the ob|servatio|
|00001b40| 6e 20 74 68 61 74 20 69 | 6e 20 61 20 67 72 6f 77 |n that i|n a grow|
|00001b50| 69 6e 67 20 6e 75 6d 62 | 65 72 20 6f 66 20 70 72 |ing numb|er of pr|
|00001b60| 6f 67 72 61 6d 73 20 74 | 68 65 0a 69 6e 64 69 73 |ograms t|he.indis|
|00001b70| 63 72 69 6d 69 6e 61 74 | 65 20 75 73 65 20 6f 66 |criminat|e use of|
|00001b80| 20 65 6e 75 6d 65 72 61 | 74 69 6f 6e 73 20 28 61 | enumera|tions (a|
|00001b90| 6e 64 20 73 75 62 72 61 | 6e 67 65 73 29 20 68 61 |nd subra|nges) ha|
|00001ba0| 64 20 6c 65 64 20 74 6f | 20 61 20 74 79 70 65 0a |d led to| a type.|
|00001bb0| 65 78 70 6c 6f 73 69 6f | 6e 20 74 68 61 74 20 63 |explosio|n that c|
|00001bc0| 6f 6e 74 72 69 62 75 74 | 65 64 20 6e 6f 74 20 74 |ontribut|ed not t|
|00001bd0| 6f 20 70 72 6f 67 72 61 | 6d 20 63 6c 61 72 69 74 |o progra|m clarit|
|00001be0| 79 20 62 75 74 20 72 61 | 74 68 65 72 20 74 6f 20 |y but ra|ther to |
|00001bf0| 76 65 72 62 6f 73 69 74 | 79 2e 0a 49 6e 20 63 6f |verbosit|y..In co|
|00001c00| 6e 6e 65 63 74 69 6f 6e | 20 77 69 74 68 20 69 6d |nnection| with im|
|00001c10| 70 6f 72 74 20 61 6e 64 | 20 65 78 70 6f 72 74 2c |port and| export,|
|00001c20| 20 65 6e 75 6d 65 72 61 | 74 69 6f 6e 73 20 67 69 | enumera|tions gi|
|00001c30| 76 65 20 72 69 73 65 20 | 74 6f 20 74 68 65 0a 65 |ve rise |to the.e|
|00001c40| 78 63 65 70 74 69 6f 6e | 61 6c 20 72 75 6c 65 20 |xception|al rule |
|00001c50| 74 68 61 74 20 74 68 65 | 20 69 6d 70 6f 72 74 20 |that the| import |
|00001c60| 6f 66 20 61 20 74 79 70 | 65 20 69 64 65 6e 74 69 |of a typ|e identi|
|00001c70| 66 69 65 72 20 61 6c 73 | 6f 20 63 61 75 73 65 73 |fier als|o causes|
|00001c80| 20 74 68 65 0a 28 61 75 | 74 6f 6d 61 74 69 63 29 | the.(au|tomatic)|
|00001c90| 20 69 6d 70 6f 72 74 20 | 6f 66 20 61 6c 6c 20 61 | import |of all a|
|00001ca0| 73 73 6f 63 69 61 74 65 | 64 20 63 6f 6e 73 74 61 |ssociate|d consta|
|00001cb0| 6e 74 20 69 64 65 6e 74 | 69 66 69 65 72 73 2e 20 |nt ident|ifiers. |
|00001cc0| 54 68 69 73 20 65 78 63 | 65 70 74 69 6f 6e 61 6c |This exc|eptional|
|00001cd0| 0a 72 75 6c 65 20 64 65 | 66 69 65 73 20 63 6f 6e |.rule de|fies con|
|00001ce0| 63 65 70 74 75 61 6c 20 | 73 69 6d 70 6c 69 63 69 |ceptual |simplici|
|00001cf0| 74 79 20 61 6e 64 20 63 | 61 75 73 65 73 20 75 6e |ty and c|auses un|
|00001d00| 70 6c 65 61 73 61 6e 74 | 20 70 72 6f 62 6c 65 6d |pleasant| problem|
|00001d10| 73 20 66 6f 72 20 74 68 | 65 0a 69 6d 70 6c 65 6d |s for th|e.implem|
|00001d20| 65 6e 74 6f 72 2e 0a 0a | 53 75 62 72 61 6e 67 65 |entor...|Subrange|
|00001d30| 20 74 79 70 65 73 20 77 | 65 72 65 20 69 6e 74 72 | types w|ere intr|
|00001d40| 6f 64 75 63 65 64 20 69 | 6e 20 50 61 73 63 61 6c |oduced i|n Pascal|
|00001d50| 20 28 61 6e 64 20 61 64 | 6f 70 74 65 64 20 69 6e | (and ad|opted in|
|00001d60| 20 4d 6f 64 75 6c 61 29 | 20 66 6f 72 20 74 77 6f | Modula)| for two|
|00001d70| 0a 72 65 61 73 6f 6e 73 | 3a 20 28 31 29 20 74 6f |.reasons|: (1) to|
|00001d80| 20 69 6e 64 69 63 61 74 | 65 20 74 68 61 74 20 61 | indicat|e that a|
|00001d90| 20 76 61 72 69 61 62 6c | 65 20 61 63 63 65 70 74 | variabl|e accept|
|00001da0| 73 20 61 20 6c 69 6d 69 | 74 65 64 20 72 61 6e 67 |s a limi|ted rang|
|00001db0| 65 20 6f 66 20 76 61 6c | 75 65 73 0a 6f 66 20 74 |e of val|ues.of t|
|00001dc0| 68 65 20 62 61 73 65 20 | 74 79 70 65 20 61 6e 64 |he base |type and|
|00001dd0| 20 74 6f 20 61 6c 6c 6f | 77 20 61 20 63 6f 6d 70 | to allo|w a comp|
|00001de0| 69 6c 65 72 20 74 6f 20 | 67 65 6e 65 72 61 74 65 |iler to |generate|
|00001df0| 20 61 70 70 72 6f 70 72 | 69 61 74 65 20 67 75 61 | appropr|iate gua|
|00001e00| 72 64 73 20 66 6f 72 0a | 61 73 73 69 67 6e 6d 65 |rds for.|assignme|
|00001e10| 6e 74 73 2c 20 61 6e 64 | 20 28 32 29 20 74 6f 20 |nts, and| (2) to |
|00001e20| 61 6c 6c 6f 77 20 61 20 | 63 6f 6d 70 69 6c 65 72 |allow a |compiler|
|00001e30| 20 74 6f 20 61 6c 6c 6f | 63 61 74 65 20 74 68 65 | to allo|cate the|
|00001e40| 20 6d 69 6e 69 6d 61 6c | 20 73 74 6f 72 61 67 65 | minimal| storage|
|00001e50| 0a 73 70 61 63 65 20 6e | 65 65 64 65 64 20 74 6f |.space n|eeded to|
|00001e60| 20 73 74 6f 72 65 20 76 | 61 6c 75 65 73 20 6f 66 | store v|alues of|
|00001e70| 20 74 68 65 20 69 6e 64 | 69 63 61 74 65 64 20 73 | the ind|icated s|
|00001e80| 75 62 72 61 6e 67 65 2e | 20 54 68 69 73 20 61 70 |ubrange.| This ap|
|00001e90| 70 65 61 72 65 64 0a 64 | 65 73 69 72 61 62 6c 65 |peared.d|esirable|
|00001ea0| 20 69 6e 20 63 6f 6e 6e | 65 63 74 69 6f 6e 20 77 | in conn|ection w|
|00001eb0| 69 74 68 20 70 61 63 6b | 65 64 20 72 65 63 6f 72 |ith pack|ed recor|
|00001ec0| 64 73 2e 20 56 65 72 79 | 20 66 65 77 20 69 6d 70 |ds. Very| few imp|
|00001ed0| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 73 20 68 61 76 |lementat|ions hav|
|00001ee0| 65 0a 74 61 6b 65 6e 20 | 61 64 76 61 6e 74 61 67 |e.taken |advantag|
|00001ef0| 65 20 6f 66 20 74 68 69 | 73 20 73 70 61 63 65 20 |e of thi|s space |
|00001f00| 73 61 76 69 6e 67 20 66 | 61 63 69 6c 69 74 79 2c |saving f|acility,|
|00001f10| 20 62 65 63 61 75 73 65 | 20 74 68 65 20 61 64 64 | because| the add|
|00001f20| 69 74 69 6f 6e 61 6c 0a | 63 6f 6d 70 69 6c 65 72 |itional.|compiler|
|00001f30| 20 63 6f 6d 70 6c 65 78 | 69 74 79 20 69 73 20 76 | complex|ity is v|
|00001f40| 65 72 79 20 63 6f 6e 73 | 69 64 65 72 61 62 6c 65 |ery cons|iderable|
|00001f50| 2e 20 52 65 61 73 6f 6e | 20 31 20 61 6c 6f 6e 65 |. Reason| 1 alone|
|00001f60| 2c 20 68 6f 77 65 76 65 | 72 2c 20 64 69 64 20 6e |, howeve|r, did n|
|00001f70| 6f 74 0a 61 70 70 65 61 | 72 20 74 6f 20 70 72 6f |ot.appea|r to pro|
|00001f80| 76 69 64 65 20 73 75 66 | 66 69 63 69 65 6e 74 20 |vide suf|ficient |
|00001f90| 6a 75 73 74 69 66 69 63 | 61 74 69 6f 6e 20 74 6f |justific|ation to|
|00001fa0| 20 72 65 74 61 69 6e 20 | 74 68 65 20 73 75 62 72 | retain |the subr|
|00001fb0| 61 6e 67 65 20 66 61 63 | 69 6c 69 74 79 0a 69 6e |ange fac|ility.in|
|00001fc0| 20 4f 62 65 72 6f 6e 2e | 0a 0a 57 69 74 68 20 74 | Oberon.|..With t|
|00001fd0| 68 65 20 61 62 73 65 6e | 63 65 20 6f 66 20 65 6e |he absen|ce of en|
|00001fe0| 75 6d 65 72 61 74 69 6f | 6e 20 61 6e 64 20 73 75 |umeratio|n and su|
|00001ff0| 62 72 61 6e 67 65 20 74 | 79 70 65 73 2c 20 74 68 |brange t|ypes, th|
|00002000| 65 20 67 65 6e 65 72 61 | 6c 20 70 6f 73 73 69 62 |e genera|l possib|
|00002010| 69 6c 69 74 79 0a 6f 66 | 20 64 65 66 69 6e 69 6e |ility.of| definin|
|00002020| 67 20 73 65 74 20 74 79 | 70 65 73 20 62 61 73 65 |g set ty|pes base|
|00002030| 64 20 6f 6e 20 67 69 76 | 65 6e 20 65 6c 65 6d 65 |d on giv|en eleme|
|00002040| 6e 74 20 74 79 70 65 73 | 20 61 70 70 65 61 72 65 |nt types| appeare|
|00002050| 64 20 61 73 20 72 65 64 | 75 6e 64 61 6e 74 2e 0a |d as red|undant..|
|00002060| 49 6e 73 74 65 61 64 2c | 20 61 20 73 69 6e 67 6c |Instead,| a singl|
|00002070| 65 2c 20 62 61 73 69 63 | 20 74 79 70 65 20 53 45 |e, basic| type SE|
|00002080| 54 20 69 73 20 69 6e 74 | 72 6f 64 75 63 65 64 2c |T is int|roduced,|
|00002090| 20 77 68 6f 73 65 20 76 | 61 6c 75 65 73 20 61 72 | whose v|alues ar|
|000020a0| 65 20 73 65 74 73 20 6f | 66 0a 69 6e 74 65 67 65 |e sets o|f.intege|
|000020b0| 72 73 20 66 72 6f 6d 20 | 30 20 74 6f 20 61 6e 20 |rs from |0 to an |
|000020c0| 69 6d 70 6c 65 6d 65 6e | 74 61 74 69 6f 6e 2d 64 |implemen|tation-d|
|000020d0| 65 66 69 6e 65 64 20 6d | 61 78 69 6d 75 6d 2e 0a |efined m|aximum..|
|000020e0| 0a 54 68 65 20 62 61 73 | 69 63 20 74 79 70 65 20 |.The bas|ic type |
|000020f0| 43 41 52 44 49 4e 41 4c | 20 68 61 64 20 62 65 65 |CARDINAL| had bee|
|00002100| 6e 20 69 6e 74 72 6f 64 | 75 63 65 64 20 69 6e 20 |n introd|uced in |
|00002110| 4d 6f 64 75 6c 61 20 69 | 6e 20 6f 72 64 65 72 20 |Modula i|n order |
|00002120| 74 6f 20 61 6c 6c 6f 77 | 0a 61 64 64 72 65 73 73 |to allow|.address|
|00002130| 20 61 72 69 74 68 6d 65 | 74 69 63 20 77 69 74 68 | arithme|tic with|
|00002140| 20 76 61 6c 75 65 73 20 | 66 72 6f 6d 20 30 20 74 | values |from 0 t|
|00002150| 6f 20 32 31 36 20 6f 6e | 20 31 36 2d 62 69 74 20 |o 216 on| 16-bit |
|00002160| 63 6f 6d 70 75 74 65 72 | 73 2e 20 57 69 74 68 20 |computer|s. With |
|00002170| 74 68 65 0a 70 72 65 76 | 61 6c 65 6e 63 65 20 6f |the.prev|alence o|
|00002180| 66 20 33 32 2d 62 69 74 | 20 61 64 64 72 65 73 73 |f 32-bit| address|
|00002190| 65 73 20 69 6e 20 6d 6f | 64 65 72 6e 20 70 72 6f |es in mo|dern pro|
|000021a0| 63 65 73 73 6f 72 73 2c | 20 74 68 65 20 6e 65 65 |cessors,| the nee|
|000021b0| 64 20 66 6f 72 20 75 6e | 73 69 67 6e 65 64 0a 61 |d for un|signed.a|
|000021c0| 72 69 74 68 6d 65 74 69 | 63 20 68 61 73 20 70 72 |rithmeti|c has pr|
|000021d0| 61 63 74 69 63 61 6c 6c | 79 20 76 61 6e 69 73 68 |acticall|y vanish|
|000021e0| 65 64 2c 20 61 6e 64 20 | 74 68 65 72 65 66 6f 72 |ed, and |therefor|
|000021f0| 65 20 74 68 65 20 74 79 | 70 65 20 43 41 52 44 49 |e the ty|pe CARDI|
|00002200| 4e 41 4c 20 68 61 73 0a | 62 65 65 6e 20 65 6c 69 |NAL has.|been eli|
|00002210| 6d 69 6e 61 74 65 64 2e | 20 57 69 74 68 20 69 74 |minated.| With it|
|00002220| 2c 20 74 68 65 20 62 6f | 74 68 65 72 73 6f 6d 65 |, the bo|thersome|
|00002230| 20 69 6e 63 6f 6d 70 61 | 74 69 62 69 6c 69 74 69 | incompa|tibiliti|
|00002240| 65 73 20 6f 66 20 6f 70 | 65 72 61 6e 64 73 20 6f |es of op|erands o|
|00002250| 66 0a 74 79 70 65 73 20 | 43 41 52 44 49 4e 41 4c |f.types |CARDINAL|
|00002260| 20 61 6e 64 20 49 4e 54 | 45 47 45 52 20 68 61 76 | and INT|EGER hav|
|00002270| 65 20 64 69 73 61 70 70 | 65 61 72 65 64 2e 0a 0a |e disapp|eared...|
|00002280| 50 6f 69 6e 74 65 72 20 | 74 79 70 65 73 20 61 72 |Pointer |types ar|
|00002290| 65 20 72 65 73 74 72 69 | 63 74 65 64 20 74 6f 20 |e restri|cted to |
|000022a0| 62 65 20 62 6f 75 6e 64 | 20 74 6f 20 61 20 72 65 |be bound| to a re|
|000022b0| 63 6f 72 64 20 74 79 70 | 65 20 6f 72 20 74 6f 20 |cord typ|e or to |
|000022c0| 61 6e 20 61 72 72 61 79 | 0a 74 79 70 65 2e 0a 0a |an array|.type...|
|000022d0| 54 68 65 20 6e 6f 74 69 | 6f 6e 20 6f 66 20 61 20 |The noti|on of a |
|000022e0| 64 65 66 69 6e 61 62 6c | 65 20 69 6e 64 65 78 20 |definabl|e index |
|000022f0| 74 79 70 65 20 6f 66 20 | 61 72 72 61 79 73 20 68 |type of |arrays h|
|00002300| 61 73 20 61 6c 73 6f 20 | 62 65 65 6e 20 61 62 61 |as also |been aba|
|00002310| 6e 64 6f 6e 65 64 3a 20 | 41 6c 6c 0a 69 6e 64 69 |ndoned: |All.indi|
|00002320| 63 65 73 20 61 72 65 20 | 62 79 20 64 65 66 61 75 |ces are |by defau|
|00002330| 6c 74 20 69 6e 74 65 67 | 65 72 73 2e 20 46 75 72 |lt integ|ers. Fur|
|00002340| 74 68 65 72 6d 6f 72 65 | 2c 20 74 68 65 20 6c 6f |thermore|, the lo|
|00002350| 77 65 72 20 62 6f 75 6e | 64 20 69 73 20 66 69 78 |wer boun|d is fix|
|00002360| 65 64 20 74 6f 0a 30 3b | 20 61 72 72 61 79 20 64 |ed to.0;| array d|
|00002370| 65 63 6c 61 72 61 74 69 | 6f 6e 73 20 73 70 65 63 |eclarati|ons spec|
|00002380| 69 66 79 20 61 20 6e 75 | 6d 62 65 72 20 6f 66 20 |ify a nu|mber of |
|00002390| 65 6c 65 6d 65 6e 74 73 | 20 28 6c 65 6e 67 74 68 |elements| (length|
|000023a0| 29 20 72 61 74 68 65 72 | 20 74 68 61 6e 20 61 0a |) rather| than a.|
|000023b0| 70 61 69 72 20 6f 66 20 | 62 6f 75 6e 64 73 2e 20 |pair of |bounds. |
|000023c0| 54 68 69 73 20 62 72 65 | 61 6b 20 77 69 74 68 20 |This bre|ak with |
|000023d0| 61 20 6c 6f 6e 67 20 73 | 74 61 6e 64 69 6e 67 20 |a long s|tanding |
|000023e0| 74 72 61 64 69 74 69 6f | 6e 20 73 69 6e 63 65 20 |traditio|n since |
|000023f0| 41 6c 67 6f 6c 20 36 30 | 0a 63 6c 65 61 72 6c 79 |Algol 60|.clearly|
|00002400| 20 64 65 6d 6f 6e 73 74 | 72 61 74 65 73 20 74 68 | demonst|rates th|
|00002410| 65 20 70 72 69 6e 63 69 | 70 6c 65 20 6f 66 20 65 |e princi|ple of e|
|00002420| 6c 69 6d 69 6e 61 74 69 | 6e 67 20 74 68 65 20 69 |liminati|ng the i|
|00002430| 6e 65 73 73 65 6e 74 69 | 61 6c 2e 20 54 68 65 0a |nessenti|al. The.|
|00002440| 73 70 65 63 69 66 69 63 | 61 74 69 6f 6e 20 6f 66 |specific|ation of|
|00002450| 20 61 6e 20 61 72 62 69 | 74 72 61 72 79 20 6c 6f | an arbi|trary lo|
|00002460| 77 65 72 20 62 6f 75 6e | 64 20 68 61 72 64 6c 79 |wer boun|d hardly|
|00002470| 20 70 72 6f 76 69 64 65 | 73 20 61 6e 79 20 61 64 | provide|s any ad|
|00002480| 64 69 74 69 6f 6e 61 6c | 0a 65 78 70 72 65 73 73 |ditional|.express|
|00002490| 69 76 65 20 70 6f 77 65 | 72 2e 20 49 74 20 72 65 |ive powe|r. It re|
|000024a0| 70 72 65 73 65 6e 74 73 | 20 61 20 72 61 74 68 65 |presents| a rathe|
|000024b0| 72 20 6c 69 6d 69 74 65 | 64 20 6b 69 6e 64 20 6f |r limite|d kind o|
|000024c0| 66 20 6d 61 70 70 69 6e | 67 20 6f 66 20 69 6e 64 |f mappin|g of ind|
|000024d0| 69 63 65 73 0a 77 68 69 | 63 68 20 69 6e 74 72 6f |ices.whi|ch intro|
|000024e0| 64 75 63 65 73 20 61 20 | 68 69 64 64 65 6e 20 63 |duces a |hidden c|
|000024f0| 6f 6d 70 75 74 61 74 69 | 6f 6e 61 6c 20 65 66 66 |omputati|onal eff|
|00002500| 6f 72 74 20 74 68 61 74 | 20 69 73 20 69 6e 63 6f |ort that| is inco|
|00002510| 6d 6d 65 6e 73 75 72 61 | 74 65 20 77 69 74 68 0a |mmensura|te with.|
|00002520| 74 68 65 20 73 75 70 70 | 6f 73 65 64 20 67 61 69 |the supp|osed gai|
|00002530| 6e 20 69 6e 20 63 6f 6e | 76 65 6e 69 65 6e 63 65 |n in con|venience|
|00002540| 2e 20 54 68 69 73 20 65 | 66 66 6f 72 74 20 69 73 |. This e|ffort is|
|00002550| 20 70 61 72 74 69 63 75 | 6c 61 72 6c 79 20 68 65 | particu|larly he|
|00002560| 61 76 79 20 69 6e 0a 63 | 6f 6e 6e 65 63 74 69 6f |avy in.c|onnectio|
|00002570| 6e 20 77 69 74 68 20 62 | 6f 75 6e 64 20 63 68 65 |n with b|ound che|
|00002580| 63 6b 69 6e 67 20 61 6e | 64 20 77 69 74 68 20 64 |cking an|d with d|
|00002590| 79 6e 61 6d 69 63 20 61 | 72 72 61 79 73 2e 0a 0a |ynamic a|rrays...|
|000025a0| 4d 6f 64 75 6c 65 73 20 | 61 6e 64 20 69 6d 70 6f |Modules |and impo|
|000025b0| 72 74 2f 65 78 70 6f 72 | 74 20 72 75 6c 65 73 0a |rt/expor|t rules.|
|000025c0| 0a 45 78 70 65 72 69 65 | 6e 63 65 20 77 69 74 68 |.Experie|nce with|
|000025d0| 20 4d 6f 64 75 6c 61 20 | 6f 76 65 72 20 74 68 65 | Modula |over the|
|000025e0| 20 6c 61 73 74 20 65 69 | 67 68 74 20 79 65 61 72 | last ei|ght year|
|000025f0| 73 20 68 61 73 20 73 68 | 6f 77 6e 20 74 68 61 74 |s has sh|own that|
|00002600| 20 6c 6f 63 61 6c 0a 6d | 6f 64 75 6c 65 73 20 77 | local.m|odules w|
|00002610| 65 72 65 20 72 61 72 65 | 6c 79 20 75 73 65 64 2e |ere rare|ly used.|
|00002620| 20 43 6f 6e 73 69 64 65 | 72 69 6e 67 20 74 68 65 | Conside|ring the|
|00002630| 20 61 64 64 69 74 69 6f | 6e 61 6c 20 63 6f 6d 70 | additio|nal comp|
|00002640| 6c 65 78 69 74 79 20 6f | 66 20 74 68 65 0a 63 6f |lexity o|f the.co|
|00002650| 6d 70 69 6c 65 72 20 72 | 65 71 75 69 72 65 64 20 |mpiler r|equired |
|00002660| 74 6f 20 68 61 6e 64 6c | 65 20 74 68 65 6d 2c 20 |to handl|e them, |
|00002670| 61 6e 64 20 74 68 65 20 | 61 64 64 69 74 69 6f 6e |and the |addition|
|00002680| 61 6c 20 63 6f 6d 70 6c | 69 63 61 74 69 6f 6e 73 |al compl|ications|
|00002690| 20 69 6e 20 74 68 65 0a | 76 69 73 69 62 6c 69 74 | in the.|visiblit|
|000026a0| 79 20 72 75 6c 65 73 20 | 6f 66 20 74 68 65 20 6c |y rules |of the l|
|000026b0| 61 6e 67 75 61 67 65 20 | 64 65 66 69 6e 69 74 69 |anguage |definiti|
|000026c0| 6f 6e 2c 20 74 68 65 20 | 65 6c 69 6d 69 6e 61 74 |on, the |eliminat|
|000026d0| 69 6f 6e 20 6f 66 20 6c | 6f 63 61 6c 0a 6d 6f 64 |ion of l|ocal.mod|
|000026e0| 75 6c 65 73 20 61 70 70 | 65 61 72 73 20 6a 75 73 |ules app|ears jus|
|000026f0| 74 69 66 69 65 64 2e 0a | 0a 54 68 65 20 71 75 61 |tified..|.The qua|
|00002700| 6c 69 66 69 63 61 74 69 | 6f 6e 20 6f 66 20 61 6e |lificati|on of an|
|00002710| 20 69 6d 70 6f 72 74 65 | 64 20 6f 62 6a 65 63 74 | importe|d object|
|00002720| 27 73 20 69 64 65 6e 74 | 69 66 69 65 72 20 78 20 |'s ident|ifier x |
|00002730| 62 79 20 74 68 65 20 65 | 78 70 6f 72 74 69 6e 67 |by the e|xporting|
|00002740| 0a 6d 6f 64 75 6c 65 27 | 73 20 6e 61 6d 65 20 4d |.module'|s name M|
|00002750| 2c 20 76 69 7a 2e 20 4d | 2e 78 2c 20 63 61 6e 20 |, viz. M|.x, can |
|00002760| 62 65 20 63 69 72 63 75 | 6d 76 65 6e 74 65 64 20 |be circu|mvented |
|00002770| 69 6e 20 4d 6f 64 75 6c | 61 20 62 79 20 74 68 65 |in Modul|a by the|
|00002780| 20 75 73 65 20 6f 66 20 | 74 68 65 0a 69 6d 70 6f | use of |the.impo|
|00002790| 72 74 20 63 6c 61 75 73 | 65 20 46 52 4f 4d 20 4d |rt claus|e FROM M|
|000027a0| 20 49 4d 50 4f 52 54 20 | 78 2e 20 54 68 69 73 20 | IMPORT |x. This |
|000027b0| 66 61 63 69 6c 69 74 79 | 20 68 61 73 20 61 6c 73 |facility| has als|
|000027c0| 6f 20 62 65 65 6e 20 64 | 69 73 63 61 72 64 65 64 |o been d|iscarded|
|000027d0| 2e 0a 45 78 70 65 72 69 | 65 6e 63 65 20 69 6e 20 |..Experi|ence in |
|000027e0| 70 72 6f 67 72 61 6d 6d | 69 6e 67 20 73 79 73 74 |programm|ing syst|
|000027f0| 65 6d 73 20 69 6e 76 6f | 6c 76 69 6e 67 20 6d 61 |ems invo|lving ma|
|00002800| 6e 79 20 6d 6f 64 75 6c | 65 73 20 68 61 73 20 74 |ny modul|es has t|
|00002810| 61 75 67 68 74 20 74 68 | 61 74 0a 74 68 65 20 65 |aught th|at.the e|
|00002820| 78 70 6c 69 63 69 74 20 | 71 75 61 6c 69 66 69 63 |xplicit |qualific|
|00002830| 61 74 69 6f 6e 20 6f 66 | 20 65 61 63 68 20 6f 63 |ation of| each oc|
|00002840| 63 75 72 72 65 6e 63 65 | 20 6f 66 20 78 20 69 73 |currence| of x is|
|00002850| 20 61 63 74 75 61 6c 6c | 79 20 70 72 65 66 65 72 | actuall|y prefer|
|00002860| 61 62 6c 65 2e 0a 41 20 | 73 69 6d 70 6c 69 66 69 |able..A |simplifi|
|00002870| 63 61 74 69 6f 6e 20 6f | 66 20 74 68 65 20 63 6f |cation o|f the co|
|00002880| 6d 70 69 6c 65 72 20 69 | 73 20 61 20 77 65 6c 63 |mpiler i|s a welc|
|00002890| 6f 6d 65 20 73 69 64 65 | 2d 65 66 66 65 63 74 2e |ome side|-effect.|
|000028a0| 0a 0a 54 68 65 20 64 75 | 61 6c 20 72 6f 6c 65 20 |..The du|al role |
|000028b0| 6f 66 20 74 68 65 20 6d | 61 69 6e 20 6d 6f 64 75 |of the m|ain modu|
|000028c0| 6c 65 20 69 6e 20 4d 6f | 64 75 6c 61 20 69 73 20 |le in Mo|dula is |
|000028d0| 63 6f 6e 63 65 70 74 75 | 61 6c 6c 79 20 63 6f 6e |conceptu|ally con|
|000028e0| 66 75 73 69 6e 67 2e 20 | 49 74 0a 63 6f 6e 73 74 |fusing. |It.const|
|000028f0| 69 74 75 74 65 73 20 61 | 20 6d 6f 64 75 6c 65 20 |itutes a| module |
|00002900| 69 6e 20 74 68 65 20 73 | 65 6e 73 65 20 6f 66 20 |in the s|ense of |
|00002910| 61 20 70 61 63 6b 61 67 | 65 20 6f 66 20 64 61 74 |a packag|e of dat|
|00002920| 61 20 61 6e 64 20 70 72 | 6f 63 65 64 75 72 65 73 |a and pr|ocedures|
|00002930| 0a 65 6e 63 6c 6f 73 65 | 64 20 62 79 20 61 20 73 |.enclose|d by a s|
|00002940| 63 6f 70 65 20 6f 66 20 | 76 69 73 69 62 69 6c 69 |cope of |visibili|
|00002950| 74 79 2c 20 61 6e 64 20 | 61 74 20 74 68 65 20 73 |ty, and |at the s|
|00002960| 61 6d 65 20 74 69 6d 65 | 20 69 74 20 63 6f 6e 73 |ame time| it cons|
|00002970| 74 69 74 75 74 65 73 20 | 61 0a 73 69 6e 67 6c 65 |titutes |a.single|
|00002980| 20 70 72 6f 63 65 64 75 | 72 65 20 63 61 6c 6c 65 | procedu|re calle|
|00002990| 64 20 6d 61 69 6e 20 70 | 72 6f 67 72 61 6d 2e 20 |d main p|rogram. |
|000029a0| 41 20 6d 6f 64 75 6c 65 | 20 69 73 20 63 6f 6d 70 |A module| is comp|
|000029b0| 6f 73 65 64 20 6f 66 20 | 74 77 6f 20 74 65 78 74 |osed of |two text|
|000029c0| 75 61 6c 0a 70 69 65 63 | 65 73 2c 20 63 61 6c 6c |ual.piec|es, call|
|000029d0| 65 64 20 74 68 65 20 64 | 65 66 69 6e 69 74 69 6f |ed the d|efinitio|
|000029e0| 6e 20 70 61 72 74 20 61 | 6e 64 20 74 68 65 20 69 |n part a|nd the i|
|000029f0| 6d 70 6c 65 6d 65 6e 74 | 61 74 69 6f 6e 20 70 61 |mplement|ation pa|
|00002a00| 72 74 2e 20 54 68 65 20 | 66 6f 72 6d 65 72 0a 69 |rt. The |former.i|
|00002a10| 73 20 6d 69 73 73 69 6e | 67 20 69 6e 20 74 68 65 |s missin|g in the|
|00002a20| 20 63 61 73 65 20 6f 66 | 20 61 20 6d 61 69 6e 20 | case of| a main |
|00002a30| 70 72 6f 67 72 61 6d 20 | 6d 6f 64 75 6c 65 2e 0a |program |module..|
|00002a40| 0a 42 79 20 63 6f 6e 74 | 72 61 73 74 2c 20 61 20 |.By cont|rast, a |
|00002a50| 6d 6f 64 75 6c 65 20 69 | 6e 20 4f 62 65 72 6f 6e |module i|n Oberon|
|00002a60| 20 69 73 20 69 6e 20 69 | 74 73 65 6c 66 20 63 6f | is in i|tself co|
|00002a70| 6d 70 6c 65 74 65 20 61 | 6e 64 20 63 6f 6e 73 74 |mplete a|nd const|
|00002a80| 69 74 75 74 65 73 20 61 | 0a 75 6e 69 74 20 6f 66 |itutes a|.unit of|
|00002a90| 20 63 6f 6d 70 69 6c 61 | 74 69 6f 6e 2e 20 44 65 | compila|tion. De|
|00002aa0| 66 69 6e 69 74 69 6f 6e | 20 61 6e 64 20 69 6d 70 |finition| and imp|
|00002ab0| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 20 70 61 72 74 |lementat|ion part|
|00002ac0| 73 20 61 72 65 20 6d 65 | 72 67 65 64 3b 20 6e 61 |s are me|rged; na|
|00002ad0| 6d 65 73 0a 74 6f 20 62 | 65 20 76 69 73 69 62 6c |mes.to b|e visibl|
|00002ae0| 65 20 69 6e 20 63 6c 69 | 65 6e 74 20 6d 6f 64 75 |e in cli|ent modu|
|00002af0| 6c 65 73 2c 20 69 2e 65 | 2e 20 65 78 70 6f 72 74 |les, i.e|. export|
|00002b00| 65 64 20 69 64 65 6e 74 | 69 66 69 65 72 73 2c 20 |ed ident|ifiers, |
|00002b10| 61 72 65 20 6d 61 72 6b | 65 64 2c 20 61 6e 64 0a |are mark|ed, and.|
|00002b20| 74 68 65 79 20 74 79 70 | 69 63 61 6c 6c 79 20 70 |they typ|ically p|
|00002b30| 72 65 63 65 64 65 20 74 | 68 65 20 64 65 63 6c 61 |recede t|he decla|
|00002b40| 72 61 74 69 6f 6e 73 20 | 6f 66 20 6f 62 6a 65 63 |rations |of objec|
|00002b50| 74 73 20 6e 6f 74 20 65 | 78 70 6f 72 74 65 64 2e |ts not e|xported.|
|00002b60| 20 41 0a 63 6f 6d 70 69 | 6c 61 74 69 6f 6e 20 67 | A.compi|lation g|
|00002b70| 65 6e 65 72 61 74 65 73 | 20 69 6e 20 67 65 6e 65 |enerates| in gene|
|00002b80| 72 61 6c 20 61 20 63 68 | 61 6e 67 65 64 20 6f 62 |ral a ch|anged ob|
|00002b90| 6a 65 63 74 20 66 69 6c | 65 20 61 6e 64 20 61 20 |ject fil|e and a |
|00002ba0| 6e 65 77 20 73 79 6d 62 | 6f 6c 0a 66 69 6c 65 2e |new symb|ol.file.|
|00002bb0| 20 54 68 65 20 6c 61 74 | 74 65 72 20 63 6f 6e 74 | The lat|ter cont|
|00002bc0| 61 69 6e 73 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |ains inf|ormation|
|00002bd0| 20 61 62 6f 75 74 20 65 | 78 70 6f 72 74 65 64 20 | about e|xported |
|00002be0| 6f 62 6a 65 63 74 73 20 | 66 6f 72 20 75 73 65 20 |objects |for use |
|00002bf0| 69 6e 20 74 68 65 0a 63 | 6f 6d 70 69 6c 61 74 69 |in the.c|ompilati|
|00002c00| 6f 6e 20 6f 66 20 63 6c | 69 65 6e 74 20 6d 6f 64 |on of cl|ient mod|
|00002c10| 75 6c 65 73 2e 20 54 68 | 65 20 67 65 6e 65 72 61 |ules. Th|e genera|
|00002c20| 74 69 6f 6e 20 6f 66 20 | 61 20 6e 65 77 20 73 79 |tion of |a new sy|
|00002c30| 6d 62 6f 6c 20 66 69 6c | 65 20 6d 75 73 74 2c 0a |mbol fil|e must,.|
|00002c40| 68 6f 77 65 76 65 72 2c | 20 62 65 20 73 70 65 63 |however,| be spec|
|00002c50| 69 66 69 63 61 6c 6c 79 | 20 65 6e 61 62 6c 65 64 |ifically| enabled|
|00002c60| 20 62 79 20 61 20 63 6f | 6d 70 69 6c 65 72 20 6f | by a co|mpiler o|
|00002c70| 70 74 69 6f 6e 2c 20 62 | 65 63 61 75 73 65 20 69 |ption, b|ecause i|
|00002c80| 74 20 77 69 6c 6c 0a 69 | 6e 76 61 6c 69 64 61 74 |t will.i|nvalidat|
|00002c90| 65 20 70 72 65 76 69 6f | 75 73 20 63 6f 6d 70 69 |e previo|us compi|
|00002ca0| 6c 61 74 69 6f 6e 73 20 | 6f 66 20 63 6c 69 65 6e |lations |of clien|
|00002cb0| 74 73 2e 0a 0a 54 68 65 | 20 6e 6f 74 69 6f 6e 20 |ts...The| notion |
|00002cc0| 6f 66 20 61 20 6d 61 69 | 6e 20 70 72 6f 67 72 61 |of a mai|n progra|
|00002cd0| 6d 20 68 61 73 20 62 65 | 65 6e 20 61 62 61 6e 64 |m has be|en aband|
|00002ce0| 6f 6e 65 64 2e 20 49 6e | 73 74 65 61 64 2c 20 74 |oned. In|stead, t|
|00002cf0| 68 65 20 73 65 74 20 6f | 66 0a 6d 6f 64 75 6c 65 |he set o|f.module|
|00002d00| 73 20 6c 69 6e 6b 65 64 | 20 74 68 72 6f 75 67 68 |s linked| through|
|00002d10| 20 69 6d 70 6f 72 74 73 | 20 74 79 70 69 63 61 6c | imports| typical|
|00002d20| 6c 79 20 63 6f 6e 74 61 | 69 6e 73 20 28 70 61 72 |ly conta|ins (par|
|00002d30| 61 6d 65 74 65 72 6c 65 | 73 73 29 0a 70 72 6f 63 |ameterle|ss).proc|
|00002d40| 65 64 75 72 65 73 2e 20 | 54 68 65 79 20 61 72 65 |edures. |They are|
|00002d50| 20 74 6f 20 62 65 20 63 | 6f 6e 73 69 64 65 72 65 | to be c|onsidere|
|00002d60| 64 20 61 73 20 69 6e 64 | 69 76 69 64 75 61 6c 6c |d as ind|ividuall|
|00002d70| 79 20 61 63 74 69 76 61 | 74 61 62 6c 65 2c 20 61 |y activa|table, a|
|00002d80| 6e 64 20 74 68 65 79 0a | 61 72 65 20 63 61 6c 6c |nd they.|are call|
|00002d90| 65 64 20 63 6f 6d 6d 61 | 6e 64 73 2e 20 53 75 63 |ed comma|nds. Suc|
|00002da0| 68 20 61 6e 20 61 63 74 | 69 76 61 74 69 6f 6e 20 |h an act|ivation |
|00002db0| 68 61 73 20 74 68 65 20 | 66 6f 72 6d 20 4d 2e 50 |has the |form M.P|
|00002dc0| 2c 20 77 68 65 72 65 20 | 50 20 64 65 6e 6f 74 65 |, where |P denote|
|00002dd0| 73 0a 74 68 65 20 63 6f | 6d 6d 61 6e 64 20 61 6e |s.the co|mmand an|
|00002de0| 64 20 4d 20 74 68 65 20 | 6d 6f 64 75 6c 65 20 63 |d M the |module c|
|00002df0| 6f 6e 74 61 69 6e 69 6e | 67 20 69 74 2e 20 54 68 |ontainin|g it. Th|
|00002e00| 65 20 65 66 66 65 63 74 | 20 6f 66 20 61 20 63 6f |e effect| of a co|
|00002e10| 6d 6d 61 6e 64 20 69 73 | 0a 63 6f 6e 73 69 64 65 |mmand is|.conside|
|00002e20| 72 65 64 20 2d 20 6e 6f | 74 20 6c 69 6b 65 20 74 |red - no|t like t|
|00002e30| 68 61 74 20 6f 66 20 61 | 20 6d 61 69 6e 20 70 72 |hat of a| main pr|
|00002e40| 6f 67 72 61 6d 20 61 73 | 20 61 63 63 65 70 74 69 |ogram as| accepti|
|00002e50| 6e 67 20 69 6e 70 75 74 | 20 61 6e 64 0a 74 72 61 |ng input| and.tra|
|00002e60| 6e 73 66 6f 72 6d 69 6e | 67 20 69 74 20 74 6f 20 |nsformin|g it to |
|00002e70| 6f 75 74 70 75 74 20 2d | 20 61 73 20 61 20 63 68 |output -| as a ch|
|00002e80| 61 6e 67 65 20 6f 66 20 | 73 74 61 74 65 20 72 65 |ange of |state re|
|00002e90| 70 72 65 73 65 6e 74 65 | 64 20 62 79 20 67 6c 6f |presente|d by glo|
|00002ea0| 62 61 6c 0a 64 61 74 61 | 2e 0a 0a 53 74 61 74 65 |bal.data|...State|
|00002eb0| 6d 65 6e 74 73 0a 0a 54 | 68 65 20 77 69 74 68 20 |ments..T|he with |
|00002ec0| 73 74 61 74 65 6d 65 6e | 74 20 6f 66 20 4d 6f 64 |statemen|t of Mod|
|00002ed0| 75 6c 61 20 68 61 73 20 | 62 65 65 6e 20 64 69 73 |ula has |been dis|
|00002ee0| 63 61 72 64 65 64 2e 20 | 4c 69 6b 65 20 69 6e 20 |carded. |Like in |
|00002ef0| 74 68 65 20 63 61 73 65 | 20 6f 66 0a 69 6d 70 6f |the case| of.impo|
|00002f00| 72 74 65 64 20 69 64 65 | 6e 74 69 66 69 65 72 73 |rted ide|ntifiers|
|00002f10| 2c 20 74 68 65 20 65 78 | 70 6c 69 63 69 74 20 71 |, the ex|plicit q|
|00002f20| 75 61 6c 69 66 69 63 61 | 74 69 6f 6e 20 6f 66 20 |ualifica|tion of |
|00002f30| 66 69 65 6c 64 20 69 64 | 65 6e 74 69 66 69 65 72 |field id|entifier|
|00002f40| 73 20 69 73 20 74 6f 0a | 62 65 20 70 72 65 66 65 |s is to.|be prefe|
|00002f50| 72 72 65 64 2e 20 41 6e | 6f 74 68 65 72 20 66 6f |rred. An|other fo|
|00002f60| 72 6d 20 6f 66 20 77 69 | 74 68 20 73 74 61 74 65 |rm of wi|th state|
|00002f70| 6d 65 6e 74 20 69 73 20 | 69 6e 74 72 6f 64 75 63 |ment is |introduc|
|00002f80| 65 64 3b 20 69 74 20 68 | 61 73 20 61 0a 64 69 66 |ed; it h|as a.dif|
|00002f90| 66 65 72 65 6e 74 20 66 | 75 6e 63 74 69 6f 6e 20 |ferent f|unction |
|00002fa0| 61 6e 64 20 69 73 20 63 | 61 6c 6c 65 64 20 61 20 |and is c|alled a |
|00002fb0| 72 65 67 69 6f 6e 61 6c | 20 67 75 61 72 64 20 28 |regional| guard (|
|00002fc0| 73 65 65 20 62 65 6c 6f | 77 29 2e 0a 0a 54 68 65 |see belo|w)...The|
|00002fd0| 20 65 6c 69 6d 69 6e 61 | 74 69 6f 6e 20 6f 66 20 | elimina|tion of |
|00002fe0| 74 68 65 20 66 6f 72 20 | 73 74 61 74 65 6d 65 6e |the for |statemen|
|00002ff0| 74 20 63 6f 6e 73 74 69 | 74 75 74 65 73 20 61 20 |t consti|tutes a |
|00003000| 62 72 65 61 6b 20 77 69 | 74 68 20 61 6e 6f 74 68 |break wi|th anoth|
|00003010| 65 72 20 6c 6f 6e 67 0a | 73 74 61 6e 64 69 6e 67 |er long.|standing|
|00003020| 20 74 72 61 64 69 74 69 | 6f 6e 2e 20 54 68 65 20 | traditi|on. The |
|00003030| 62 61 72 6f 71 75 65 20 | 6d 65 63 68 61 6e 69 73 |baroque |mechanis|
|00003040| 6d 20 6f 66 20 41 6c 67 | 6f 6c 20 36 30 27 73 20 |m of Alg|ol 60's |
|00003050| 66 6f 72 20 73 74 61 74 | 65 6d 65 6e 74 20 68 61 |for stat|ement ha|
|00003060| 64 0a 62 65 65 6e 20 74 | 72 69 6d 6d 65 64 20 73 |d.been t|rimmed s|
|00003070| 69 67 6e 69 66 69 63 61 | 6e 74 6c 79 20 69 6e 20 |ignifica|ntly in |
|00003080| 50 61 73 63 61 6c 20 28 | 61 6e 64 20 4d 6f 64 75 |Pascal (|and Modu|
|00003090| 6c 61 29 2e 20 49 74 73 | 20 6d 61 72 67 69 6e 61 |la). Its| margina|
|000030a0| 6c 20 76 61 6c 75 65 20 | 69 6e 0a 70 72 61 63 74 |l value |in.pract|
|000030b0| 69 63 65 20 68 61 73 20 | 6c 65 64 20 74 6f 20 69 |ice has |led to i|
|000030c0| 74 73 20 61 62 73 65 6e | 63 65 20 66 72 6f 6d 20 |ts absen|ce from |
|000030d0| 4f 62 65 72 6f 6e 2e 0a | 0a 4c 6f 77 2d 6c 65 76 |Oberon..|.Low-lev|
|000030e0| 65 6c 20 66 61 63 69 6c | 69 74 69 65 73 0a 0a 4d |el facil|ities..M|
|000030f0| 6f 64 75 6c 61 20 6d 61 | 6b 65 73 20 61 63 63 65 |odula ma|kes acce|
|00003100| 73 73 20 74 6f 20 6d 61 | 63 68 69 6e 65 2d 73 70 |ss to ma|chine-sp|
|00003110| 65 63 69 66 69 63 20 66 | 61 63 69 6c 69 74 69 65 |ecific f|acilitie|
|00003120| 73 20 70 6f 73 73 69 62 | 6c 65 20 74 68 72 6f 75 |s possib|le throu|
|00003130| 67 68 0a 6c 6f 77 2d 6c | 65 76 65 6c 20 63 6f 6e |gh.low-l|evel con|
|00003140| 73 74 72 75 63 74 73 2c | 20 73 75 63 68 20 61 73 |structs,| such as|
|00003150| 20 74 68 65 20 64 61 74 | 61 20 74 79 70 65 73 20 | the dat|a types |
|00003160| 41 44 44 52 45 53 53 20 | 61 6e 64 20 57 4f 52 44 |ADDRESS |and WORD|
|00003170| 2c 20 61 62 73 6f 6c 75 | 74 65 0a 61 64 64 72 65 |, absolu|te.addre|
|00003180| 73 73 69 6e 67 20 6f 66 | 20 76 61 72 69 61 62 6c |ssing of| variabl|
|00003190| 65 73 2c 20 61 6e 64 20 | 74 79 70 65 20 63 61 73 |es, and |type cas|
|000031a0| 74 69 6e 67 20 66 75 6e | 63 74 69 6f 6e 73 2e 20 |ting fun|ctions. |
|000031b0| 4d 6f 73 74 20 6f 66 20 | 74 68 65 6d 20 61 72 65 |Most of |them are|
|000031c0| 0a 70 61 63 6b 61 67 65 | 64 20 69 6e 20 61 20 6d |.package|d in a m|
|000031d0| 6f 64 75 6c 65 20 63 61 | 6c 6c 65 64 20 53 59 53 |odule ca|lled SYS|
|000031e0| 54 45 4d 2e 20 54 68 65 | 73 65 20 66 65 61 74 75 |TEM. The|se featu|
|000031f0| 72 65 73 20 77 65 72 65 | 20 73 75 70 70 6f 73 65 |res were| suppose|
|00003200| 64 20 74 6f 20 62 65 0a | 72 61 72 65 6c 79 20 75 |d to be.|rarely u|
|00003210| 73 65 64 20 61 6e 64 20 | 65 61 73 69 6c 79 20 76 |sed and |easily v|
|00003220| 69 73 69 62 6c 65 20 74 | 68 72 6f 75 67 68 20 74 |isible t|hrough t|
|00003230| 68 65 20 70 72 65 73 65 | 6e 63 65 20 6f 66 20 74 |he prese|nce of t|
|00003240| 68 65 20 69 64 65 6e 74 | 69 66 69 65 72 0a 53 59 |he ident|ifier.SY|
|00003250| 53 54 45 4d 20 69 6e 20 | 61 20 6d 6f 64 75 6c 65 |STEM in |a module|
|00003260| 27 73 20 69 6d 70 6f 72 | 74 20 6c 69 73 74 2e 20 |'s impor|t list. |
|00003270| 45 78 70 65 72 69 65 6e | 63 65 20 68 61 73 20 72 |Experien|ce has r|
|00003280| 65 76 65 61 6c 65 64 2c | 20 68 6f 77 65 76 65 72 |evealed,| however|
|00003290| 2c 20 74 68 61 74 20 61 | 0a 73 69 67 6e 69 66 69 |, that a|.signifi|
|000032a0| 63 61 6e 74 20 6e 75 6d | 62 65 72 20 6f 66 20 70 |cant num|ber of p|
|000032b0| 72 6f 67 72 61 6d 6d 65 | 72 73 20 69 6d 70 6f 72 |rogramme|rs impor|
|000032c0| 74 20 74 68 69 73 20 6d | 6f 64 75 6c 65 20 71 75 |t this m|odule qu|
|000032d0| 69 74 65 0a 69 6e 64 69 | 73 63 72 69 6d 69 6e 61 |ite.indi|scrimina|
|000032e0| 74 65 6c 79 2e 20 41 20 | 70 61 72 74 69 63 75 6c |tely. A |particul|
|000032f0| 61 72 6c 79 20 73 65 64 | 75 63 74 69 76 65 20 74 |arly sed|uctive t|
|00003300| 72 61 70 20 69 73 20 74 | 68 65 20 75 73 65 20 6f |rap is t|he use o|
|00003310| 66 20 20 4d 6f 64 75 6c | 61 27 73 0a 74 79 70 65 |f Modul|a's.type|
|00003320| 20 74 72 61 6e 73 66 65 | 72 20 66 75 6e 63 74 69 | transfe|r functi|
|00003330| 6f 6e 73 2e 0a 0a 49 74 | 20 61 70 70 65 61 72 73 |ons...It| appears|
|00003340| 20 70 72 65 66 65 72 61 | 62 6c 65 20 74 6f 20 64 | prefera|ble to d|
|00003350| 72 6f 70 20 74 68 65 20 | 70 72 65 74 65 6e 73 65 |rop the |pretense|
|00003360| 20 6f 66 20 70 6f 72 74 | 61 62 69 6c 69 74 79 20 | of port|ability |
|00003370| 6f 66 20 70 72 6f 67 72 | 61 6d 73 20 74 68 61 74 |of progr|ams that|
|00003380| 0a 69 6d 70 6f 72 74 20 | 61 20 22 73 74 61 6e 64 |.import |a "stand|
|00003390| 61 72 64 22 2c 20 79 65 | 74 20 73 79 73 74 65 6d |ard", ye|t system|
|000033a0| 2d 73 70 65 63 69 66 69 | 63 20 6d 6f 64 75 6c 65 |-specifi|c module|
|000033b0| 2e 20 54 79 70 65 20 74 | 72 61 6e 73 66 65 72 20 |. Type t|ransfer |
|000033c0| 66 75 6e 63 74 69 6f 6e | 73 0a 64 65 6e 6f 74 65 |function|s.denote|
|000033d0| 64 20 62 79 20 74 79 70 | 65 20 69 64 65 6e 74 69 |d by typ|e identi|
|000033e0| 66 69 65 72 73 20 61 72 | 65 20 74 68 65 72 65 66 |fiers ar|e theref|
|000033f0| 6f 72 65 20 65 6c 69 6d | 69 6e 61 74 65 64 2c 20 |ore elim|inated, |
|00003400| 61 6e 64 20 74 68 65 20 | 6d 6f 64 75 6c 65 20 53 |and the |module S|
|00003410| 59 53 54 45 4d 0a 69 73 | 20 72 65 73 74 72 69 63 |YSTEM.is| restric|
|00003420| 74 65 64 20 74 6f 20 70 | 72 6f 76 69 64 69 6e 67 |ted to p|roviding|
|00003430| 20 61 20 66 65 77 20 6d | 61 63 68 69 6e 65 2d 73 | a few m|achine-s|
|00003440| 70 65 63 69 66 69 63 20 | 66 75 6e 63 74 69 6f 6e |pecific |function|
|00003450| 73 20 74 68 61 74 20 74 | 79 70 69 63 61 6c 6c 79 |s that t|ypically|
|00003460| 0a 61 72 65 20 63 6f 6d | 70 69 6c 65 64 20 69 6e |.are com|piled in|
|00003470| 74 6f 20 69 6e 6c 69 6e | 65 20 63 6f 64 65 2e 20 |to inlin|e code. |
|00003480| 49 6e 20 70 61 72 74 69 | 63 75 6c 61 72 2c 20 69 |In parti|cular, i|
|00003490| 74 20 64 6f 65 73 20 6e | 6f 74 20 63 6f 6e 74 61 |t does n|ot conta|
|000034a0| 69 6e 20 61 6e 79 20 64 | 61 74 61 0a 74 79 70 65 |in any d|ata.type|
|000034b0| 73 2c 20 73 75 63 68 20 | 61 73 20 41 44 44 52 45 |s, such |as ADDRE|
|000034c0| 53 53 20 61 6e 64 20 57 | 4f 52 44 2e 20 49 6e 64 |SS and W|ORD. Ind|
|000034d0| 69 76 69 64 75 61 6c 20 | 69 6d 70 6c 65 6d 65 6e |ividual |implemen|
|000034e0| 74 61 74 69 6f 6e 73 20 | 61 72 65 20 66 72 65 65 |tations |are free|
|000034f0| 20 74 6f 0a 70 72 6f 76 | 69 64 65 20 61 70 70 72 | to.prov|ide appr|
|00003500| 6f 70 72 69 61 74 65 20 | 76 65 72 73 69 6f 6e 73 |opriate |versions|
|00003510| 20 6f 66 20 74 68 65 20 | 6d 6f 64 75 6c 65 20 53 | of the |module S|
|00003520| 59 53 54 45 4d 2c 20 62 | 75 74 20 74 68 65 69 72 |YSTEM, b|ut their|
|00003530| 20 66 61 63 69 6c 69 74 | 69 65 73 20 64 6f 0a 6e | facilit|ies do.n|
|00003540| 6f 74 20 62 65 6c 6f 6e | 67 20 74 6f 20 74 68 65 |ot belon|g to the|
|00003550| 20 6c 61 6e 67 75 61 67 | 65 20 64 65 66 69 6e 69 | languag|e defini|
|00003560| 74 69 6f 6e 2e 20 54 68 | 65 20 75 73 65 20 6f 66 |tion. Th|e use of|
|00003570| 20 53 59 53 54 45 4d 20 | 64 65 63 6c 61 72 65 73 | SYSTEM |declares|
|00003580| 20 61 20 70 72 6f 67 72 | 61 6d 0a 74 6f 20 62 65 | a progr|am.to be|
|00003590| 20 70 61 74 65 6e 74 6c | 79 20 69 6d 70 6c 65 6d | patentl|y implem|
|000035a0| 65 6e 74 61 74 69 6f 6e | 2d 73 70 65 63 69 66 69 |entation|-specifi|
|000035b0| 63 20 61 6e 64 20 74 68 | 65 72 65 62 79 20 6e 6f |c and th|ereby no|
|000035c0| 6e 2d 70 6f 72 74 61 62 | 6c 65 2e 0a 0a 43 6f 6e |n-portab|le...Con|
|000035d0| 63 75 72 72 65 6e 63 79 | 0a 0a 54 68 65 20 73 79 |currency|..The sy|
|000035e0| 73 74 65 6d 20 4f 62 65 | 72 6f 6e 20 64 6f 65 73 |stem Obe|ron does|
|000035f0| 20 6e 6f 74 20 72 65 71 | 75 69 72 65 20 61 6e 79 | not req|uire any|
|00003600| 20 6c 61 6e 67 75 61 67 | 65 20 66 61 63 69 6c 69 | languag|e facili|
|00003610| 74 69 65 73 20 66 6f 72 | 20 65 78 70 72 65 73 73 |ties for| express|
|00003620| 69 6e 67 0a 63 6f 6e 63 | 75 72 72 65 6e 74 20 70 |ing.conc|urrent p|
|00003630| 72 6f 63 65 73 73 65 73 | 2e 20 54 68 65 20 70 65 |rocesses|. The pe|
|00003640| 72 74 69 6e 65 6e 74 20 | 72 75 64 69 6d 65 6e 74 |rtinent |rudiment|
|00003650| 61 72 79 20 66 65 61 74 | 75 72 65 73 20 6f 66 20 |ary feat|ures of |
|00003660| 4d 6f 64 75 6c 61 2c 20 | 69 6e 0a 70 61 72 74 69 |Modula, |in.parti|
|00003670| 63 75 6c 61 72 20 74 68 | 65 20 63 6f 72 6f 75 74 |cular th|e corout|
|00003680| 69 6e 65 2c 20 77 65 72 | 65 20 74 68 65 72 65 66 |ine, wer|e theref|
|00003690| 6f 72 65 20 6e 6f 74 20 | 72 65 74 61 69 6e 65 64 |ore not |retained|
|000036a0| 2e 20 54 68 69 73 20 65 | 78 63 6c 75 73 69 6f 6e |. This e|xclusion|
|000036b0| 20 69 73 0a 6d 65 72 65 | 6c 79 20 61 20 72 65 66 | is.mere|ly a ref|
|000036c0| 6c 65 63 74 69 6f 6e 20 | 6f 66 20 6f 75 72 20 61 |lection |of our a|
|000036d0| 63 74 75 61 6c 20 6e 65 | 65 64 73 20 77 69 74 68 |ctual ne|eds with|
|000036e0| 69 6e 20 74 68 65 20 63 | 6f 6e 63 72 65 74 65 20 |in the c|oncrete |
|000036f0| 70 72 6f 6a 65 63 74 2c | 20 62 75 74 0a 6e 6f 74 |project,| but.not|
|00003700| 20 6f 6e 20 74 68 65 20 | 67 65 6e 65 72 61 6c 20 | on the |general |
|00003710| 72 65 6c 65 76 61 6e 63 | 65 20 6f 66 20 63 6f 6e |relevanc|e of con|
|00003720| 63 75 72 72 65 6e 63 79 | 20 69 6e 20 70 72 6f 67 |currency| in prog|
|00003730| 72 61 6d 6d 69 6e 67 2e | 0a 0a 46 65 61 74 75 72 |ramming.|..Featur|
|00003740| 65 73 20 69 6e 74 72 6f | 64 75 63 65 64 20 69 6e |es intro|duced in|
|00003750| 20 4f 62 65 72 6f 6e 0a | 0a 49 6e 20 63 6f 6e 74 | Oberon.|.In cont|
|00003760| 72 61 73 74 20 74 6f 20 | 74 68 65 20 6e 75 6d 62 |rast to |the numb|
|00003770| 65 72 20 6f 66 20 65 6c | 69 6d 69 6e 61 74 65 64 |er of el|iminated|
|00003780| 20 66 65 61 74 75 72 65 | 73 2c 20 74 68 65 72 65 | feature|s, there|
|00003790| 20 61 72 65 20 6f 6e 6c | 79 20 61 20 66 65 77 20 | are onl|y a few |
|000037a0| 6e 65 77 0a 6f 6e 65 73 | 2e 20 54 68 65 20 69 6d |new.ones|. The im|
|000037b0| 70 6f 72 74 61 6e 74 20 | 6e 65 77 20 63 6f 6e 63 |portant |new conc|
|000037c0| 65 70 74 73 20 61 72 65 | 20 74 79 70 65 20 65 78 |epts are| type ex|
|000037d0| 74 65 6e 73 69 6f 6e 20 | 61 6e 64 20 74 79 70 65 |tension |and type|
|000037e0| 20 69 6e 63 6c 75 73 69 | 6f 6e 2e 0a 46 75 72 74 | inclusi|on..Furt|
|000037f0| 68 65 72 6d 6f 72 65 2c | 20 6f 70 65 6e 20 61 72 |hermore,| open ar|
|00003800| 72 61 79 73 20 6d 61 79 | 20 68 61 76 65 20 73 65 |rays may| have se|
|00003810| 76 65 72 61 6c 20 64 69 | 6d 65 6e 73 69 6f 6e 73 |veral di|mensions|
|00003820| 20 28 69 6e 64 69 63 65 | 73 29 2c 20 77 68 65 72 | (indice|s), wher|
|00003830| 65 61 73 20 69 6e 0a 4d | 6f 64 75 6c 61 20 74 68 |eas in.M|odula th|
|00003840| 65 79 20 77 65 72 65 20 | 63 6f 6e 66 69 6e 65 64 |ey were |confined|
|00003850| 20 74 6f 20 61 20 73 69 | 6e 67 6c 65 20 64 69 6d | to a si|ngle dim|
|00003860| 65 6e 73 69 6f 6e 2e 0a | 0a 54 79 70 65 20 65 78 |ension..|.Type ex|
|00003870| 74 65 6e 73 69 6f 6e 0a | 0a 54 68 65 20 6d 6f 73 |tension.|.The mos|
|00003880| 74 20 69 6d 70 6f 72 74 | 61 6e 74 20 61 64 64 69 |t import|ant addi|
|00003890| 74 69 6f 6e 20 69 73 20 | 74 68 65 20 66 61 63 69 |tion is |the faci|
|000038a0| 6c 69 74 79 20 6f 66 20 | 65 78 74 65 6e 64 65 64 |lity of |extended|
|000038b0| 20 72 65 63 6f 72 64 20 | 74 79 70 65 73 2e 20 49 | record |types. I|
|000038c0| 74 0a 70 65 72 6d 69 74 | 73 20 74 68 65 20 63 6f |t.permit|s the co|
|000038d0| 6e 73 74 72 75 63 74 69 | 6f 6e 20 6f 66 20 6e 65 |nstructi|on of ne|
|000038e0| 77 20 74 79 70 65 73 20 | 6f 6e 20 74 68 65 20 62 |w types |on the b|
|000038f0| 61 73 69 73 20 6f 66 20 | 65 78 69 73 74 69 6e 67 |asis of |existing|
|00003900| 20 74 79 70 65 73 2c 20 | 61 6e 64 0a 65 73 74 61 | types, |and.esta|
|00003910| 62 6c 69 73 68 65 73 20 | 61 20 63 65 72 74 61 69 |blishes |a certai|
|00003920| 6e 20 64 65 67 72 65 65 | 20 6f 66 20 63 6f 6d 70 |n degree| of comp|
|00003930| 61 74 69 62 69 6c 69 74 | 79 20 62 65 74 77 65 65 |atibilit|y betwee|
|00003940| 6e 20 74 68 65 20 6e 65 | 77 20 61 6e 64 20 6f 6c |n the ne|w and ol|
|00003950| 64 0a 74 79 70 65 73 2e | 20 41 73 73 75 6d 69 6e |d.types.| Assumin|
|00003960| 67 20 61 20 67 69 76 65 | 6e 20 74 79 70 65 0a 0a |g a give|n type..|
|00003970| 54 20 20 3d 20 20 52 45 | 43 4f 52 44 20 78 2c 20 |T = RE|CORD x, |
|00003980| 79 3a 20 49 4e 54 45 47 | 45 52 20 45 4e 44 0a 0a |y: INTEG|ER END..|
|00003990| 65 78 74 65 6e 73 69 6f | 6e 73 20 6d 61 79 20 62 |extensio|ns may b|
|000039a0| 65 20 64 65 66 69 6e 65 | 64 20 77 68 69 63 68 20 |e define|d which |
|000039b0| 63 6f 6e 74 61 69 6e 20 | 63 65 72 74 61 69 6e 20 |contain |certain |
|000039c0| 66 69 65 6c 64 73 20 69 | 6e 20 61 64 64 69 74 69 |fields i|n additi|
|000039d0| 6f 6e 20 74 6f 20 74 68 | 65 0a 65 78 69 73 74 69 |on to th|e.existi|
|000039e0| 6e 67 20 6f 6e 65 73 2e | 20 46 6f 72 20 65 78 61 |ng ones.| For exa|
|000039f0| 6d 70 6c 65 0a 0a 54 30 | 20 20 3d 20 20 52 45 43 |mple..T0| = REC|
|00003a00| 4f 52 44 20 28 54 29 20 | 20 7a 3a 20 52 45 41 4c |ORD (T) | z: REAL|
|00003a10| 20 45 4e 44 0a 54 31 20 | 20 3d 20 20 52 45 43 4f | END.T1 | = RECO|
|00003a20| 52 44 20 28 54 29 20 20 | 77 3a 20 4c 4f 4e 47 52 |RD (T) |w: LONGR|
|00003a30| 45 41 4c 20 45 4e 44 0a | 0a 64 65 66 69 6e 65 20 |EAL END.|.define |
|00003a40| 74 79 70 65 73 20 77 69 | 74 68 20 66 69 65 6c 64 |types wi|th field|
|00003a50| 73 20 78 2c 20 79 2c 20 | 7a 20 61 6e 64 20 78 2c |s x, y, |z and x,|
|00003a60| 20 79 2c 20 77 20 72 65 | 73 70 65 63 74 69 76 65 | y, w re|spective|
|00003a70| 6c 79 2e 20 57 65 20 64 | 65 66 69 6e 65 20 61 20 |ly. We d|efine a |
|00003a80| 74 79 70 65 0a 64 65 63 | 6c 61 72 65 64 20 62 79 |type.dec|lared by|
|00003a90| 0a 0a 54 27 20 20 3d 20 | 20 52 45 43 4f 52 44 20 |..T' = | RECORD |
|00003aa0| 28 54 29 20 3c 66 69 65 | 6c 64 20 64 65 66 69 6e |(T) <fie|ld defin|
|00003ab0| 69 74 69 6f 6e 73 3e 20 | 45 4e 44 0a 0a 74 6f 20 |itions> |END..to |
|00003ac0| 62 65 20 61 20 28 64 69 | 72 65 63 74 29 20 65 78 |be a (di|rect) ex|
|00003ad0| 74 65 6e 73 69 6f 6e 20 | 6f 66 20 54 2c 20 61 6e |tension |of T, an|
|00003ae0| 64 20 63 6f 6e 76 65 72 | 73 65 6c 79 20 54 20 74 |d conver|sely T t|
|00003af0| 6f 20 62 65 20 74 68 65 | 20 28 64 69 72 65 63 74 |o be the| (direct|
|00003b00| 29 20 62 61 73 65 0a 74 | 79 70 65 20 6f 66 20 54 |) base.t|ype of T|
|00003b10| 27 2e 20 45 78 74 65 6e | 64 65 64 20 74 79 70 65 |'. Exten|ded type|
|00003b20| 73 20 6d 61 79 20 62 65 | 20 65 78 74 65 6e 64 65 |s may be| extende|
|00003b30| 64 20 61 67 61 69 6e 2c | 20 67 69 76 69 6e 67 20 |d again,| giving |
|00003b40| 72 69 73 65 20 74 6f 20 | 74 68 65 0a 66 6f 6c 6c |rise to |the.foll|
|00003b50| 6f 77 69 6e 67 20 64 65 | 66 69 6e 69 74 69 6f 6e |owing de|finition|
|00003b60| 73 3a 0a 0a 41 20 74 79 | 70 65 20 54 27 20 69 73 |s:..A ty|pe T' is|
|00003b70| 20 61 6e 20 65 78 74 65 | 6e 73 69 6f 6e 20 6f 66 | an exte|nsion of|
|00003b80| 20 54 2c 20 69 66 20 54 | 27 20 3d 20 54 20 6f 72 | T, if T|' = T or|
|00003b90| 20 54 27 20 69 73 20 61 | 20 64 69 72 65 63 74 20 | T' is a| direct |
|00003ba0| 65 78 74 65 6e 73 69 6f | 6e 20 6f 66 20 61 6e 0a |extensio|n of an.|
|00003bb0| 65 78 74 65 6e 73 69 6f | 6e 20 6f 66 20 54 2e 20 |extensio|n of T. |
|00003bc0| 43 6f 6e 76 65 72 73 65 | 6c 79 2c 20 54 20 69 73 |Converse|ly, T is|
|00003bd0| 20 61 20 62 61 73 65 20 | 74 79 70 65 20 6f 66 20 | a base |type of |
|00003be0| 54 27 2c 20 69 66 20 54 | 20 3d 20 54 27 20 6f 72 |T', if T| = T' or|
|00003bf0| 20 54 20 69 73 20 74 68 | 65 0a 64 69 72 65 63 74 | T is th|e.direct|
|00003c00| 20 62 61 73 65 20 74 79 | 70 65 20 6f 66 20 61 20 | base ty|pe of a |
|00003c10| 62 61 73 65 20 74 79 70 | 65 20 6f 66 20 54 27 2e |base typ|e of T'.|
|00003c20| 20 57 65 20 64 65 6e 6f | 74 65 20 74 68 69 73 20 | We deno|te this |
|00003c30| 72 65 6c 61 74 69 6f 6e | 73 68 69 70 20 62 79 20 |relation|ship by |
|00003c40| 54 27 20 2e 0a 54 2e 0a | 0a 54 68 65 20 72 75 6c |T' ..T..|.The rul|
|00003c50| 65 20 6f 66 20 61 73 73 | 69 67 6e 6d 65 6e 74 20 |e of ass|ignment |
|00003c60| 63 6f 6d 70 61 74 69 62 | 69 6c 69 74 79 20 73 74 |compatib|ility st|
|00003c70| 61 74 65 73 20 74 68 61 | 74 20 76 61 6c 75 65 73 |ates tha|t values|
|00003c80| 20 6f 66 20 61 6e 20 65 | 78 74 65 6e 64 65 64 20 | of an e|xtended |
|00003c90| 74 79 70 65 0a 61 72 65 | 20 61 73 73 69 67 6e 61 |type.are| assigna|
|00003ca0| 62 6c 65 20 74 6f 20 76 | 61 72 69 61 62 6c 65 73 |ble to v|ariables|
|00003cb0| 20 6f 66 20 74 68 65 69 | 72 20 62 61 73 65 20 74 | of thei|r base t|
|00003cc0| 79 70 65 73 2e 20 46 6f | 72 20 65 78 61 6d 70 6c |ypes. Fo|r exampl|
|00003cd0| 65 2c 20 61 20 72 65 63 | 6f 72 64 20 6f 66 0a 74 |e, a rec|ord of.t|
|00003ce0| 79 70 65 20 54 30 20 63 | 61 6e 20 62 65 20 61 73 |ype T0 c|an be as|
|00003cf0| 73 69 67 6e 65 64 20 74 | 6f 20 61 20 76 61 72 69 |signed t|o a vari|
|00003d00| 61 62 6c 65 20 6f 66 20 | 74 68 65 20 62 61 73 65 |able of |the base|
|00003d10| 20 74 79 70 65 20 54 2e | 20 54 68 69 73 20 61 73 | type T.| This as|
|00003d20| 73 69 67 6e 6d 65 6e 74 | 0a 69 6e 76 6f 6c 76 65 |signment|.involve|
|00003d30| 73 20 74 68 65 20 66 69 | 65 6c 64 73 20 78 20 61 |s the fi|elds x a|
|00003d40| 6e 64 20 79 20 6f 6e 6c | 79 2c 20 61 6e 64 20 69 |nd y onl|y, and i|
|00003d50| 6e 20 66 61 63 74 20 63 | 6f 6e 73 74 69 74 75 74 |n fact c|onstitut|
|00003d60| 65 73 20 61 20 70 72 6f | 6a 65 63 74 69 6f 6e 20 |es a pro|jection |
|00003d70| 6f 66 0a 74 68 65 20 76 | 61 6c 75 65 20 6f 6e 74 |of.the v|alue ont|
|00003d80| 6f 20 74 68 65 20 73 70 | 61 63 65 20 73 70 61 6e |o the sp|ace span|
|00003d90| 6e 65 64 20 62 79 20 74 | 68 65 20 62 61 73 65 20 |ned by t|he base |
|00003da0| 74 79 70 65 2e 0a 0a 49 | 74 20 69 73 20 69 6d 70 |type...I|t is imp|
|00003db0| 6f 72 74 61 6e 74 20 74 | 6f 20 61 6c 6c 6f 77 20 |ortant t|o allow |
|00003dc0| 6d 6f 64 75 6c 65 73 20 | 77 68 69 63 68 20 69 6d |modules |which im|
|00003dd0| 70 6f 72 74 20 61 20 62 | 61 73 65 20 74 79 70 65 |port a b|ase type|
|00003de0| 20 74 6f 20 62 65 20 61 | 62 6c 65 20 74 6f 0a 64 | to be a|ble to.d|
|00003df0| 65 63 6c 61 72 65 20 65 | 78 74 65 6e 64 65 64 20 |eclare e|xtended |
|00003e00| 74 79 70 65 73 2e 20 49 | 6e 20 66 61 63 74 2c 20 |types. I|n fact, |
|00003e10| 74 68 69 73 20 69 73 20 | 70 72 6f 62 61 62 6c 79 |this is |probably|
|00003e20| 20 74 68 65 20 6e 6f 72 | 6d 61 6c 20 75 73 61 67 | the nor|mal usag|
|00003e30| 65 2e 0a 0a 54 68 69 73 | 20 63 6f 6e 63 65 70 74 |e...This| concept|
|00003e40| 20 6f 66 20 65 78 74 65 | 6e 73 69 62 6c 65 20 64 | of exte|nsible d|
|00003e50| 61 74 61 20 74 79 70 65 | 20 67 61 69 6e 73 20 69 |ata type| gains i|
|00003e60| 6d 70 6f 72 74 61 6e 63 | 65 20 77 68 65 6e 20 65 |mportanc|e when e|
|00003e70| 78 74 65 6e 64 65 64 20 | 74 6f 0a 70 6f 69 6e 74 |xtended |to.point|
|00003e80| 65 72 73 2e 20 49 74 20 | 69 73 20 61 70 70 72 6f |ers. It |is appro|
|00003e90| 70 72 69 61 74 65 20 74 | 6f 20 73 61 79 20 74 68 |priate t|o say th|
|00003ea0| 61 74 20 61 20 70 6f 69 | 6e 74 65 72 20 74 79 70 |at a poi|nter typ|
|00003eb0| 65 20 50 27 20 62 6f 75 | 6e 64 20 74 6f 20 54 27 |e P' bou|nd to T'|
|00003ec0| 0a 65 78 74 65 6e 64 73 | 20 61 20 70 6f 69 6e 74 |.extends| a point|
|00003ed0| 65 72 20 74 79 70 65 20 | 50 2c 20 69 66 20 50 20 |er type |P, if P |
|00003ee0| 69 73 20 62 6f 75 6e 64 | 20 74 6f 20 61 20 62 61 |is bound| to a ba|
|00003ef0| 73 65 20 74 79 70 65 20 | 54 20 6f 66 20 54 27 2c |se type |T of T',|
|00003f00| 20 61 6e 64 20 74 6f 0a | 65 78 74 65 6e 64 20 74 | and to.|extend t|
|00003f10| 68 65 20 61 73 73 69 67 | 6e 6d 65 6e 74 20 72 75 |he assig|nment ru|
|00003f20| 6c 65 20 74 6f 20 63 6f | 76 65 72 20 74 68 69 73 |le to co|ver this|
|00003f30| 20 63 61 73 65 2e 20 49 | 74 20 69 73 20 6e 6f 77 | case. I|t is now|
|00003f40| 20 70 6f 73 73 69 62 6c | 65 20 74 6f 20 66 6f 72 | possibl|e to for|
|00003f50| 6d 0a 64 61 74 61 20 73 | 74 72 75 63 74 75 72 65 |m.data s|tructure|
|00003f60| 73 20 77 68 6f 73 65 20 | 6e 6f 64 65 73 20 61 72 |s whose |nodes ar|
|00003f70| 65 20 6f 66 20 64 69 66 | 66 65 72 65 6e 74 20 74 |e of dif|ferent t|
|00003f80| 79 70 65 73 2c 20 69 2e | 65 2e 20 69 6e 68 6f 6d |ypes, i.|e. inhom|
|00003f90| 6f 67 65 6e 65 6f 75 73 | 20 64 61 74 61 0a 73 74 |ogeneous| data.st|
|00003fa0| 72 75 63 74 75 72 65 73 | 2e 20 54 68 65 20 69 6e |ructures|. The in|
|00003fb0| 68 6f 6d 6f 67 65 6e 65 | 69 74 79 20 69 73 20 61 |homogene|ity is a|
|00003fc0| 75 74 6f 6d 61 74 69 63 | 61 6c 6c 79 20 28 61 6e |utomatic|ally (an|
|00003fd0| 64 20 6d 6f 73 74 20 73 | 65 6e 73 69 62 6c 79 29 |d most s|ensibly)|
|00003fe0| 20 62 6f 75 6e 64 65 64 | 0a 62 79 20 74 68 65 20 | bounded|.by the |
|00003ff0| 66 61 63 74 20 74 68 61 | 74 20 74 68 65 20 6e 6f |fact tha|t the no|
|00004000| 64 65 73 20 61 72 65 20 | 6c 69 6e 6b 65 64 20 62 |des are |linked b|
|00004010| 79 20 70 6f 69 6e 74 65 | 72 73 20 6f 66 20 61 20 |y pointe|rs of a |
|00004020| 63 6f 6d 6d 6f 6e 20 62 | 61 73 65 20 74 79 70 65 |common b|ase type|
|00004030| 2e 0a 0a 54 79 70 69 63 | 61 6c 6c 79 2c 20 74 68 |...Typic|ally, th|
|00004040| 65 20 70 6f 69 6e 74 65 | 72 20 66 69 65 6c 64 73 |e pointe|r fields|
|00004050| 20 65 73 74 61 62 6c 69 | 73 68 69 6e 67 20 74 68 | establi|shing th|
|00004060| 65 20 73 74 72 75 63 74 | 75 72 65 20 61 72 65 20 |e struct|ure are |
|00004070| 63 6f 6e 74 61 69 6e 65 | 64 20 69 6e 0a 74 68 65 |containe|d in.the|
|00004080| 20 62 61 73 65 20 74 79 | 70 65 20 54 2c 20 61 6e | base ty|pe T, an|
|00004090| 64 20 74 68 65 20 70 72 | 6f 63 65 64 75 72 65 73 |d the pr|ocedures|
|000040a0| 20 6d 61 6e 69 70 75 6c | 61 74 69 6e 67 20 74 68 | manipul|ating th|
|000040b0| 65 20 73 74 72 75 63 74 | 75 72 65 20 61 72 65 20 |e struct|ure are |
|000040c0| 64 65 66 69 6e 65 64 0a | 69 6e 20 74 68 65 20 73 |defined.|in the s|
|000040d0| 61 6d 65 20 28 62 61 73 | 65 29 20 6d 6f 64 75 6c |ame (bas|e) modul|
|000040e0| 65 20 61 73 20 54 2e 20 | 49 6e 64 69 76 69 64 75 |e as T. |Individu|
|000040f0| 61 6c 20 65 78 74 65 6e | 73 69 6f 6e 73 20 28 76 |al exten|sions (v|
|00004100| 61 72 69 61 6e 74 73 29 | 20 61 72 65 0a 64 65 66 |ariants)| are.def|
|00004110| 69 6e 65 64 20 69 6e 20 | 63 6c 69 65 6e 74 20 6d |ined in |client m|
|00004120| 6f 64 75 6c 65 73 20 74 | 6f 67 65 74 68 65 72 20 |odules t|ogether |
|00004130| 77 69 74 68 20 70 72 6f | 63 65 64 75 72 65 73 20 |with pro|cedures |
|00004140| 6f 70 65 72 61 74 69 6e | 67 20 6f 6e 20 6e 6f 64 |operatin|g on nod|
|00004150| 65 73 20 6f 66 0a 74 68 | 65 20 65 78 74 65 6e 64 |es of.th|e extend|
|00004160| 65 64 20 74 79 70 65 2e | 20 54 68 69 73 20 73 63 |ed type.| This sc|
|00004170| 68 65 6d 65 20 69 73 20 | 69 6e 20 66 75 6c 6c 20 |heme is |in full |
|00004180| 61 63 63 6f 72 64 61 6e | 63 65 20 77 69 74 68 20 |accordan|ce with |
|00004190| 74 68 65 20 6e 6f 74 69 | 6f 6e 20 6f 66 0a 73 79 |the noti|on of.sy|
|000041a0| 73 74 65 6d 20 65 78 74 | 65 6e 73 69 62 69 6c 69 |stem ext|ensibili|
|000041b0| 74 79 3a 20 6e 65 77 20 | 6d 6f 64 75 6c 65 73 20 |ty: new |modules |
|000041c0| 64 65 66 69 6e 69 6e 67 | 20 6e 65 77 20 65 78 74 |defining| new ext|
|000041d0| 65 6e 73 69 6f 6e 73 20 | 6d 61 79 20 62 65 20 61 |ensions |may be a|
|000041e0| 64 64 65 64 20 74 6f 20 | 61 0a 73 79 73 74 65 6d |dded to |a.system|
|000041f0| 20 77 69 74 68 6f 75 74 | 20 72 65 71 75 69 72 69 | without| requiri|
|00004200| 6e 67 20 61 20 63 68 61 | 6e 67 65 20 6f 66 20 74 |ng a cha|nge of t|
|00004210| 68 65 20 62 61 73 65 20 | 6d 6f 64 75 6c 65 73 2c |he base |modules,|
|00004220| 20 6e 6f 74 20 65 76 65 | 6e 20 74 68 65 69 72 0a | not eve|n their.|
|00004230| 72 65 63 6f 6d 70 69 6c | 61 74 69 6f 6e 2e 0a 0a |recompil|ation...|
|00004240| 41 73 20 61 63 63 65 73 | 73 20 74 6f 20 61 6e 20 |As acces|s to an |
|00004250| 69 6e 64 69 76 69 64 75 | 61 6c 20 6e 6f 64 65 20 |individu|al node |
|00004260| 76 69 61 20 61 20 70 6f | 69 6e 74 65 72 20 62 6f |via a po|inter bo|
|00004270| 75 6e 64 20 74 6f 20 61 | 20 62 61 73 65 20 74 79 |und to a| base ty|
|00004280| 70 65 20 70 72 6f 76 69 | 64 65 73 0a 61 20 70 72 |pe provi|des.a pr|
|00004290| 6f 6a 65 63 74 65 64 20 | 76 69 65 77 20 6f 66 20 |ojected |view of |
|000042a0| 74 68 65 20 6e 6f 64 65 | 20 64 61 74 61 20 6f 6e |the node| data on|
|000042b0| 6c 79 2c 20 61 20 66 61 | 63 69 6c 69 74 79 20 74 |ly, a fa|cility t|
|000042c0| 6f 20 77 69 64 65 6e 20 | 74 68 65 20 76 69 65 77 |o widen |the view|
|000042d0| 20 69 73 0a 6e 65 63 65 | 73 73 61 72 79 2e 20 49 | is.nece|ssary. I|
|000042e0| 74 20 64 65 70 65 6e 64 | 73 20 6f 6e 20 74 68 65 |t depend|s on the|
|000042f0| 20 61 62 69 6c 69 74 79 | 20 74 6f 20 64 65 74 65 | ability| to dete|
|00004300| 72 6d 69 6e 65 20 74 68 | 65 20 61 63 74 75 61 6c |rmine th|e actual|
|00004310| 20 74 79 70 65 20 6f 66 | 20 74 68 65 0a 72 65 66 | type of| the.ref|
|00004320| 65 72 65 6e 63 65 64 20 | 6e 6f 64 65 2e 20 54 68 |erenced |node. Th|
|00004330| 69 73 20 69 73 20 61 63 | 68 69 65 76 65 64 20 62 |is is ac|hieved b|
|00004340| 79 20 61 20 74 79 70 65 | 20 74 65 73 74 2c 20 61 |y a type| test, a|
|00004350| 20 42 6f 6f 6c 65 61 6e | 20 65 78 70 72 65 73 73 | Boolean| express|
|00004360| 69 6f 6e 20 6f 66 0a 74 | 68 65 20 66 6f 72 6d 0a |ion of.t|he form.|
|00004370| 0a 74 20 49 53 20 54 27 | 20 20 28 6f 72 20 20 20 |.t IS T'| (or |
|00004380| 70 20 49 53 20 50 27 29 | 0a 0a 49 66 20 74 68 65 |p IS P')|..If the|
|00004390| 20 74 65 73 74 20 69 73 | 20 61 66 66 69 72 6d 61 | test is| affirma|
|000043a0| 74 69 76 65 2c 20 61 6e | 20 61 73 73 69 67 6e 6d |tive, an| assignm|
|000043b0| 65 6e 74 20 74 27 20 3a | 3d 20 74 20 28 74 27 20 |ent t' :|= t (t' |
|000043c0| 6f 66 20 74 79 70 65 20 | 54 27 29 20 6f 72 20 70 |of type |T') or p|
|000043d0| 27 20 3a 3d 0a 70 20 28 | 70 27 20 6f 66 20 74 79 |' :=.p (|p' of ty|
|000043e0| 70 65 20 50 27 29 20 73 | 68 6f 75 6c 64 20 62 65 |pe P') s|hould be|
|000043f0| 20 70 6f 73 73 69 62 6c | 65 2e 20 54 68 65 20 73 | possibl|e. The s|
|00004400| 74 61 74 69 63 20 76 69 | 65 77 20 6f 66 20 74 79 |tatic vi|ew of ty|
|00004410| 70 65 73 2c 20 68 6f 77 | 65 76 65 72 2c 0a 70 72 |pes, how|ever,.pr|
|00004420| 6f 68 69 62 69 74 73 20 | 74 68 69 73 2e 20 4e 6f |ohibits |this. No|
|00004430| 74 65 20 74 68 61 74 20 | 62 6f 74 68 20 61 73 73 |te that |both ass|
|00004440| 69 67 6e 6d 65 6e 74 73 | 20 76 69 6f 6c 61 74 65 |ignments| violate|
|00004450| 20 74 68 65 20 72 75 6c | 65 20 6f 66 20 61 73 73 | the rul|e of ass|
|00004460| 69 67 6e 6d 65 6e 74 0a | 63 6f 6d 70 61 74 69 62 |ignment.|compatib|
|00004470| 69 6c 69 74 79 2e 20 54 | 68 65 20 64 65 73 69 72 |ility. T|he desir|
|00004480| 65 64 20 61 73 73 69 67 | 6e 6d 65 6e 74 20 69 73 |ed assig|nment is|
|00004490| 20 6d 61 64 65 20 70 6f | 73 73 69 62 6c 65 20 62 | made po|ssible b|
|000044a0| 79 20 70 72 6f 76 69 64 | 69 6e 67 20 61 20 74 79 |y provid|ing a ty|
|000044b0| 70 65 0a 67 75 61 72 64 | 20 6f 66 20 74 68 65 20 |pe.guard| of the |
|000044c0| 66 6f 72 6d 0a 0a 74 27 | 20 3a 3d 20 74 28 54 27 |form..t'| := t(T'|
|000044d0| 29 20 20 28 70 27 20 3a | 3d 20 70 28 50 27 29 29 |) (p' :|= p(P'))|
|000044e0| 0a 0a 61 6e 64 20 62 79 | 20 74 68 65 20 73 61 6d |..and by| the sam|
|000044f0| 65 20 74 6f 6b 65 6e 20 | 61 63 63 65 73 73 20 74 |e token |access t|
|00004500| 6f 20 74 68 65 20 66 69 | 65 6c 64 20 7a 20 6f 66 |o the fi|eld z of|
|00004510| 20 61 20 54 30 20 28 73 | 65 65 20 70 72 65 76 69 | a T0 (s|ee previ|
|00004520| 6f 75 73 20 65 78 61 6d | 70 6c 65 73 29 0a 69 73 |ous exam|ples).is|
|00004530| 20 6d 61 64 65 20 70 6f | 73 73 69 62 6c 65 20 62 | made po|ssible b|
|00004540| 79 20 61 20 74 79 70 65 | 20 67 75 61 72 64 20 69 |y a type| guard i|
|00004550| 6e 20 74 68 65 20 64 65 | 73 69 67 6e 61 74 6f 72 |n the de|signator|
|00004560| 20 20 74 28 54 30 29 2e | 7a 2e 20 48 65 72 65 20 | t(T0).|z. Here |
|00004570| 74 68 65 20 67 75 61 72 | 64 0a 61 73 73 65 72 74 |the guar|d.assert|
|00004580| 73 20 74 68 61 74 20 74 | 20 69 73 20 28 63 75 72 |s that t| is (cur|
|00004590| 72 65 6e 74 6c 79 29 20 | 6f 66 20 74 79 70 65 20 |rently) |of type |
|000045a0| 54 30 2e 20 49 6e 20 61 | 6e 61 6c 6f 67 79 20 74 |T0. In a|nalogy t|
|000045b0| 6f 20 61 72 72 61 79 20 | 62 6f 75 6e 64 20 63 68 |o array |bound ch|
|000045c0| 65 63 6b 73 0a 61 6e 64 | 20 63 61 73 65 20 73 65 |ecks.and| case se|
|000045d0| 6c 65 63 74 6f 72 73 2c | 20 61 20 66 61 69 6c 69 |lectors,| a faili|
|000045e0| 6e 67 20 67 75 61 72 64 | 20 6c 65 61 64 73 20 74 |ng guard| leads t|
|000045f0| 6f 20 70 72 6f 67 72 61 | 6d 20 61 62 6f 72 74 69 |o progra|m aborti|
|00004600| 6f 6e 2e 0a 0a 57 68 65 | 72 65 61 73 20 61 20 67 |on...Whe|reas a g|
|00004610| 75 61 72 64 20 6f 66 20 | 74 68 65 20 66 6f 72 6d |uard of |the form|
|00004620| 20 74 28 54 29 20 61 73 | 73 65 72 74 73 20 74 68 | t(T) as|serts th|
|00004630| 61 74 20 74 20 69 73 20 | 6f 66 20 74 79 70 65 20 |at t is |of type |
|00004640| 54 20 66 6f 72 20 74 68 | 65 0a 64 65 73 69 67 6e |T for th|e.design|
|00004650| 61 74 6f 72 20 28 73 74 | 61 72 74 69 6e 67 20 77 |ator (st|arting w|
|00004660| 69 74 68 29 20 74 20 6f | 6e 6c 79 2c 20 61 20 72 |ith) t o|nly, a r|
|00004670| 65 67 69 6f 6e 61 6c 20 | 74 79 70 65 20 67 75 61 |egional |type gua|
|00004680| 72 64 20 6d 61 69 6e 74 | 61 69 6e 73 20 74 68 65 |rd maint|ains the|
|00004690| 0a 61 73 73 65 72 74 69 | 6f 6e 20 6f 76 65 72 20 |.asserti|on over |
|000046a0| 61 6e 20 65 6e 74 69 72 | 65 20 73 65 71 75 65 6e |an entir|e sequen|
|000046b0| 63 65 20 6f 66 20 73 74 | 61 74 65 6d 65 6e 74 73 |ce of st|atements|
|000046c0| 2e 20 49 74 20 68 61 73 | 20 74 68 65 20 66 6f 72 |. It has| the for|
|000046d0| 6d 0a 0a 57 49 54 48 20 | 74 3a 20 54 20 44 4f 20 |m..WITH |t: T DO |
|000046e0| 53 74 61 74 65 6d 65 6e | 74 53 65 71 75 65 6e 63 |Statemen|tSequenc|
|000046f0| 65 20 45 4e 44 0a 0a 61 | 6e 64 20 73 70 65 63 69 |e END..a|nd speci|
|00004700| 66 69 65 73 20 74 68 61 | 74 20 74 20 69 73 20 74 |fies tha|t t is t|
|00004710| 6f 20 62 65 20 72 65 67 | 61 72 64 65 64 20 61 73 |o be reg|arded as|
|00004720| 20 6f 66 20 74 79 70 65 | 20 54 20 77 69 74 68 69 | of type| T withi|
|00004730| 6e 20 74 68 65 20 65 6e | 74 69 72 65 0a 73 74 61 |n the en|tire.sta|
|00004740| 74 65 6d 65 6e 74 20 73 | 65 71 75 65 6e 63 65 2e |tement s|equence.|
|00004750| 20 54 79 70 69 63 61 6c | 6c 79 2c 20 54 20 69 73 | Typical|ly, T is|
|00004760| 20 61 6e 20 65 78 74 65 | 6e 73 69 6f 6e 20 6f 66 | an exte|nsion of|
|00004770| 20 74 68 65 20 64 65 63 | 6c 61 72 65 64 20 74 79 | the dec|lared ty|
|00004780| 70 65 20 6f 66 20 74 2e | 0a 4e 6f 74 65 20 74 68 |pe of t.|.Note th|
|00004790| 61 74 20 61 73 73 69 67 | 6e 6d 65 6e 74 73 20 74 |at assig|nments t|
|000047a0| 6f 20 74 20 77 69 74 68 | 69 6e 20 74 68 65 20 72 |o t with|in the r|
|000047b0| 65 67 69 6f 6e 20 74 68 | 65 72 65 66 6f 72 65 20 |egion th|erefore |
|000047c0| 72 65 71 75 69 72 65 20 | 74 68 65 20 61 73 73 69 |require |the assi|
|000047d0| 67 6e 65 64 0a 76 61 6c | 75 65 20 74 6f 20 62 65 |gned.val|ue to be|
|000047e0| 20 28 61 6e 20 65 78 74 | 65 6e 73 69 6f 6e 29 20 | (an ext|ension) |
|000047f0| 6f 66 20 74 79 70 65 20 | 54 2e 20 54 68 65 20 72 |of type |T. The r|
|00004800| 65 67 69 6f 6e 61 6c 20 | 67 75 61 72 64 20 73 65 |egional |guard se|
|00004810| 72 76 65 73 20 74 6f 20 | 72 65 64 75 63 65 0a 74 |rves to |reduce.t|
|00004820| 68 65 20 6e 75 6d 62 65 | 72 20 6f 66 20 67 75 61 |he numbe|r of gua|
|00004830| 72 64 20 65 76 61 6c 75 | 61 74 69 6f 6e 73 2e 0a |rd evalu|ations..|
|00004840| 0a 41 73 20 61 6e 20 65 | 78 61 6d 70 6c 65 20 6f |.As an e|xample o|
|00004850| 66 20 74 68 65 20 75 73 | 65 20 6f 66 20 74 79 70 |f the us|e of typ|
|00004860| 65 20 74 65 73 74 73 20 | 61 6e 64 20 67 75 61 72 |e tests |and guar|
|00004870| 64 73 2c 20 63 6f 6e 73 | 69 64 65 72 20 74 68 65 |ds, cons|ider the|
|00004880| 20 66 6f 6c 6c 6f 77 69 | 6e 67 0a 74 79 70 65 73 | followi|ng.types|
|00004890| 20 4e 6f 64 65 20 61 6e | 64 20 4f 62 6a 65 63 74 | Node an|d Object|
|000048a0| 20 64 65 66 69 6e 65 64 | 20 69 6e 20 61 20 6d 6f | defined| in a mo|
|000048b0| 64 75 6c 65 20 4d 3a 0a | 0a 54 59 50 45 20 20 4e |dule M:.|.TYPE N|
|000048c0| 6f 64 65 20 3d 20 20 50 | 4f 49 4e 54 45 52 20 54 |ode = P|OINTER T|
|000048d0| 4f 20 4f 62 6a 65 63 74 | 3b 0a 20 20 4f 62 6a 65 |O Object|;. Obje|
|000048e0| 63 74 20 3d 20 20 52 45 | 43 4f 52 44 20 6b 65 79 |ct = RE|CORD key|
|000048f0| 2c 20 78 2c 20 79 3a 20 | 49 4e 54 45 47 45 52 3b |, x, y: |INTEGER;|
|00004900| 0a 20 20 20 20 20 20 20 | 20 20 6c 65 66 74 2c 20 |. | left, |
|00004910| 72 69 67 68 74 3a 20 4e | 6f 64 65 0a 20 20 20 20 |right: N|ode. |
|00004920| 45 4e 44 0a 0a 45 6c 65 | 6d 65 6e 74 73 20 69 6e |END..Ele|ments in|
|00004930| 20 61 20 74 72 65 65 20 | 73 74 72 75 63 74 75 72 | a tree |structur|
|00004940| 65 20 61 6e 63 68 6f 72 | 65 64 20 69 6e 20 61 20 |e anchor|ed in a |
|00004950| 76 61 72 69 61 62 6c 65 | 20 63 61 6c 6c 65 64 20 |variable| called |
|00004960| 72 6f 6f 74 20 28 6f 66 | 20 74 79 70 65 0a 4e 6f |root (of| type.No|
|00004970| 64 65 29 20 61 72 65 20 | 73 65 61 72 63 68 65 64 |de) are |searched|
|00004980| 20 62 79 20 74 68 65 20 | 70 72 6f 63 65 64 75 72 | by the |procedur|
|00004990| 65 20 20 65 6c 65 6d 65 | 6e 74 20 20 64 65 66 69 |e eleme|nt defi|
|000049a0| 6e 65 64 20 69 6e 20 4d | 2e 0a 0a 50 52 4f 43 45 |ned in M|...PROCE|
|000049b0| 44 55 52 45 20 65 6c 65 | 6d 65 6e 74 28 6b 3a 20 |DURE ele|ment(k: |
|000049c0| 49 4e 54 45 47 45 52 29 | 3a 20 4e 6f 64 65 3b 0a |INTEGER)|: Node;.|
|000049d0| 20 20 56 41 52 20 70 3a | 20 4e 6f 64 65 3b 0a 42 | VAR p:| Node;.B|
|000049e0| 45 47 49 4e 20 70 20 3a | 3d 20 72 6f 6f 74 3b 0a |EGIN p :|= root;.|
|000049f0| 20 20 57 48 49 4c 45 20 | 28 70 20 23 20 4e 49 4c | WHILE |(p # NIL|
|00004a00| 29 20 26 20 28 70 2e 6b | 65 79 20 23 20 6b 29 20 |) & (p.k|ey # k) |
|00004a10| 44 4f 0a 20 20 20 20 49 | 46 20 70 2e 6b 65 79 20 |DO. I|F p.key |
|00004a20| 3c 20 6b 20 54 48 45 4e | 20 70 20 3a 3d 20 70 2e |< k THEN| p := p.|
|00004a30| 6c 65 66 74 20 45 4c 53 | 45 20 70 20 3a 3d 20 70 |left ELS|E p := p|
|00004a40| 2e 72 69 67 68 74 20 45 | 4e 44 0a 20 20 45 4e 44 |.right E|ND. END|
|00004a50| 20 3b 0a 20 20 52 45 54 | 55 52 4e 20 70 0a 45 4e | ;. RET|URN p.EN|
|00004a60| 44 20 65 6c 65 6d 65 6e | 74 0a 0a 4c 65 74 20 65 |D elemen|t..Let e|
|00004a70| 78 74 65 6e 73 69 6f 6e | 73 20 6f 66 20 74 68 65 |xtension|s of the|
|00004a80| 20 74 79 70 65 20 4f 62 | 6a 65 63 74 20 62 65 20 | type Ob|ject be |
|00004a90| 64 65 66 69 6e 65 64 20 | 28 74 6f 67 65 74 68 65 |defined |(togethe|
|00004aa0| 72 20 77 69 74 68 20 74 | 68 65 69 72 20 70 6f 69 |r with t|heir poi|
|00004ab0| 6e 74 65 72 0a 74 79 70 | 65 73 29 20 69 6e 20 61 |nter.typ|es) in a|
|00004ac0| 20 6d 6f 64 75 6c 65 20 | 4d 31 20 77 68 69 63 68 | module |M1 which|
|00004ad0| 20 69 73 20 61 20 63 6c | 69 65 6e 74 20 6f 66 20 | is a cl|ient of |
|00004ae0| 4d 3a 0a 0a 54 59 50 45 | 20 20 52 65 63 74 61 6e |M:..TYPE| Rectan|
|00004af0| 67 6c 65 20 3d 20 20 50 | 4f 49 4e 54 45 52 20 54 |gle = P|OINTER T|
|00004b00| 4f 20 52 65 63 74 4f 62 | 6a 65 63 74 3b 0a 20 20 |O RectOb|ject;. |
|00004b10| 52 65 63 74 4f 62 6a 65 | 63 74 20 3d 20 20 52 45 |RectObje|ct = RE|
|00004b20| 43 4f 52 44 20 28 4f 62 | 6a 65 63 74 29 20 77 2c |CORD (Ob|ject) w,|
|00004b30| 20 68 3a 20 52 45 41 4c | 20 45 4e 44 20 3b 0a 20 | h: REAL| END ;. |
|00004b40| 20 43 69 72 63 6c 65 20 | 3d 20 20 50 4f 49 4e 54 | Circle |= POINT|
|00004b50| 45 52 20 54 4f 20 43 69 | 72 63 6c 65 4f 62 6a 65 |ER TO Ci|rcleObje|
|00004b60| 63 74 3b 0a 20 20 43 69 | 72 63 6c 65 4f 62 6a 65 |ct;. Ci|rcleObje|
|00004b70| 63 74 20 3d 20 20 52 45 | 43 4f 52 44 20 28 4f 62 |ct = RE|CORD (Ob|
|00004b80| 6a 65 63 74 29 20 72 61 | 64 3a 20 52 45 41 4c 3b |ject) ra|d: REAL;|
|00004b90| 20 73 68 61 64 65 64 3a | 20 42 4f 4f 4c 45 41 4e | shaded:| BOOLEAN|
|00004ba0| 20 45 4e 44 0a 0a 41 66 | 74 65 72 20 74 68 65 20 | END..Af|ter the |
|00004bb0| 73 65 61 72 63 68 20 6f | 66 20 61 6e 20 65 6c 65 |search o|f an ele|
|00004bc0| 6d 65 6e 74 2c 20 74 68 | 65 20 74 79 70 65 20 74 |ment, th|e type t|
|00004bd0| 65 73 74 20 69 73 20 75 | 73 65 64 20 74 6f 20 64 |est is u|sed to d|
|00004be0| 69 73 63 72 69 6d 69 6e | 61 74 65 0a 62 65 74 77 |iscrimin|ate.betw|
|00004bf0| 65 65 6e 20 74 68 65 20 | 64 69 66 66 65 72 65 6e |een the |differen|
|00004c00| 74 20 65 78 74 65 6e 73 | 69 6f 6e 73 2c 20 61 6e |t extens|ions, an|
|00004c10| 64 20 74 68 65 20 74 79 | 70 65 20 67 75 61 72 64 |d the ty|pe guard|
|00004c20| 20 74 6f 20 61 63 63 65 | 73 73 20 65 78 74 65 6e | to acce|ss exten|
|00004c30| 73 69 6f 6e 0a 66 69 65 | 6c 64 73 2e 20 46 6f 72 |sion.fie|lds. For|
|00004c40| 20 65 78 61 6d 70 6c 65 | 3a 0a 0a 70 20 3a 3d 20 | example|:..p := |
|00004c50| 4d 2e 65 6c 65 6d 65 6e | 74 28 4b 29 3b 0a 49 46 |M.elemen|t(K);.IF|
|00004c60| 20 70 20 23 20 4e 49 4c | 20 54 48 45 4e 0a 20 20 | p # NIL| THEN. |
|00004c70| 49 46 20 70 20 49 53 20 | 52 65 63 74 61 6e 67 6c |IF p IS |Rectangl|
|00004c80| 65 20 54 48 45 4e 20 20 | 2e 2e 2e 20 20 70 28 52 |e THEN |... p(R|
|00004c90| 65 63 74 61 6e 67 6c 65 | 29 2e 77 20 20 2e 2e 2e |ectangle|).w ...|
|00004ca0| 0a 20 20 45 4c 53 49 46 | 20 28 70 20 49 53 20 43 |. ELSIF| (p IS C|
|00004cb0| 69 72 63 6c 65 29 20 26 | 20 7e 70 28 43 69 72 63 |ircle) &| ~p(Circ|
|00004cc0| 6c 65 29 2e 73 68 61 64 | 65 64 20 54 48 45 4e 20 |le).shad|ed THEN |
|00004cd0| 20 2e 2e 2e 20 20 70 28 | 43 69 72 63 6c 65 29 2e | ... p(|Circle).|
|00004ce0| 72 61 64 20 20 2e 2e 2e | 0a 20 20 45 4c 53 49 46 |rad ...|. ELSIF|
|00004cf0| 20 20 2e 2e 2e 0a 0a 54 | 68 65 20 65 78 74 65 6e | .....T|he exten|
|00004d00| 73 69 62 69 6c 69 74 79 | 20 6f 66 20 61 20 73 79 |sibility| of a sy|
|00004d10| 73 74 65 6d 20 72 65 73 | 74 73 20 75 70 6f 6e 20 |stem res|ts upon |
|00004d20| 74 68 65 20 70 72 65 6d | 69 73 65 20 74 68 61 74 |the prem|ise that|
|00004d30| 20 6e 65 77 20 6d 6f 64 | 75 6c 65 73 0a 64 65 66 | new mod|ules.def|
|00004d40| 69 6e 69 6e 67 20 6e 65 | 77 20 65 78 74 65 6e 73 |ining ne|w extens|
|00004d50| 69 6f 6e 73 20 6d 61 79 | 20 62 65 20 61 64 64 65 |ions may| be adde|
|00004d60| 64 20 77 69 74 68 6f 75 | 74 20 72 65 71 75 69 72 |d withou|t requir|
|00004d70| 69 6e 67 20 61 64 61 70 | 74 61 74 69 6f 6e 73 20 |ing adap|tations |
|00004d80| 6e 6f 72 20 65 76 65 6e | 0a 72 65 63 6f 6d 70 69 |nor even|.recompi|
|00004d90| 6c 61 74 69 6f 6e 20 6f | 66 20 74 68 65 20 65 78 |lation o|f the ex|
|00004da0| 69 73 74 69 6e 67 20 70 | 61 72 74 73 2c 20 61 6c |isting p|arts, al|
|00004db0| 74 68 6f 75 67 68 20 63 | 6f 6d 70 6f 6e 65 6e 74 |though c|omponent|
|00004dc0| 73 20 6f 66 20 74 68 65 | 20 6e 65 77 20 74 79 70 |s of the| new typ|
|00004dd0| 65 73 0a 61 72 65 20 69 | 6e 63 6c 75 64 65 64 20 |es.are i|ncluded |
|00004de0| 69 6e 20 61 6c 72 65 61 | 64 79 20 65 78 69 73 74 |in alrea|dy exist|
|00004df0| 69 6e 67 20 64 61 74 61 | 20 73 74 72 75 63 74 75 |ing data| structu|
|00004e00| 72 65 73 2e 0a 0a 54 68 | 65 20 74 79 70 65 20 65 |res...Th|e type e|
|00004e10| 78 74 65 6e 73 69 6f 6e | 20 66 61 63 69 6c 69 74 |xtension| facilit|
|00004e20| 79 20 6e 6f 74 20 6f 6e | 6c 79 20 72 65 70 6c 61 |y not on|ly repla|
|00004e30| 63 65 73 20 4d 6f 64 75 | 6c 61 27 73 20 76 61 72 |ces Modu|la's var|
|00004e40| 69 61 6e 74 20 72 65 63 | 6f 72 64 73 2c 20 62 75 |iant rec|ords, bu|
|00004e50| 74 0a 72 65 70 72 65 73 | 65 6e 74 73 20 61 20 74 |t.repres|ents a t|
|00004e60| 79 70 65 2d 73 61 66 65 | 20 61 6c 74 65 72 6e 61 |ype-safe| alterna|
|00004e70| 74 69 76 65 2e 20 45 71 | 75 61 6c 6c 79 20 69 6d |tive. Eq|ually im|
|00004e80| 70 6f 72 74 61 6e 74 20 | 69 73 20 69 74 73 20 65 |portant |is its e|
|00004e90| 66 66 65 63 74 20 6f 66 | 0a 72 65 6c 61 74 69 6e |ffect of|.relatin|
|00004ea0| 67 20 74 79 70 65 73 20 | 69 6e 20 61 20 74 79 70 |g types |in a typ|
|00004eb0| 65 20 68 69 65 72 61 72 | 63 68 79 2e 20 57 65 20 |e hierar|chy. We |
|00004ec0| 63 6f 6d 70 61 72 65 2c | 20 66 6f 72 20 65 78 61 |compare,| for exa|
|00004ed0| 6d 70 6c 65 2c 20 74 68 | 65 20 4d 6f 64 75 6c 61 |mple, th|e Modula|
|00004ee0| 0a 74 79 70 65 73 0a 0a | 54 30 27 20 20 3d 20 20 |.types..|T0' = |
|00004ef0| 52 45 43 4f 52 44 20 74 | 3a 20 54 3b 20 20 7a 3a |RECORD t|: T; z:|
|00004f00| 20 52 45 41 4c 20 45 4e | 44 20 3b 0a 54 31 27 20 | REAL EN|D ;.T1' |
|00004f10| 20 3d 20 20 52 45 43 4f | 52 44 20 74 3a 20 54 3b | = RECO|RD t: T;|
|00004f20| 20 20 77 3a 20 4c 4f 4e | 47 52 45 41 4c 20 45 4e | w: LON|GREAL EN|
|00004f30| 44 0a 0a 77 68 69 63 68 | 20 72 65 66 65 72 20 74 |D..which| refer t|
|00004f40| 6f 20 74 68 65 20 64 65 | 66 69 6e 69 74 69 6f 6e |o the de|finition|
|00004f50| 20 6f 66 20 54 20 67 69 | 76 65 6e 20 61 62 6f 76 | of T gi|ven abov|
|00004f60| 65 2c 20 77 69 74 68 20 | 74 68 65 20 65 78 74 65 |e, with |the exte|
|00004f70| 6e 64 65 64 20 4f 62 65 | 72 6f 6e 0a 74 79 70 65 |nded Obe|ron.type|
|00004f80| 73 20 54 30 20 61 6e 64 | 20 54 31 20 64 65 66 69 |s T0 and| T1 defi|
|00004f90| 6e 65 64 20 61 62 6f 76 | 65 2e 20 46 69 72 73 74 |ned abov|e. First|
|00004fa0| 2c 20 74 68 65 20 4f 62 | 65 72 6f 6e 20 74 79 70 |, the Ob|eron typ|
|00004fb0| 65 73 20 72 65 66 72 61 | 69 6e 20 66 72 6f 6d 0a |es refra|in from.|
|00004fc0| 69 6e 74 72 6f 64 75 63 | 69 6e 67 20 61 20 6e 65 |introduc|ing a ne|
|00004fd0| 77 20 6e 61 6d 69 6e 67 | 20 73 63 6f 70 65 2e 20 |w naming| scope. |
|00004fe0| 47 69 76 65 6e 20 61 20 | 76 61 72 69 61 62 6c 65 |Given a |variable|
|00004ff0| 20 72 30 20 6f 66 20 74 | 79 70 65 20 54 30 2c 20 | r0 of t|ype T0, |
|00005000| 77 65 20 77 72 69 74 65 | 0a 72 30 2e 78 20 69 6e |we write|.r0.x in|
|00005010| 73 74 65 61 64 20 6f 66 | 20 72 30 2e 74 2e 78 20 |stead of| r0.t.x |
|00005020| 61 73 20 69 6e 20 4d 6f | 64 75 6c 61 2e 20 53 65 |as in Mo|dula. Se|
|00005030| 63 6f 6e 64 2c 20 74 68 | 65 20 74 79 70 65 73 20 |cond, th|e types |
|00005040| 54 2c 20 54 30 27 2c 20 | 61 6e 64 20 54 31 27 20 |T, T0', |and T1' |
|00005050| 61 72 65 0a 64 69 73 74 | 69 6e 63 74 20 61 6e 64 |are.dist|inct and|
|00005060| 20 75 6e 72 65 6c 61 74 | 65 64 2e 20 49 6e 20 63 | unrelat|ed. In c|
|00005070| 6f 6e 74 72 61 73 74 2c | 20 54 30 20 61 6e 64 20 |ontrast,| T0 and |
|00005080| 54 31 20 61 72 65 20 72 | 65 6c 61 74 65 64 20 74 |T1 are r|elated t|
|00005090| 6f 20 54 20 61 73 0a 65 | 78 74 65 6e 73 69 6f 6e |o T as.e|xtension|
|000050a0| 73 2e 20 54 68 69 73 20 | 62 65 63 6f 6d 65 73 20 |s. This |becomes |
|000050b0| 6d 61 6e 69 66 65 73 74 | 20 74 68 72 6f 75 67 68 |manifest| through|
|000050c0| 20 74 68 65 20 74 79 70 | 65 20 74 65 73 74 2c 20 | the typ|e test, |
|000050d0| 77 68 69 63 68 20 61 73 | 73 65 72 74 73 20 74 68 |which as|serts th|
|000050e0| 61 74 0a 76 61 72 69 61 | 62 6c 65 20 72 30 20 69 |at.varia|ble r0 i|
|000050f0| 73 20 6e 6f 74 20 6f 6e | 6c 79 20 6f 66 20 74 79 |s not on|ly of ty|
|00005100| 70 65 20 54 30 2c 20 62 | 75 74 20 61 6c 73 6f 20 |pe T0, b|ut also |
|00005110| 6f 66 20 62 61 73 65 20 | 74 79 70 65 20 54 2e 0a |of base |type T..|
|00005120| 0a 54 68 65 20 64 65 63 | 6c 61 72 61 74 69 6f 6e |.The dec|laration|
|00005130| 20 6f 66 20 65 78 74 65 | 6e 64 65 64 20 72 65 63 | of exte|nded rec|
|00005140| 6f 72 64 20 74 79 70 65 | 73 2c 20 74 68 65 20 74 |ord type|s, the t|
|00005150| 79 70 65 20 74 65 73 74 | 2c 20 61 6e 64 20 74 68 |ype test|, and th|
|00005160| 65 20 74 79 70 65 20 67 | 75 61 72 64 0a 61 72 65 |e type g|uard.are|
|00005170| 20 74 68 65 20 6f 6e 6c | 79 20 61 64 64 69 74 69 | the onl|y additi|
|00005180| 6f 6e 61 6c 20 66 65 61 | 74 75 72 65 73 20 69 6e |onal fea|tures in|
|00005190| 74 72 6f 64 75 63 65 64 | 20 69 6e 20 74 68 69 73 |troduced| in this|
|000051a0| 20 63 6f 6e 74 65 78 74 | 2e 20 41 20 6d 6f 72 65 | context|. A more|
|000051b0| 0a 65 78 74 65 6e 73 69 | 76 65 20 64 69 73 63 75 |.extensi|ve discu|
|000051c0| 73 73 69 6f 6e 20 69 73 | 20 70 72 6f 76 69 64 65 |ssion is| provide|
|000051d0| 64 20 69 6e 20 5b 32 5d | 2e 20 54 68 65 20 63 6f |d in [2]|. The co|
|000051e0| 6e 63 65 70 74 20 69 73 | 20 76 65 72 79 20 73 69 |ncept is| very si|
|000051f0| 6d 69 6c 61 72 20 74 6f | 20 74 68 65 0a 63 6c 61 |milar to| the.cla|
|00005200| 73 73 20 6e 6f 74 69 6f | 6e 20 6f 66 20 53 69 6d |ss notio|n of Sim|
|00005210| 75 6c 61 20 36 37 20 5b | 33 5d 2c 20 53 6d 61 6c |ula 67 [|3], Smal|
|00005220| 6c 74 61 6c 6b 20 5b 34 | 5d 2c 20 4f 62 6a 65 63 |ltalk [4|], Objec|
|00005230| 74 20 50 61 73 63 61 6c | 20 5b 35 5d 2c 20 43 2b |t Pascal| [5], C+|
|00005240| 2b 20 5b 36 5d 2c 0a 61 | 6e 64 20 6f 74 68 65 72 |+ [6],.a|nd other|
|00005250| 73 2c 20 77 68 65 72 65 | 20 74 68 65 20 70 72 6f |s, where| the pro|
|00005260| 70 65 72 74 69 65 73 20 | 6f 66 20 74 68 65 20 62 |perties |of the b|
|00005270| 61 73 65 20 63 6c 61 73 | 73 20 61 72 65 20 73 61 |ase clas|s are sa|
|00005280| 69 64 20 74 6f 20 62 65 | 20 69 6e 68 65 72 69 74 |id to be| inherit|
|00005290| 65 64 0a 62 79 20 74 68 | 65 20 64 65 72 69 76 65 |ed.by th|e derive|
|000052a0| 64 20 63 6c 61 73 73 65 | 73 2e 20 54 68 65 20 63 |d classe|s. The c|
|000052b0| 6c 61 73 73 20 66 61 63 | 69 6c 69 74 79 20 73 74 |lass fac|ility st|
|000052c0| 69 70 75 6c 61 74 65 73 | 20 74 68 61 74 20 61 6c |ipulates| that al|
|000052d0| 6c 20 70 72 6f 63 65 64 | 75 72 65 73 0a 61 70 70 |l proced|ures.app|
|000052e0| 6c 69 63 61 62 6c 65 20 | 74 6f 20 6f 62 6a 65 63 |licable |to objec|
|000052f0| 74 73 20 6f 66 20 74 68 | 65 20 63 6c 61 73 73 20 |ts of th|e class |
|00005300| 62 65 20 64 65 66 69 6e | 65 64 20 74 6f 67 65 74 |be defin|ed toget|
|00005310| 68 65 72 20 77 69 74 68 | 20 74 68 65 20 64 61 74 |her with| the dat|
|00005320| 61 0a 64 65 66 69 6e 69 | 74 69 6f 6e 2e 20 54 68 |a.defini|tion. Th|
|00005330| 69 73 20 64 6f 67 6d 61 | 20 73 74 65 6d 73 20 66 |is dogma| stems f|
|00005340| 72 6f 6d 20 74 68 65 20 | 6e 6f 74 69 6f 6e 20 6f |rom the |notion o|
|00005350| 66 20 61 62 73 74 72 61 | 63 74 20 64 61 74 61 20 |f abstra|ct data |
|00005360| 74 79 70 65 2c 20 62 75 | 74 20 69 74 0a 69 73 20 |type, bu|t it.is |
|00005370| 61 20 73 65 72 69 6f 75 | 73 20 6f 62 73 74 61 63 |a seriou|s obstac|
|00005380| 6c 65 20 69 6e 20 74 68 | 65 20 64 65 76 65 6c 6f |le in th|e develo|
|00005390| 70 6d 65 6e 74 20 6f 66 | 20 6c 61 72 67 65 20 73 |pment of| large s|
|000053a0| 79 73 74 65 6d 73 2c 20 | 77 68 65 72 65 20 74 68 |ystems, |where th|
|000053b0| 65 0a 70 6f 73 73 69 62 | 69 6c 69 74 79 20 74 6f |e.possib|ility to|
|000053c0| 20 61 64 64 20 66 75 72 | 74 68 65 72 20 70 72 6f | add fur|ther pro|
|000053d0| 63 65 64 75 72 65 73 20 | 64 65 66 69 6e 65 64 20 |cedures |defined |
|000053e0| 69 6e 20 61 64 64 69 74 | 69 6f 6e 61 6c 20 6d 6f |in addit|ional mo|
|000053f0| 64 75 6c 65 73 20 69 73 | 0a 68 69 67 68 6c 79 20 |dules is|.highly |
|00005400| 64 65 73 69 72 61 62 6c | 65 2e 20 49 74 20 69 73 |desirabl|e. It is|
|00005410| 20 61 77 6b 77 61 72 64 | 20 74 6f 20 62 65 20 6f | awkward| to be o|
|00005420| 62 6c 69 67 65 64 20 74 | 6f 20 72 65 64 65 66 69 |bliged t|o redefi|
|00005430| 6e 65 20 61 20 63 6c 61 | 73 73 20 73 6f 6c 65 6c |ne a cla|ss solel|
|00005440| 79 0a 62 65 63 61 75 73 | 65 20 61 20 6d 65 74 68 |y.becaus|e a meth|
|00005450| 6f 64 20 28 70 72 6f 63 | 65 64 75 72 65 29 20 68 |od (proc|edure) h|
|00005460| 61 73 20 62 65 65 6e 20 | 61 64 64 65 64 20 6f 72 |as been |added or|
|00005470| 20 63 68 61 6e 67 65 64 | 2c 20 70 61 72 74 69 63 | changed|, partic|
|00005480| 75 6c 61 72 6c 79 20 77 | 68 65 6e 0a 74 68 69 73 |ularly w|hen.this|
|00005490| 20 63 68 61 6e 67 65 20 | 72 65 71 75 69 72 65 73 | change |requires|
|000054a0| 20 61 20 72 65 63 6f 6d | 70 69 6c 61 74 69 6f 6e | a recom|pilation|
|000054b0| 20 6f 66 20 74 68 65 20 | 63 6c 61 73 73 20 64 65 | of the |class de|
|000054c0| 66 69 6e 69 74 69 6f 6e | 20 61 6e 64 20 6f 66 20 |finition| and of |
|000054d0| 61 6c 6c 20 69 74 73 0a | 63 6c 69 65 6e 74 20 6d |all its.|client m|
|000054e0| 6f 64 75 6c 65 73 2e 0a | 0a 57 65 20 65 6d 70 68 |odules..|.We emph|
|000054f0| 61 73 69 73 65 20 74 68 | 61 74 20 74 68 65 20 74 |asise th|at the t|
|00005500| 79 70 65 20 65 78 74 65 | 6e 73 69 6f 6e 20 66 61 |ype exte|nsion fa|
|00005510| 63 69 6c 69 74 79 20 2d | 20 61 6c 74 68 6f 75 67 |cility -| althoug|
|00005520| 68 20 67 61 69 6e 69 6e | 67 20 69 74 73 20 6d 61 |h gainin|g its ma|
|00005530| 6a 6f 72 0a 72 6f 6c 65 | 20 69 6e 20 63 6f 6e 6e |jor.role| in conn|
|00005540| 65 63 74 69 6f 6e 20 77 | 69 74 68 20 70 6f 69 6e |ection w|ith poin|
|00005550| 74 65 72 73 20 74 6f 20 | 62 75 69 6c 64 20 68 65 |ters to |build he|
|00005560| 74 65 72 6f 67 65 6e 65 | 6f 75 73 2c 20 64 79 6e |terogene|ous, dyn|
|00005570| 61 6d 69 63 20 64 61 74 | 61 0a 73 74 72 75 63 74 |amic dat|a.struct|
|00005580| 75 72 65 73 20 61 73 20 | 73 68 6f 77 6e 20 69 6e |ures as |shown in|
|00005590| 20 74 68 65 20 65 78 61 | 6d 70 6c 65 20 61 62 6f | the exa|mple abo|
|000055a0| 76 65 20 2d 20 61 6c 73 | 6f 20 61 70 70 6c 69 65 |ve - als|o applie|
|000055b0| 73 20 74 6f 20 73 74 61 | 74 69 63 61 6c 6c 79 0a |s to sta|tically.|
|000055c0| 64 65 63 6c 61 72 65 64 | 20 6f 62 6a 65 63 74 73 |declared| objects|
|000055d0| 20 75 73 65 64 20 61 73 | 20 76 61 72 69 61 62 6c | used as| variabl|
|000055e0| 65 20 70 61 72 61 6d 65 | 74 65 72 73 2e 20 53 75 |e parame|ters. Su|
|000055f0| 63 68 20 6f 62 6a 65 63 | 74 73 20 61 72 65 20 61 |ch objec|ts are a|
|00005600| 6c 6c 6f 63 61 74 65 64 | 20 69 6e 0a 61 20 77 6f |llocated| in.a wo|
|00005610| 72 6b 73 70 61 63 65 20 | 6f 72 67 61 6e 69 7a 65 |rkspace |organize|
|00005620| 64 20 61 73 20 61 20 73 | 74 61 63 6b 20 6f 66 20 |d as a s|tack of |
|00005630| 70 72 6f 63 65 64 75 72 | 65 20 61 63 74 69 76 61 |procedur|e activa|
|00005640| 74 69 6f 6e 20 72 65 63 | 6f 72 64 73 2c 20 61 6e |tion rec|ords, an|
|00005650| 64 0a 74 68 65 72 65 66 | 6f 72 65 20 74 61 6b 65 |d.theref|ore take|
|00005660| 20 61 64 76 61 6e 74 61 | 67 65 20 6f 66 20 61 6e | advanta|ge of an|
|00005670| 20 65 78 74 72 65 6d 65 | 6c 79 20 65 66 66 69 63 | extreme|ly effic|
|00005680| 69 65 6e 74 20 61 6c 6c | 6f 63 61 74 69 6f 6e 20 |ient all|ocation |
|00005690| 61 6e 64 0a 64 65 61 6c | 6c 6f 63 61 74 69 6f 6e |and.deal|location|
|000056a0| 20 73 63 68 65 6d 65 2e | 0a 0a 49 6e 20 4f 62 65 | scheme.|..In Obe|
|000056b0| 72 6f 6e 2c 20 70 72 6f | 63 65 64 75 72 65 20 74 |ron, pro|cedure t|
|000056c0| 79 70 65 73 20 72 61 74 | 68 65 72 20 74 68 61 6e |ypes rat|her than|
|000056d0| 20 70 72 6f 63 65 64 75 | 72 65 73 20 28 6d 65 74 | procedu|res (met|
|000056e0| 68 6f 64 73 29 20 61 72 | 65 20 63 6f 6e 6e 65 63 |hods) ar|e connec|
|000056f0| 74 65 64 0a 77 69 74 68 | 20 6f 62 6a 65 63 74 73 |ted.with| objects|
|00005700| 20 69 6e 20 74 68 65 20 | 70 72 6f 67 72 61 6d 20 | in the |program |
|00005710| 74 65 78 74 2e 20 54 68 | 65 20 62 69 6e 64 69 6e |text. Th|e bindin|
|00005720| 67 20 6f 66 20 61 63 74 | 75 61 6c 20 6d 65 74 68 |g of act|ual meth|
|00005730| 6f 64 73 20 28 73 70 65 | 63 69 66 69 63 0a 70 72 |ods (spe|cific.pr|
|00005740| 6f 63 65 64 75 72 65 73 | 29 20 74 6f 20 6f 62 6a |ocedures|) to obj|
|00005750| 65 63 74 73 20 28 69 6e | 73 74 61 6e 63 65 73 29 |ects (in|stances)|
|00005760| 20 69 73 20 64 65 6c 61 | 79 65 64 20 75 6e 74 69 | is dela|yed unti|
|00005770| 6c 20 74 68 65 20 70 72 | 6f 67 72 61 6d 20 69 73 |l the pr|ogram is|
|00005780| 0a 65 78 65 63 75 74 65 | 64 2e 20 54 68 65 20 61 |.execute|d. The a|
|00005790| 73 73 6f 63 69 61 74 69 | 6f 6e 20 6f 66 20 61 20 |ssociati|on of a |
|000057a0| 70 72 6f 63 65 64 75 72 | 65 20 74 79 70 65 20 77 |procedur|e type w|
|000057b0| 69 74 68 20 61 20 64 61 | 74 61 20 74 79 70 65 20 |ith a da|ta type |
|000057c0| 6f 63 63 75 72 73 0a 74 | 68 72 6f 75 67 68 20 74 |occurs.t|hrough t|
|000057d0| 68 65 20 64 65 63 6c 61 | 72 61 74 69 6f 6e 20 6f |he decla|ration o|
|000057e0| 66 20 61 20 72 65 63 6f | 72 64 20 66 69 65 6c 64 |f a reco|rd field|
|000057f0| 2e 20 54 68 69 73 20 66 | 69 65 6c 64 20 69 73 20 |. This f|ield is |
|00005800| 67 69 76 65 6e 20 61 20 | 70 72 6f 63 65 64 75 72 |given a |procedur|
|00005810| 65 0a 74 79 70 65 2e 20 | 54 68 65 20 61 73 73 6f |e.type. |The asso|
|00005820| 63 69 61 74 69 6f 6e 20 | 6f 66 20 61 20 6d 65 74 |ciation |of a met|
|00005830| 68 6f 64 20 2d 20 74 6f | 20 75 73 65 20 53 6d 61 |hod - to| use Sma|
|00005840| 6c 6c 74 61 6c 6b 20 74 | 65 72 6d 69 6e 6f 6c 6f |lltalk t|erminolo|
|00005850| 67 79 20 2d 20 77 69 74 | 68 20 61 6e 0a 6f 62 6a |gy - wit|h an.obj|
|00005860| 65 63 74 20 6f 63 63 75 | 72 73 20 74 68 72 6f 75 |ect occu|rs throu|
|00005870| 67 68 20 74 68 65 20 61 | 73 73 69 67 6e 6d 65 6e |gh the a|ssignmen|
|00005880| 74 20 6f 66 20 61 20 73 | 70 65 63 69 66 69 63 20 |t of a s|pecific |
|00005890| 70 72 6f 63 65 64 75 72 | 65 20 61 73 20 76 61 6c |procedur|e as val|
|000058a0| 75 65 20 74 6f 0a 74 68 | 65 20 66 69 65 6c 64 2c |ue to.th|e field,|
|000058b0| 20 61 6e 64 20 6e 6f 74 | 20 74 68 72 6f 75 67 68 | and not| through|
|000058c0| 20 61 20 73 74 61 74 69 | 63 20 64 65 63 6c 61 72 | a stati|c declar|
|000058d0| 61 74 69 6f 6e 20 69 6e | 20 74 68 65 20 65 78 74 |ation in| the ext|
|000058e0| 65 6e 64 65 64 20 74 79 | 70 65 27 73 0a 64 65 66 |ended ty|pe's.def|
|000058f0| 69 6e 69 74 69 6f 6e 20 | 77 68 69 63 68 20 74 68 |inition |which th|
|00005900| 65 6e 20 22 6f 76 65 72 | 72 69 64 65 73 22 20 74 |en "over|rides" t|
|00005910| 68 65 20 64 65 63 6c 61 | 72 61 74 69 6f 6e 20 67 |he decla|ration g|
|00005920| 69 76 65 6e 20 69 6e 20 | 74 68 65 20 62 61 73 65 |iven in |the base|
|00005930| 20 74 79 70 65 2e 0a 53 | 75 63 68 20 61 20 70 72 | type..S|uch a pr|
|00005940| 6f 63 65 64 75 72 65 20 | 69 73 20 63 61 6c 6c 65 |ocedure |is calle|
|00005950| 64 20 61 20 68 61 6e 64 | 6c 65 72 2e 20 55 73 69 |d a hand|ler. Usi|
|00005960| 6e 67 20 74 79 70 65 20 | 74 65 73 74 73 2c 20 74 |ng type |tests, t|
|00005970| 68 65 20 68 61 6e 64 6c | 65 72 20 69 73 0a 63 61 |he handl|er is.ca|
|00005980| 70 61 62 6c 65 20 6f 66 | 20 64 69 73 63 72 69 6d |pable of| discrim|
|00005990| 69 6e 61 74 69 6e 67 20 | 61 6d 6f 6e 67 20 64 69 |inating |among di|
|000059a0| 66 66 65 72 65 6e 74 20 | 65 78 74 65 6e 73 69 6f |fferent |extensio|
|000059b0| 6e 73 20 6f 66 20 74 68 | 65 20 72 65 63 6f 72 64 |ns of th|e record|
|000059c0| 27 73 0a 28 6f 62 6a 65 | 63 74 27 73 29 20 62 61 |'s.(obje|ct's) ba|
|000059d0| 73 65 20 74 79 70 65 2e | 20 49 6e 20 53 6d 61 6c |se type.| In Smal|
|000059e0| 6c 74 61 6c 6b 2c 20 74 | 68 65 20 63 6f 6d 70 61 |ltalk, t|he compa|
|000059f0| 74 69 62 69 6c 69 74 79 | 20 72 75 6c 65 73 20 62 |tibility| rules b|
|00005a00| 65 74 77 65 65 6e 20 61 | 20 63 6c 61 73 73 0a 61 |etween a| class.a|
|00005a10| 6e 64 20 69 74 73 20 73 | 75 62 63 6c 61 73 73 65 |nd its s|ubclasse|
|00005a20| 73 20 61 72 65 20 63 6f | 6e 66 69 6e 65 64 20 74 |s are co|nfined t|
|00005a30| 6f 20 70 6f 69 6e 74 65 | 72 73 2c 20 74 68 65 72 |o pointe|rs, ther|
|00005a40| 65 62 79 20 69 6e 74 65 | 72 74 77 69 6e 69 6e 67 |eby inte|rtwining|
|00005a50| 20 74 68 65 0a 63 6f 6e | 63 65 70 74 73 20 6f 66 | the.con|cepts of|
|00005a60| 20 61 63 63 65 73 73 20 | 6d 65 74 68 6f 64 20 61 | access |method a|
|00005a70| 6e 64 20 64 61 74 61 20 | 74 79 70 65 20 69 6e 20 |nd data |type in |
|00005a80| 61 6e 20 75 6e 64 65 73 | 69 72 61 62 6c 65 20 77 |an undes|irable w|
|00005a90| 61 79 2e 20 49 6e 20 4f | 62 65 72 6f 6e 2c 0a 74 |ay. In O|beron,.t|
|00005aa0| 68 65 20 72 65 6c 61 74 | 69 6f 6e 73 68 69 70 20 |he relat|ionship |
|00005ab0| 62 65 74 77 65 65 6e 20 | 61 20 74 79 70 65 20 61 |between |a type a|
|00005ac0| 6e 64 20 69 74 73 20 65 | 78 74 65 6e 73 69 6f 6e |nd its e|xtension|
|00005ad0| 73 20 69 73 20 62 61 73 | 65 64 20 6f 6e 20 74 68 |s is bas|ed on th|
|00005ae0| 65 0a 65 73 74 61 62 6c | 69 73 68 65 64 20 6d 61 |e.establ|ished ma|
|00005af0| 74 68 65 6d 61 74 69 63 | 61 6c 20 63 6f 6e 63 65 |thematic|al conce|
|00005b00| 70 74 20 6f 66 20 70 72 | 6f 6a 65 63 74 69 6f 6e |pt of pr|ojection|
|00005b10| 2e 0a 0a 49 6e 20 4d 6f | 64 75 6c 61 2c 20 69 74 |...In Mo|dula, it|
|00005b20| 20 69 73 20 70 6f 73 73 | 69 62 6c 65 20 74 6f 20 | is poss|ible to |
|00005b30| 64 65 63 6c 61 72 65 20 | 61 20 70 6f 69 6e 74 65 |declare |a pointe|
|00005b40| 72 20 74 79 70 65 20 77 | 69 74 68 69 6e 20 61 6e |r type w|ithin an|
|00005b50| 0a 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 20 |.impleme|ntation |
|00005b60| 6d 6f 64 75 6c 65 2c 20 | 61 6e 64 20 74 6f 20 65 |module, |and to e|
|00005b70| 78 70 6f 72 74 20 69 74 | 20 61 73 20 61 6e 20 6f |xport it| as an o|
|00005b80| 70 61 71 75 65 20 74 79 | 70 65 20 62 79 20 6c 69 |paque ty|pe by li|
|00005b90| 73 74 69 6e 67 20 74 68 | 65 0a 73 61 6d 65 20 69 |sting th|e.same i|
|00005ba0| 64 65 6e 74 69 66 69 65 | 72 20 69 6e 20 74 68 65 |dentifie|r in the|
|00005bb0| 20 63 6f 72 72 65 73 70 | 6f 6e 64 69 6e 67 20 64 | corresp|onding d|
|00005bc0| 65 66 69 6e 69 74 69 6f | 6e 20 6d 6f 64 75 6c 65 |efinitio|n module|
|00005bd0| 2e 20 54 68 65 20 6e 65 | 74 20 65 66 66 65 63 74 |. The ne|t effect|
|00005be0| 20 69 73 0a 74 68 61 74 | 20 74 68 65 20 74 79 70 | is.that| the typ|
|00005bf0| 65 20 69 73 20 65 78 70 | 6f 72 74 65 64 20 77 68 |e is exp|orted wh|
|00005c00| 69 6c 65 20 61 6c 6c 20 | 69 74 73 20 70 72 6f 70 |ile all |its prop|
|00005c10| 65 72 74 69 65 73 20 72 | 65 6d 61 69 6e 20 68 69 |erties r|emain hi|
|00005c20| 64 64 65 6e 20 28 69 6e | 76 69 73 69 62 6c 65 0a |dden (in|visible.|
|00005c30| 74 6f 20 63 6c 69 65 6e | 74 73 29 2e 20 49 6e 20 |to clien|ts). In |
|00005c40| 4f 62 65 72 6f 6e 2c 20 | 74 68 69 73 20 66 61 63 |Oberon, |this fac|
|00005c50| 69 6c 69 74 79 20 69 73 | 20 67 65 6e 65 72 61 6c |ility is| general|
|00005c60| 69 7a 65 64 20 69 6e 20 | 74 68 65 20 73 65 6e 73 |ized in |the sens|
|00005c70| 65 20 74 68 61 74 20 74 | 68 65 0a 73 65 6c 65 63 |e that t|he.selec|
|00005c80| 74 69 6f 6e 20 6f 66 20 | 74 68 65 20 72 65 63 6f |tion of |the reco|
|00005c90| 72 64 20 66 69 65 6c 64 | 73 20 74 6f 20 62 65 20 |rd field|s to be |
|00005ca0| 65 78 70 6f 72 74 65 64 | 20 69 73 20 61 72 62 69 |exported| is arbi|
|00005cb0| 74 72 61 72 79 20 61 6e | 64 20 69 6e 63 6c 75 64 |trary an|d includ|
|00005cc0| 65 73 20 74 68 65 0a 63 | 61 73 65 73 20 61 6c 6c |es the.c|ases all|
|00005cd0| 20 61 6e 64 20 6e 6f 6e | 65 2e 20 54 68 65 20 63 | and non|e. The c|
|00005ce0| 6f 6c 6c 65 63 74 69 6f | 6e 20 6f 66 20 65 78 70 |ollectio|n of exp|
|00005cf0| 6f 72 74 65 64 20 66 69 | 65 6c 64 73 20 64 65 66 |orted fi|elds def|
|00005d00| 69 6e 65 73 20 61 20 70 | 61 72 74 69 61 6c 0a 76 |ines a p|artial.v|
|00005d10| 69 65 77 20 2d 20 61 20 | 70 75 62 6c 69 63 20 70 |iew - a |public p|
|00005d20| 72 6f 6a 65 63 74 69 6f | 6e 20 2d 20 74 6f 20 63 |rojectio|n - to c|
|00005d30| 6c 69 65 6e 74 73 2e 0a | 0a 49 6e 20 63 6c 69 65 |lients..|.In clie|
|00005d40| 6e 74 20 6d 6f 64 75 6c | 65 73 20 61 73 20 77 65 |nt modul|es as we|
|00005d50| 6c 6c 20 61 73 20 69 6e | 20 74 68 65 20 6d 6f 64 |ll as in| the mod|
|00005d60| 75 6c 65 20 69 74 73 65 | 6c 66 2c 20 69 74 20 69 |ule itse|lf, it i|
|00005d70| 73 20 70 6f 73 73 69 62 | 6c 65 20 74 6f 20 64 65 |s possib|le to de|
|00005d80| 66 69 6e 65 0a 65 78 74 | 65 6e 73 69 6f 6e 73 20 |fine.ext|ensions |
|00005d90| 6f 66 20 74 68 65 20 62 | 61 73 65 20 74 79 70 65 |of the b|ase type|
|00005da0| 20 28 65 2e 67 2e 20 54 | 65 78 74 56 69 65 77 65 | (e.g. T|extViewe|
|00005db0| 72 73 20 6f 72 20 47 72 | 61 70 68 56 69 65 77 65 |rs or Gr|aphViewe|
|00005dc0| 72 73 29 2e 20 4f 66 0a | 69 6d 70 6f 72 74 61 6e |rs). Of.|importan|
|00005dd0| 63 65 20 69 73 20 61 6c | 73 6f 20 74 68 65 20 66 |ce is al|so the f|
|00005de0| 61 63 74 20 74 68 61 74 | 20 6e 6f 6e 2d 65 78 70 |act that| non-exp|
|00005df0| 6f 72 74 65 64 20 63 6f | 6d 70 6f 6e 65 6e 74 73 |orted co|mponents|
|00005e00| 20 28 66 69 65 6c 64 73 | 29 20 6d 61 79 20 68 61 | (fields|) may ha|
|00005e10| 76 65 0a 74 79 70 65 73 | 20 74 68 61 74 20 61 72 |ve.types| that ar|
|00005e20| 65 20 6e 6f 74 20 65 78 | 70 6f 72 74 65 64 20 65 |e not ex|ported e|
|00005e30| 69 74 68 65 72 2e 20 48 | 65 6e 63 65 2c 20 69 74 |ither. H|ence, it|
|00005e40| 20 69 73 20 70 6f 73 73 | 69 62 6c 65 20 74 6f 20 | is poss|ible to |
|00005e50| 68 69 64 65 20 63 65 72 | 74 61 69 6e 0a 64 61 74 |hide cer|tain.dat|
|00005e60| 61 20 74 79 70 65 73 20 | 65 66 66 65 63 74 69 76 |a types |effectiv|
|00005e70| 65 6c 79 2c 20 61 6c 74 | 68 6f 75 67 68 20 63 6f |ely, alt|hough co|
|00005e80| 6d 70 6f 6e 65 6e 74 73 | 20 6f 66 20 28 6f 70 61 |mponents| of (opa|
|00005e90| 71 75 65 6c 79 29 20 65 | 78 70 6f 72 74 65 64 20 |quely) e|xported |
|00005ea0| 74 79 70 65 73 0a 72 65 | 66 65 72 20 74 6f 20 74 |types.re|fer to t|
|00005eb0| 68 65 6d 2e 0a 0a 54 79 | 70 65 20 69 6e 63 6c 75 |hem...Ty|pe inclu|
|00005ec0| 73 69 6f 6e 0a 0a 4d 6f | 64 65 72 6e 20 70 72 6f |sion..Mo|dern pro|
|00005ed0| 63 65 73 73 6f 72 73 20 | 66 65 61 74 75 72 65 20 |cessors |feature |
|00005ee0| 61 72 69 74 68 6d 65 74 | 69 63 20 6f 70 65 72 61 |arithmet|ic opera|
|00005ef0| 74 69 6f 6e 73 20 6f 6e | 20 73 65 76 65 72 61 6c |tions on| several|
|00005f00| 20 6e 75 6d 62 65 72 20 | 66 6f 72 6d 61 74 73 2e | number |formats.|
|00005f10| 0a 49 74 20 69 73 20 64 | 65 73 69 72 61 62 6c 65 |.It is d|esirable|
|00005f20| 20 74 6f 20 68 61 76 65 | 20 61 6c 6c 20 74 68 65 | to have| all the|
|00005f30| 73 65 20 66 6f 72 6d 61 | 74 73 20 72 65 66 6c 65 |se forma|ts refle|
|00005f40| 63 74 65 64 20 69 6e 20 | 74 68 65 20 6c 61 6e 67 |cted in |the lang|
|00005f50| 75 61 67 65 20 61 73 0a | 62 61 73 69 63 20 74 79 |uage as.|basic ty|
|00005f60| 70 65 73 2e 20 4f 62 65 | 72 6f 6e 20 66 65 61 74 |pes. Obe|ron feat|
|00005f70| 75 72 65 73 20 66 69 76 | 65 20 6f 66 20 74 68 65 |ures fiv|e of the|
|00005f80| 6d 3a 0a 0a 4c 4f 4e 47 | 49 4e 54 2c 20 49 4e 54 |m:..LONG|INT, INT|
|00005f90| 45 47 45 52 2c 20 53 48 | 4f 52 54 49 4e 54 20 20 |EGER, SH|ORTINT |
|00005fa0| 28 69 6e 74 65 67 65 72 | 20 74 79 70 65 73 29 0a |(integer| types).|
|00005fb0| 4c 4f 4e 47 52 45 41 4c | 2c 20 52 45 41 4c 20 20 |LONGREAL|, REAL |
|00005fc0| 28 72 65 61 6c 20 74 79 | 70 65 73 29 0a 0a 57 69 |(real ty|pes)..Wi|
|00005fd0| 74 68 20 74 68 65 20 70 | 72 6f 6c 69 66 65 72 61 |th the p|rolifera|
|00005fe0| 74 69 6f 6e 20 6f 66 20 | 62 61 73 69 63 20 74 79 |tion of |basic ty|
|00005ff0| 70 65 73 2c 20 61 20 72 | 65 6c 61 78 61 74 69 6f |pes, a r|elaxatio|
|00006000| 6e 20 6f 66 20 63 6f 6d | 70 61 74 69 62 69 6c 69 |n of com|patibili|
|00006010| 74 79 20 72 75 6c 65 73 | 0a 61 6d 6f 6e 67 20 74 |ty rules|.among t|
|00006020| 68 65 6d 20 62 65 63 6f | 6d 65 73 20 61 6c 6d 6f |hem beco|mes almo|
|00006030| 73 74 20 6d 61 6e 64 61 | 74 6f 72 79 2e 20 28 4e |st manda|tory. (N|
|00006040| 6f 74 65 20 74 68 61 74 | 20 69 6e 20 4d 6f 64 75 |ote that| in Modu|
|00006050| 6c 61 20 74 68 65 20 6e | 75 6d 65 72 69 63 20 74 |la the n|umeric t|
|00006060| 79 70 65 73 0a 49 4e 54 | 45 47 45 52 2c 20 43 41 |ypes.INT|EGER, CA|
|00006070| 52 44 49 4e 41 4c 2c 20 | 61 6e 64 20 52 45 41 4c |RDINAL, |and REAL|
|00006080| 20 61 72 65 20 69 6e 63 | 6f 6d 70 61 74 69 62 6c | are inc|ompatibl|
|00006090| 65 29 2e 20 54 6f 20 74 | 68 69 73 20 65 6e 64 2c |e). To t|his end,|
|000060a0| 20 74 68 65 20 6e 6f 74 | 69 6f 6e 20 6f 66 0a 74 | the not|ion of.t|
|000060b0| 79 70 65 20 69 6e 63 6c | 75 73 69 6f 6e 20 69 73 |ype incl|usion is|
|000060c0| 20 69 6e 74 72 6f 64 75 | 63 65 64 3a 20 61 20 74 | introdu|ced: a t|
|000060d0| 79 70 65 20 54 20 69 6e | 63 6c 75 64 65 73 20 61 |ype T in|cludes a|
|000060e0| 20 74 79 70 65 20 54 27 | 2c 20 69 66 20 74 68 65 | type T'|, if the|
|000060f0| 20 76 61 6c 75 65 73 20 | 6f 66 0a 74 79 70 65 20 | values |of.type |
|00006100| 54 27 20 61 72 65 20 61 | 6c 73 6f 20 76 61 6c 75 |T' are a|lso valu|
|00006110| 65 73 20 6f 66 20 74 79 | 70 65 20 54 2e 20 4f 62 |es of ty|pe T. Ob|
|00006120| 65 72 6f 6e 20 70 6f 73 | 74 75 6c 61 74 65 73 20 |eron pos|tulates |
|00006130| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 0a 68 69 |the foll|owing.hi|
|00006140| 65 72 61 72 63 68 79 3a | 0a 0a 4c 4f 4e 47 52 45 |erarchy:|..LONGRE|
|00006150| 41 4c 20 20 4a 20 20 52 | 45 41 4c 20 20 4a 20 20 |AL J R|EAL J |
|00006160| 4c 4f 4e 47 49 4e 54 20 | 20 4a 20 20 49 4e 54 45 |LONGINT | J INTE|
|00006170| 47 45 52 20 20 4a 20 20 | 53 48 4f 52 54 49 4e 54 |GER J |SHORTINT|
|00006180| 0a 0a 54 68 65 20 61 73 | 73 69 67 6e 6d 65 6e 74 |..The as|signment|
|00006190| 20 72 75 6c 65 20 69 73 | 20 72 65 6c 61 78 65 64 | rule is| relaxed|
|000061a0| 20 61 63 63 6f 72 64 69 | 6e 67 6c 79 3a 20 41 20 | accordi|ngly: A |
|000061b0| 76 61 6c 75 65 20 6f 66 | 20 74 79 70 65 20 54 27 |value of| type T'|
|000061c0| 20 63 61 6e 20 62 65 0a | 61 73 73 69 67 6e 65 64 | can be.|assigned|
|000061d0| 20 74 6f 20 61 20 76 61 | 72 69 61 62 6c 65 20 6f | to a va|riable o|
|000061e0| 66 20 74 79 70 65 20 54 | 2c 20 69 66 20 54 27 20 |f type T|, if T' |
|000061f0| 69 73 20 69 6e 63 6c 75 | 64 65 64 20 69 6e 20 54 |is inclu|ded in T|
|00006200| 20 28 6f 72 20 69 66 20 | 54 27 20 65 78 74 65 6e | (or if |T' exten|
|00006210| 64 73 0a 54 29 2c 20 69 | 2e 65 2e 20 69 66 20 20 |ds.T), i|.e. if |
|00006220| 54 20 4a 20 54 27 20 20 | 6f 72 20 20 54 27 20 2e |T J T' |or T' .|
|00006230| 20 54 2e 20 49 6e 20 74 | 68 69 73 20 72 65 73 70 | T. In t|his resp|
|00006240| 65 63 74 2c 20 77 65 20 | 72 65 74 75 72 6e 20 74 |ect, we |return t|
|00006250| 6f 20 28 61 6e 64 20 65 | 78 74 65 6e 64 29 0a 74 |o (and e|xtend).t|
|00006260| 68 65 20 66 6c 65 78 69 | 62 69 6c 69 74 79 20 6f |he flexi|bility o|
|00006270| 66 20 41 6c 67 6f 6c 20 | 36 30 2e 20 46 6f 72 20 |f Algol |60. For |
|00006280| 65 78 61 6d 70 6c 65 2c | 20 67 69 76 65 6e 20 76 |example,| given v|
|00006290| 61 72 69 61 62 6c 65 73 | 0a 0a 69 3a 20 49 4e 54 |ariables|..i: INT|
|000062a0| 45 47 45 52 3b 20 20 6b | 3a 20 4c 4f 4e 47 49 4e |EGER; k|: LONGIN|
|000062b0| 54 3b 20 20 78 3a 20 52 | 45 41 4c 0a 0a 74 68 65 |T; x: R|EAL..the|
|000062c0| 20 61 73 73 69 67 6e 6d | 65 6e 74 73 0a 0a 6b 20 | assignm|ents..k |
|000062d0| 3a 3d 20 69 3b 20 20 78 | 20 3a 3d 20 6b 3b 20 20 |:= i; x| := k; |
|000062e0| 78 20 3a 3d 20 31 3b 20 | 20 6b 20 3a 3d 20 6b 2b |x := 1; | k := k+|
|000062f0| 69 3b 20 20 78 20 3a 3d | 20 78 2a 31 30 20 2b 20 |i; x :=| x*10 + |
|00006300| 69 0a 0a 63 6f 6e 66 6f | 72 6d 20 74 6f 20 74 68 |i..confo|rm to th|
|00006310| 65 20 72 75 6c 65 73 2c | 20 77 68 65 72 65 61 73 |e rules,| whereas|
|00006320| 20 74 68 65 20 73 74 61 | 74 65 6d 65 6e 74 73 20 | the sta|tements |
|00006330| 20 69 20 3a 3d 20 6b 3b | 20 20 6b 20 3a 3d 20 78 | i := k;| k := x|
|00006340| 20 20 61 72 65 20 6e 6f | 74 0a 61 63 63 65 70 74 | are no|t.accept|
|00006350| 61 62 6c 65 2e 20 78 20 | 3a 3d 20 6b 20 6d 61 79 |able. x |:= k may|
|00006360| 20 69 6e 76 6f 6c 76 65 | 20 74 72 75 6e 63 61 74 | involve| truncat|
|00006370| 69 6f 6e 2e 0a 0a 54 68 | 65 20 70 72 65 73 65 6e |ion...Th|e presen|
|00006380| 63 65 20 6f 66 20 73 65 | 76 65 72 61 6c 20 6e 75 |ce of se|veral nu|
|00006390| 6d 65 72 69 63 20 74 79 | 70 65 73 20 69 73 20 65 |meric ty|pes is e|
|000063a0| 76 69 64 65 6e 74 6c 79 | 20 61 20 63 6f 6e 63 65 |vidently| a conce|
|000063b0| 73 73 69 6f 6e 20 74 6f | 0a 69 6d 70 6c 65 6d 65 |ssion to|.impleme|
|000063c0| 6e 74 61 74 69 6f 6e 73 | 20 77 68 69 63 68 20 63 |ntations| which c|
|000063d0| 61 6e 20 61 6c 6c 6f 63 | 61 74 65 20 64 69 66 66 |an alloc|ate diff|
|000063e0| 65 72 65 6e 74 20 61 6d | 6f 75 6e 74 73 20 6f 66 |erent am|ounts of|
|000063f0| 20 73 74 6f 72 61 67 65 | 20 74 6f 0a 76 61 72 69 | storage| to.vari|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.