comp.lang.ada
 help / color / mirror / Atom feed
* Need help with DIALOG
@ 2002-04-18  4:35 Jukka-Pekka Suominen
  2002-04-18 19:02 ` Stephen Leake
  0 siblings, 1 reply; 2+ messages in thread
From: Jukka-Pekka Suominen @ 2002-04-18  4:35 UTC (permalink / raw)


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!



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Need help with DIALOG
  2002-04-18  4:35 Need help with DIALOG Jukka-Pekka Suominen
@ 2002-04-18 19:02 ` Stephen Leake
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Leake @ 2002-04-18 19:02 UTC (permalink / raw)


Jukka-Pekka Suominen <jukka-pekka.suominen@abo.fi> writes:

> 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 you posted is _not_ Ada. Have you got the right newsgroup?

Maybe it's some sort of psuedo-code that you are supposed to translate
into Ada. That's nice, but since I don't know the meaning of the
psuedo-code reserved words, I can't help

> 
> 
> the code: <snipped>
-- 
-- Stephe



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-04-18 19:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-18  4:35 Need help with DIALOG Jukka-Pekka Suominen
2002-04-18 19:02 ` Stephen Leake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox