comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <spam@spam.com>
Subject: Re: Proposed change to BC iterator parameters
Date: Wed, 10 Dec 2003 18:22:44 GMT
Date: 2003-12-10T18:22:44+00:00	[thread overview]
Message-ID: <UvJBb.9094$rP6.8762@newsread2.news.pas.earthlink.net> (raw)
In-Reply-To: <mailman.69.1071063420.31149.comp.lang.ada@ada-france.org>

amado.alves wrote:

> Strictly you don't need the limited formal for (unlimited) tagged or
> class actuals. You need the limited formal for limited actuals,
> whatever their class. Limitedness is completely orthogonal to
> definiteness. I do like indefinite formals, but I pass well without
> limited ones. Most limited formals I've seen in libraries are
> accompanied by a formal assignment operation or some such, which
> prety much defeats the purpose of their (formal) limitedness, i.e.
> their logic is in clash with their definition.

The problem is that a generic formal part is a specification; it 
specifies what the generic needs, and the client must provide, for the 
generic to do its work. "Limited" implies 2 unrelated concepts: absence 
of assignment, and absence of predefined equality. To specify that the 
generic needs to be able to assign objects of a formal type, but does 
not need to perform equality comparisons, can only be done correctly 
with a limited private formal type, and a formal Assign procedure.

A non-limited formal type specifies that the generic needs to perform 
equality comparisons on values of the type, which is an error in 
specification. I know this seems a minor issue to many people, but 
precise specifications are essential to ensuring the correct usage of 
reusable components by their clients.

This connection between assignment and equality may have made sense in 
Ada 83, where equality could only be defined for limited types, but 
seems an unnecessary restriction in Ada 95.

In hindsight, it would have been better to eliminate the "limited" 
reserved word completely, and use instead

type T is private;
-- Same as Ada's "limited private"

type T is private with ":=";
-- Assignment defined; "=" not; no Ada equivalent

with the capability of defining "=" for either type.

-- 
Jeff Carter
"Perfidious English mouse-dropping hoarders."
Monty Python & the Holy Grail
10




  parent reply	other threads:[~2003-12-10 18:22 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-10 13:36 Proposed change to BC iterator parameters amado.alves
2003-12-10 16:47 ` Proposed change to BC iterator parameters [limitedness] Georg Bauhaus
2003-12-10 17:39 ` Proposed change to BC iterator parameters Martin Krischik
2003-12-10 18:22 ` Jeffrey Carter [this message]
2003-12-10 23:00   ` Robert A Duff
2003-12-11  1:00     ` Jeffrey Carter
2003-12-11 15:09       ` Robert A Duff
2003-12-11  8:33     ` Dmitry A. Kazakov
2003-12-10 20:50 ` Simon Wright
2003-12-10 23:12 ` Robert A Duff
2003-12-11  5:07   ` Steve
2003-12-11 15:24     ` Robert A Duff
2003-12-11 17:39       ` Jeffrey Carter
2003-12-12 22:22         ` Robert A Duff
2003-12-13  0:57           ` Jeffrey Carter
2003-12-17 20:59             ` Robert A Duff
2003-12-18 10:05               ` Dmitry A. Kazakov
2003-12-18 18:14                 ` Robert A Duff
2003-12-19 10:53                   ` Dmitry A. Kazakov
2003-12-19 16:17                     ` Georg Bauhaus
2003-12-19 17:19                       ` Dmitry A. Kazakov
2003-12-19 22:51                         ` Robert A Duff
2003-12-20 12:20                           ` Dmitry A. Kazakov
2003-12-19 22:47                       ` Robert A Duff
2003-12-20  2:11                         ` Stephen Leake
2003-12-20 19:08                         ` Robert I. Eachus
2003-12-21 11:39                           ` Simon Wright
2003-12-21 18:13                             ` Robert I. Eachus
2003-12-21 13:58                           ` Dmitry A. Kazakov
2003-12-22  1:25                             ` Robert I. Eachus
     [not found]         ` <916oa1-c93.ln1@beastie.ix.netcom.com>
2003-12-13 16:57           ` Simon Wright
2003-12-12  5:29     ` Simon Wright
2003-12-12 22:26       ` Robert A Duff
2003-12-13 16:55         ` Simon Wright
2003-12-13 17:27           ` Dmitry A. Kazakov
2003-12-13  2:44       ` Steve
  -- strict thread matches above, loose matches on Subject: below --
2003-12-23 10:40 amado.alves
2003-12-19 15:53 amado.alves
2003-12-19 23:05 ` Robert A Duff
2003-12-11 16:02 amado.alves
2003-12-11 15:05 ada_wizard
2003-12-11 16:45 ` Robert A Duff
2003-12-11 12:56 amado.alves
2003-12-17 20:25 ` Robert A Duff
2003-12-11 12:43 amado.alves
2003-12-11 12:33 amado.alves
2003-12-10 14:39 amado.alves
2003-12-10  5:46 Simon Wright
2003-12-10 18:12 ` Jeffrey Carter
2003-12-11 16:10   ` Martin Krischik
2003-12-10 20:59 ` Simon Wright
replies disabled

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