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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5c89acd494ea9116 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Sat, 01 Sep 2007 21:49:52 +0200 From: Georg Bauhaus Organization: # User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Self pointer in limited record References: <1183577468.034566.57830@n60g2000hse.googlegroups.com> <1188578849.187422.280620@50g2000hsm.googlegroups.com> <9fy1xoukz1e3$.h574sqmiauri$.dlg@40tude.net> <46d968ee$0$30368$9b4e6d93@newsspool4.arcor-online.net> <137iu0lr82dtb$.wqy3zjz2vr9q.dlg@40tude.net> <46d972e8$0$30384$9b4e6d93@newsspool4.arcor-online.net> <1alyfwaig93sk$.99oy269uon$.dlg@40tude.net> In-Reply-To: <1alyfwaig93sk$.99oy269uon$.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <46d9c138$0$4531$9b4e6d93@newsspool3.arcor-online.net> NNTP-Posting-Date: 01 Sep 2007 21:44:56 CEST NNTP-Posting-Host: 158ff56e.newsspool3.arcor-online.net X-Trace: DXC=_bQ^]]eD_b1gP]QSEBQ^d4McF=Q^Z^V384Fo<]lROoR1^;5]aA^R6>2`nVDMFOZd64PCY\c7>ejV8:G;46OW>A2?PQINNf@7o_0 X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:1654 Date: 2007-09-01T21:44:56+02:00 List-Id: Dmitry A. Kazakov wrote: >> 2 - Nesting packages is an option, a distinguishing feature >> of Ada IMO; a package nested inside a subprogram is a >> simple solution to the life cycle problem of module style >> objects. > > Hmm, a subprogram has all properties of a package. So there is no obvious > reason why nested package (except instances of generic packages, of > course), might be useful there. You can have two nested packages, or more. :-) procedure run_a_farm is -- simplified type Sound is (Bow_Wow, Cock_A_Doodle_Doo, Moo, Dinner_is_Ready, Order); BARK : exception; package House is procedure Cook_Meal; procedure Eat; procedure Sleep; procedure Alarm; end House; package Barn is procedure Feed; procedure Milk; procedure Alarm; end Barn; task Events is entry Noise (Kind: Sound); private entry Call_Benjamin (Kind: Sound); end Events; package body House is separate; package body Barn is separate; -- Note: Both House and Barn can make Noise. -- Everyone can react to exceptional BARKing. task body Events is separate; begin Events.Noise (Cock_A_Doodle_Doo); end run_a_farm;