comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <no.spam@no.spam.com>
Subject: Re: Generic procedures and their parameters
Date: Wed, 06 Sep 2006 16:14:07 +0200
Date: 2006-09-06T16:14:07+02:00	[thread overview]
Message-ID: <edml3e$pnf$1@sunnews.cern.ch> (raw)
In-Reply-To: <wcc1wqpxhqn.fsf@shell01.TheWorld.com>

Robert A Duff wrote:

>> But then, you would need to have even such fundamental things like
>> Integer belong to Ordered'Class. It's a shaky ground.
> 
> Why is that shaky?  Integer IS ordered.

Is it also tagged? Do you want it to be? Or maybe there should be a 
special case for Integer (and its every subtype), so that it's 
semantically in Ordered'Class without being syntactically tagged?
Is it really in the spirit of Ada?

Integer is not only Ordered. It's also Summable, Subtractable, 
Multipliable, Divideable, Powerable, Incrementable, Decrementable, 
Comparable, Copyable, Assignable, Imageable and even Aspect_Clauseable, 
not mentioning Can_Be_Used_As_Array_Index. And it has some others as well.
And all this is very important, since there might be other types that 
share only some of these properties but not others and surely we don't 
want our Container_Of_Incrementable_And_Divideable_And_Comparable to 
contain something that isn't, right?

(sorry if any of the above is not proper English)

;-)

And switching back to serious, I somehow don't like languages that try 
to apply object-orientedness to absolutely everything. In C++ the fact 
that int is ordered does not require that it relates to some Ordered 
class. Such properties - if needed - can be expressed in other ways.


> A hierarchy with Object at the top would be a Good Thing, IMHO.  Trees
> are more aesthetically pleasing than forests.

Opinions vary on this subject. :-)

> But I think perhaps we should have generic types
> (i.e. parameterized types) rather than generic packages.  That's what
> discriminants do, but they're severely limited.  It would make sense to
> have a discriminant that is a type, so you could say:
> 
>     My_Sequence: Sequence(Element => Integer) := (1, 2, 3);

Yes, that would be fine.


-- 
Maciej Sobczak : http://www.msobczak.com/
Programming    : http://www.msobczak.com/prog/



  reply	other threads:[~2006-09-06 14:14 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-06  8:51 Generic procedures and their parameters Maciej Sobczak
2006-09-06  9:43 ` Dmitry A. Kazakov
2006-09-06 12:36   ` Maciej Sobczak
2006-09-06 13:11     ` Robert A Duff
2006-09-06 14:14       ` Maciej Sobczak [this message]
2006-09-06 15:09         ` Dmitry A. Kazakov
2006-09-06 16:35           ` Georg Bauhaus
2006-09-07  7:32             ` Dmitry A. Kazakov
2006-09-07  6:48               ` Georg Bauhaus
2006-09-07 10:19                 ` Dmitry A. Kazakov
2006-09-08  9:11           ` Maciej Sobczak
2006-09-08 10:19             ` Dmitry A. Kazakov
2006-09-09 14:49         ` Robert A Duff
2006-09-09 15:34           ` Dmitry A. Kazakov
2006-09-09 23:26           ` Jeffrey R. Carter
2006-09-10 11:49             ` Robert A Duff
2006-09-10 19:43               ` Jeffrey R. Carter
2006-09-06 13:02   ` Robert A Duff
2006-09-06 14:09     ` Dmitry A. Kazakov
2006-09-08  3:35   ` Randy Brukardt
2006-09-08  7:21     ` Dmitry A. Kazakov
2006-09-09  1:29       ` Randy Brukardt
2006-09-09  7:14         ` Dmitry A. Kazakov
2006-09-09 14:32         ` Robert A Duff
2006-09-06 12:56 ` Robert A Duff
2006-09-07  2:47 ` Steve
2006-09-07  7:47   ` Dmitry A. Kazakov
replies disabled

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