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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, PLING_QUERY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f7c597cb40b4adf8 X-Google-Attributes: gid103376,public From: Hyman Rosen Subject: Re: Help! (How to do this (C) in Ada? Date: 1999/05/13 Message-ID: #1/1 X-Deja-AN: 477570143 Sender: hymie@calumny.jyacc.com References: <7heg6m$43a$1@nnrp1.deja.com> X-Complaints-To: abuse@panix.com X-Trace: news.panix.com 926631263 22387 209.49.126.226 (13 May 1999 21:34:23 GMT) Organization: PANIX Public Access Internet and UNIX, NYC NNTP-Posting-Date: 13 May 1999 21:34:23 GMT Newsgroups: comp.lang.ada Date: 1999-05-13T21:34:23+00:00 List-Id: 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. I suspect you will get better information on how to use a more Ada-appropriate style if you describe your actual design and what it is meant to accomplish.