comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: attributes in generic procedure
Date: 1999/11/29
Date: 1999-11-29T00:00:00+00:00	[thread overview]
Message-ID: <81u30o$i4c$1@nnrp1.deja.com> (raw)
In-Reply-To: 3841CE51.862ACED3@icon.fi

In article <3841CE51.862ACED3@icon.fi>,
  Niklas Holsti <nholsti@icon.fi> wrote:
> In fact, there is no formal_scalar_definition in the RM. I,
> too, would have liked to have one when I recently wrote a
> generic function to take the maximum value of a vector of some
> generic element type.

For good reason!

How would one compile shared code for such a case? Answer you
would have to pass in all possible operations. Given that this
is the case, you can achieve this result yourself, either with
a specific list of generic operators, or with a formal generic
package containing the required operations.

The built in formal types in generics are quite deliberately
limited to those that can be handled efficiently in shared
code. Remember that you can always do anything you want with
formal private types by passing in the operations that are
needed.

The built in formal types allow a simplification in the cases
where the set of built in types is the same across a class
of types and therefore do not need to be passed in.


Sent via Deja.com http://www.deja.com/
Before you buy.




  reply	other threads:[~1999-11-29  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-21  0:00 attributes in generic procedure daelen
1999-11-21  0:00 ` Matthew Heaney
1999-11-25  0:00 ` Nick Roberts
1999-11-29  0:00   ` Niklas Holsti
1999-11-29  0:00     ` Robert Dewar [this message]
1999-12-03  0:00       ` Nick Roberts
replies disabled

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