comp.lang.ada
 help / color / mirror / Atom feed
* Re: Dimensionality Checking (Ada 20XX)
@ 2001-12-11 13:11 Mike Brenner
  2001-12-11 14:46 ` non-generic generic parameters Wes Groleau
  2001-12-11 17:03 ` Dimensionality Checking (Ada 20XX) Mark Lundquist
  0 siblings, 2 replies; 3+ messages in thread
From: Mike Brenner @ 2001-12-11 13:11 UTC (permalink / raw)
  To: comp.lang.ada

Mark Lundquist said: 
> But the compiler only has to look at the generic *spec* to determine this.
> What you *never* see today, and what we'd really like to avoid in any
> language revision, is this: you make a change to the generic *body*, the
> change is legal (the generic body compiles), but suddenly one or more
> *instantiations* become illegal as a result.  That is the problem I'm
> talking about with units.

Is this the reason why non-generic packages have been forbidden as generic parameters? 

It seems that the benefits of a fully orthogonal implementation of generic (making them second-class objects by permitting passing object to objects) outweigh the benefits of keeping compatibility with all existing bodies. 

In particular, permitting non-generic package parameters would give a way to switch implementations without rewriting the code. In particular, a configuration manager could simply swap the spec and body of the package being used as a non-generic parameter to a generic, and that would change the device driver from being Linux-compatible to being COM-compatible. 

Now, a line of code has to be changed in order to swap devices supported, so it requires a PROGRAMMER rather than a CONFIGURATION MANAGER to make that kind of change to a large Ada system.

The disadvantage would be that certain programs might no longer compile, for example, if they used a feature of Linux that COM-objects did not implement.

It seems to me that this disadvantage, detected at compile time, might make up for the advantage?

Also, of course, making packages second class objects like that would be the penultimate step towards eventually making package first-class objects.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-12-11 17:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-11 13:11 Dimensionality Checking (Ada 20XX) Mike Brenner
2001-12-11 14:46 ` non-generic generic parameters Wes Groleau
2001-12-11 17:03 ` Dimensionality Checking (Ada 20XX) Mark Lundquist

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