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-Language: ENGLISH,ASCII X-Google-Thread: 103376,3f7eea20d2f6f1b5,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-17 21:36:57 PST Message-ID: <3cbe4d93@newsflash.abo.fi> From: Jukka-Pekka Suominen Subject: Need help with DIALOG Newsgroups: comp.lang.ada Date: Thu, 18 Apr 2002 07:35:29 +0300 User-Agent: KNode/0.6.1 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8Bit NNTP-Posting-Host: babaorum.adsl.abo.fi X-Original-NNTP-Posting-Host: babaorum.adsl.abo.fi X-Trace: newsflash.abo.fi 1019104659 babaorum.adsl.abo.fi (18 Apr 2002 07:37:39 +0200) XPident: Unknown Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!deine.net!fr.clara.net!heighliner.fr.clara.net!news-raspail.gip.net!news.gsl.net!gip.net!news1.spb.su!newsfeed1.funet.fi!newsfeeds.funet.fi!newsflash.abo.fi Xref: archiver1.google.com comp.lang.ada:22699 Date: 2002-04-18T07:35:29+03:00 List-Id: Hi! Before you ask, yes, this is a homework assignment, but I've only been learning ada for a few days, so I would appreciate some help. Anyway, the assignment is as follows. You have a simple conversation between two processes as illustrated below. Show how this can be constructed as a colloquy (which I get explained as being dialog statements combined with select). the code: x, y, z : integer; process B; process A; begin ... action conversation with ( B ) do ensure A_acceptance_test by -- A_primary -- uses x, y else by -- A_secondary -- uses y, z else error end conversation; ... end A; process B; begin ... action conversation with ( A ) do ensure B_acceptance_test by -- B_primary -- uses x, y else by -- B_secondary -- uses y, z else error end conversation; ... end B; And here's what I managed to throw together. Is it anywhere near how it should be done? x, y, z : integer; DIALOG the_dialog SHARES (x, y, z); process B; process A; begin SELECT DISCUSS the_dialog BY -- something involving x, y TO ARRANGE A_acceptance_test; OR DISCUSS the_dialog BY -- something involving y, z TO ARRANGE A_acceptance_test; ELSE -- error handling END SELECT; END A; process B; begin SELECT DISCUSS the_dialog BY -- something involving x, y TO ARRANGE B_acceptance_test; OR DISCUSS the_dialog BY -- something involving y, z TO ARRANGE B_acceptance_test; ELSE -- error handling END SELECT; END B; Any helps would be greatly appreciated. -- Jukka-Pekka Suominen Assembler is for wimps! �bo Akademi - MNF/IB *Real* programmers flip switches!