comp.lang.ada
 help / color / mirror / Atom feed
From: Lutz Donnerhacke <lutz@iks-jena.de>
Subject: Re: Porting from Modula-2 to Ada
Date: Fri, 18 Oct 2002 11:21:30 +0000 (UTC)
Date: 2002-10-18T11:21:30+00:00	[thread overview]
Message-ID: <slrnaqvrlo.nv.lutz@taranis.iks-jena.de> (raw)
In-Reply-To: FMRr9.86812$Fz.263212@rwcrnsc51.ops.asp.att.net

* Jeffrey Creem wrote:
> "Lutz Donnerhacke" <lutz@iks-jena.de> 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. :-/



  reply	other threads:[~2002-10-18 11:21 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-18  8:24 Porting from Modula-2 to Ada Manuel Collado
2002-10-18  9:45 ` Bernd Specht
2002-10-18 10:33   ` Lutz Donnerhacke
2002-10-18 10:55     ` Jeffrey Creem
2002-10-18 11:21       ` Lutz Donnerhacke [this message]
2002-10-18 22:01         ` Jeffrey Creem
2002-10-18 21:29     ` Jeffrey Carter
2002-10-18 21:39       ` Jeffrey Carter
2002-10-18 11:20 ` Nicolas Cailín Paul Gloster
2002-10-18 15:14   ` Pat Rogers
2002-10-24 14:51     ` Colin Paul Gloster
2002-10-25  3:43       ` Dennis Lee Bieber
2003-02-04 14:12       ` Colin Paul Gloster
2003-02-09  6:07         ` Robert I. Eachus
2002-10-19 13:30 ` SteveD
2002-10-22  7:48   ` Manuel Collado
2002-10-22  7:55 ` Manuel Collado
2002-10-22 18:56   ` Jeffrey Carter
2002-10-23  9:08     ` Manuel Collado
replies disabled

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