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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e5fae12a81834f90 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-23 01:26:06 PST Path: supernews.google.com!sn-xit-03!supernews.com!64.71.136.253.MISMATCH!news!news.he.net!news-hog.berkeley.edu!ucberkeley!news.maxwell.syr.edu!news-was.dfn.de!news-koe1.dfn.de!news-han1.dfn.de!news.fh-hannover.de!news.cid.net!news.enyo.de!news1.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: AdaYY wish list from current projects Date: 23 Feb 2001 10:30:51 +0100 Organization: Enyo's not your organization Message-ID: <87elwp3fw4.fsf@deneb.enyo.de> References: <96ulad$r9e$1@belenus.iks-jena.de> <87u25nnfer.fsf@deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Xref: supernews.google.com comp.lang.ada:5463 Date: 2001-02-23T10:30:51+01:00 List-Id: lutz@iks-jena.de (Lutz Donnerhacke) writes: > Unfortunly this does increase the space requirments significantly. OTOH it > does not address the problem, because I'd like to have a small RAM area > containing only list heads. So I'd instantiate > head : Mix_In_Type(Null); > or anything like this? Hmm. Seems to work using additional pointers :-( I think you would have to use an access value instead (that's the same with your proposed approach). > >It appears that Ada is not suitable for this kind of design. > > Very bad. I'd like to suggest a language feature in order to solve this. Perhaps general introspection? ;-) To be honest, I don't think that access-to-component variables can be added to Ada as transparently as it is possible in, say C++. The involved offset might not be constant for types with discriminants, which makes implementations of this feature quite complicated. > >> Problem 2: Defining Byte_Order of record representations > Unfortunly I have to deal with memory mapped I/O (i.e. network cards) You didn't mention this... > You miss the point. Providing such packages does not allow the compiler to > generate good maschine code. You need the conversion package anyway, at least that's my experience. Otherwise, your code is quite unportable, as you're passing around invalid values. > >> Problem 3: Static expressions of discriminants in record representations > *Gna* And now remove the limitation, that the discriminants have to appear > first. Aha, this was the intent of your comment (I thought you were talking about the source code location). Are trailing size specifies really common? To me, they don't make much sense. > Even better: Try to write a program, which derivates the type from a pointer. Sorry, what do you want to do?