comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com
Subject: Re: Help! (How to do this (C) in Ada?
Date: 1999/05/14
Date: 1999-05-14T00:00:00+00:00	[thread overview]
Message-ID: <7hhh5g$avj$1@nnrp1.deja.com> (raw)
In-Reply-To: t7aev8ejp4.fsf@calumny.jyacc.com

In article <t7aev8ejp4.fsf@calumny.jyacc.com>,
  Hyman Rosen <hymie@prolifics.com> wrote:
> byhoe@my-dejanews.com writes:
> > I am puzzle with the following C code:
> > #define InheritLayout ((Boolean (*)())_Inherit)
> > How can I implement the above in Ada?
>
> In C, this is a typecast of the value of _Inherit (whatever that is)
> into a pointer to a function which takes no arguments and returns a
> Boolean (whatever that is). I don't know Ada myself, but my guess
> would be that in Ada you declare a type which is access to the correct
> type of function, then use unchecked_conversion to convert _Inherit to
> that type.

You probably wouldn't need unchecked conversion, since the types would
be the same. But then again, if you are somewhat carful about how you
define your types, you might not need this conversion routine at all.

--
T.E.D.


--== Sent via Deja.com http://www.deja.com/ ==--
---Share what you know. Learn what you don't.---




  reply	other threads:[~1999-05-14  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-13  0:00 Help! (How to do this (C) in Ada? byhoe
1999-05-13  0:00 ` Hyman Rosen
1999-05-14  0:00   ` dennison [this message]
1999-05-14  0:00     ` Hyman Rosen
1999-05-16  0:00 ` Robert Dewar
1999-05-17  0:00   ` byhoe
replies disabled

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