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,26aa6d7095c151 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-18 04:21:31 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: Porting from Modula-2 to Ada Date: Fri, 18 Oct 2002 11:21:30 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <3DAFC542.152C0EE0@lml.ls.fi.upm.es> NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1034940090 5853 217.17.192.37 (18 Oct 2002 11:21:30 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Fri, 18 Oct 2002 11:21:30 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:29898 Date: 2002-10-18T11:21:30+00:00 List-Id: * Jeffrey Creem wrote: > "Lutz Donnerhacke" wrote in message >> generic >> type T(<>) is limited private; >> procedure Xxx (data : T); > > When I have done this I tend to make the generic formal parameter be > private instead of limited private. There are times when limited might be > right but almost any time someone makes something limited, the in memory > representation one would get via the type is somewhat bogus. generic types define the most restrictive assumptions can be made on every real type: You can instantiate a limited generic type with an ordinary one. When removing the limited constraint from the generic definiton, you allow the generic program to copy variables of the generic type. So you are never allowed to instantiate this construct with a limited type. The other way around you are allowed to instantiate, because your real type fullfills all requirements (and a lot more). > Also, it is worth checking in the generic body that the 'size of the type > is a multiple of the 'size of the storage element (or whatever type you > use to write to the file) You didn't read my code. :-/