From: Dmitry A. Kazakov on
On Wed, 03 Mar 2010 20:38:01 +0000, John McCabe wrote:

> As for the tagged Connection type, I'm not sure what you mean. Would
> you mind elaborating on that please?

I meant something like this:

type Abstract_Connection is tagged ...;
procedure On_XYZ (Link : in out Connection) is abstract;

task type Driver (Link : not null access Abstract_Connection'Class);

task body Driver is
-- read a message (could be polymorphic or not)
-- process the message (usually polymorphic)
case ... is
when XYZ => -- XYZ is here
Link.On_XYZ; -- Do what has to be done
when ... =>
end case;
end loop;
when Shut_Down_Exception =>
when Error : others =>
Put ("I am dead! " & Exception_Information (Error));
end Driver;

type My_Fancy_MIDI_Connection is new Abstract_Connection with private;
overriding procedure On_XYZ (Link : in out My_Fancy_MIDI_Connection);

I usually have a driver task which deals with a class-wide Connection
object that implements the lower-level communication protocol (the part
that reads messages) and the higher-level semantic call-backs (the part
that reacts to the messages read).

If the communication library is built on callbacks (i.e. already has a
hidden Driver task), then I pass the connection object as user parameter to
the callback, and the loop body above is what to be done in the callback

The advantage of having Connection tagged is that I can implement layered
protocols and semantic actions incrementally. In complex cases I add
further mix-ins as access discrimnants to Connection, usually when I need
to make lower layers pluggable. But that would be over the top in your

Dmitry A. Kazakov
From: John McCabe on
On Thu, 04 Mar 2010 07:22:34 +0100, Hibou57 (Yannick Duch�ne)
<yannick_duchene(a)> wrote:

>Le Wed, 03 Mar 2010 21:17:12 +0100, John McCabe
><john(a)> a �crit:
>> I've found a library
>> called libjdkmidi that, if it would look easier to bind to than direct
>> to Win32's mmsystem functions, might be worth doing.
>Keep in mind it's a C++ library, not Ada

Of course, as otherwise I wouldn't need to bind to it!
From: Pascal Obry on

> My work project is using a (rather old) GNATpro with Cygwin, also rather
> old; the only issue was to do with cyggnat.dll vs cygwin.dll vs gdb, and
> it was simply a matter of copying the right one to the right place as
> per AdaCore's instructions. I don't know what the current position is.

The cygnat.dll was used for gdb. The recent GNAT versions come with a
MingW based version of GDB. So there is no more cygwin in GNAT package.

I'm still using Cygwin to get a decent shell on Windows plus sshd and cron.



--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--| -
--| "The best way to travel is by means of imagination"
--| gpg --keyserver --recv-key F949BD3B