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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,7272aa7508a3d83f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!wn13feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail From: Dave Thompson Newsgroups: comp.lang.ada Subject: Re: pointer questions Message-ID: <65ltm11d842tegobi60hi2njt82j6st87m@4ax.com> References: X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 07 Nov 2005 04:21:08 GMT NNTP-Posting-Host: 12.76.14.81 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1131337268 12.76.14.81 (Mon, 07 Nov 2005 04:21:08 GMT) NNTP-Posting-Date: Mon, 07 Nov 2005 04:21:08 GMT Organization: AT&T Worldnet Xref: g2news1.google.com comp.lang.ada:6259 Date: 2005-11-07T04:21:08+00:00 List-Id: On 27 Oct 2005 10:14:40 -0400, Robert A Duff wrote: > Szymon Guz writes: > > > Well, that's how I thought but I wanted to ask. The problem that I want > > to solve is how to create a property in type like that ones in > > Delphi|Builder, so I have defined the property name, value, read and > > write functions. I thought that it could be done by defining a generic > > structure like this: > > I'm not sure I fully understand what you're trying to do, but I suspect > you can do it with a hierarchy of tagged types. You will have an > access-to-class-wide type, which is sort of like "void *", but it's > safe. > Actually Ada access to classwide is much more like C++ pointer to baseclass, or possibly reference to baseclass, which are similarly typesafe (at least in themselves; of course in C++ you are more likely to have passed them through other unsafe constructs elsewhere). > Alternatively, a generic package might do what you want. > You would have one instance for each type of Value you > want to store. This method might be safer, but less flexible. > That said, in this case I think generic probably is better. - David.Thompson1 at worldnet.att.net