From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e94a7e4f6f888766 X-Google-Attributes: gid103376,public From: "Matthew Heaney" Subject: Re: Self-referential types Date: 1999/10/13 Message-ID: <3804d8c4_4@news1.prserv.net>#1/1 X-Deja-AN: 536356326 Content-transfer-encoding: 7bit References: <7ttb4a$8mq$1@nnrp1.deja.com> <3802f2db_2@news1.prserv.net> <3803B5E3.F96A6DD4@mitre.org> <3803c8bc_2@news1.prserv.net> <7u25pu$p4k$1@nnrp1.deja.com> Content-Type: text/plain; charset="US-ASCII" X-Complaints-To: abuse@prserv.net X-Trace: 13 Oct 1999 19:08:52 GMT, 129.37.62.4 Organization: Global Network Services - Remote Access Mail & News Services Mime-version: 1.0 Newsgroups: comp.lang.ada Date: 1999-10-13T00:00:00+00:00 List-Id: In article <7u25pu$p4k$1@nnrp1.deja.com> , Ted Dennison wrote: >> type Digital_Clock (...) is >> limited record >> Master_Obs : Master_Obs_Type (Digital_Clock'Access); >> Slave_Obs : Slave_Obs_Type (Digital_Clock'Access); >> Control : Control_Type (Digital_Clock'Access); >> end record; > > Ok...What does this buy you over using non-anonomous access fields and > an initilization? And how does this constitute MI? Because the observer types have a primitive operation (Update) called by their subject. The Master_Timer subject calls back the Master_Obs component of the Digital_Clock, and the Slave_Timer subject calls back the Slave_Obs component. See the article about multiple subjects in the design patterns archive, from whence this was paraphrased. Perhaps it would have been more obvious to have done it this way: type Digital_Clock (...) is new Limited_Controlled with record Master_Obs : Master_Obs_Type (Digital_Clock'Access); Slave_Obs : Slave_Obs_Type (Digital_Clock'Access); end record; Syntactically, Digital_Clock has only a single parent, Limited_Controlled. But logically, it has three parents (Limited_Controlled once, and Observer_Type twice). Matt -- The theory of evolution is quite rightly called the greatest unifying theory in biology. The diversity of organisms, similarities and differences between kinds of organisms, patterns of distribution and behavior, adaptation and interaction, all this was merely a bewildering chaos of facts until given meaning by the evolutionary theory. Populations, Species, and Evolution Ernst Mayr