comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin D. Condic" <mcondic-nospam@quadruscorp.com>
Subject: Re: Another Newbie question about interfacing to C
Date: 2000/06/02
Date: 2000-06-02T12:19:44+00:00	[thread overview]
Message-ID: <3937A57B.11D12015@quadruscorp.com> (raw)
In-Reply-To: cm2ejs8njjg8m01nkdqmc29ao6rnq7b7j7@4ax.com

gressett@iglobal.net wrote:
> Hmmm. Further study of the Cohen book causes me to believe that a
> discriminant record type is what I need. It's interesting how C habits
> can lead you into not seeing Ada stuff that is right under your nose.

You might also try tagged records. You can declare some base type to be
tagged record and create an access type which will point to elements of
that class. Then anything you derive from that base type can be pointed
to by the access type. That way, you can create arrays of pointers that
will have heterogeneous collections of stuff. The routine you call to
process the stuff can then take advantage of dispatching to
automagically find the correct subprograms for processing the specific
items passed.

This may come a little closer in flavor to what you described than
discriminated records do. Hope this is helpful

MDC
-- 
======================================================================
Marin David Condic - Quadrus Corporation - http://www.quadruscorp.com/
Send Replies To: m c o n d i c @ q u a d r u s c o r p . c o m
Visit my web site at:  http://www.mcondic.com/

"Some people think programming Windows is like nailing jello to the 
ceiling... easy with the right kind of nails."

    --  Ivor Horton - Beginning Visual C++ 6
======================================================================




      reply	other threads:[~2000-06-02  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-01  0:00 Another Newbie question about interfacing to C David Gressett
2000-06-01  0:00 ` gressett
2000-06-02  0:00   ` Marin D. Condic [this message]
replies disabled

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