comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada 2005 puzzle
Date: Fri, 20 Jul 2012 19:12:44 -0500
Date: 2012-07-20T19:12:44-05:00	[thread overview]
Message-ID: <jucs63$dj0$1@munin.nbi.dk> (raw)
In-Reply-To: 72bc2c23-4a1c-4c09-985e-8cc4c0fd957f@googlegroups.com

"Maciej Sobczak" <see.my.homepage@gmail.com> wrote in message 
news:72bc2c23-4a1c-4c09-985e-8cc4c0fd957f@googlegroups.com...
W dniu piatek, 20 lipca 2012 04:41:46 UTC+2 uzytkownik Randy Brukardt 
napisal:

...
>> For example, you can&#39;t put limited objects into containers.
>
>Then we have poor containers.

A group of us tried to come up with a workable design for limited containers 
and were unable to do so.

>Let's take existing Query_Element-like operations for inspiration. What 
>about:
>
>  procedure Insert (C : in out Container;
>     Constructor : not null access function return T);
>
>with intended support for downward closures via local and non-local 
>constructor functions.
> T can be limited or even class-wide limited (which is even more useful).

It would be obnoxious to use, as you'd have to write all manner of 
constructor functions and wrappers of the same. We thought Query_Element is 
too much of a pain to use, which is why Ada 2012 adds user-defined indexing 
and user-defined dereferencing so no one has to use those functions.

I also believe that there other operations that would be problems -- but in 
any case, I don't remember the details of what we talked about years ago.

...
>> I personally would rather be *clever* to *fix* something than to retreat 
>> into
>> 1980&#39;s programming that cannot be done right by any technique. But 
>> your
>> mileage may vary.
>
>My mileage is that we have to fix what is broken, instead of hacking around 
>it.

That's the best option, but we couldn't do it. Perhaps we weren't clever 
enough!

It's definitely the case that there are applications where limited is too 
limiting, and full non-limited is too hard to support.

(Another problem is the inability to change limitedness within a hierarchy; 
you can't have limited descendants of non-limited types, or vice-versa. This 
essentially forces using non-limited in the whole hierarchy if it is needed 
at any level. This is necessary because of dispatching and conversions: if 
you can have mixed limited and non-limited types, you can always convert to 
a place where assignment is allowed. And then what?)

                                           Randy.





  parent reply	other threads:[~2012-07-26 14:35 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12 12:54 Ada 2005 puzzle Dmitry A. Kazakov
2012-07-12 15:48 ` Adam Beneschan
2012-07-12 16:34   ` Dmitry A. Kazakov
2012-07-19  6:53     ` Randy Brukardt
2012-07-19  7:55       ` Dmitry A. Kazakov
2012-07-20  2:22         ` Randy Brukardt
2012-07-20  7:20           ` Dmitry A. Kazakov
2012-07-21  0:04             ` Randy Brukardt
2012-07-21  8:34               ` Dmitry A. Kazakov
2012-07-24  2:38                 ` Randy Brukardt
2012-07-24  4:23                   ` Adam Beneschan
2012-07-24  7:54                     ` Dmitry A. Kazakov
2012-07-25 23:39                       ` Randy Brukardt
2012-07-26  7:41                         ` Dmitry A. Kazakov
2012-07-26 13:08                           ` Simon Wright
2012-07-26 13:55                             ` Dmitry A. Kazakov
2012-07-27  9:42                               ` AdaMagica
2012-07-27 10:32                                 ` Dmitry A. Kazakov
2012-07-27 11:58                                   ` Georg Bauhaus
2012-07-27 13:04                                     ` Dmitry A. Kazakov
2012-07-28  9:48                                       ` AdaMagica
2012-07-28 10:37                                         ` Dmitry A. Kazakov
2012-07-28 16:59                                           ` AdaMagica
2012-07-28 18:21                                             ` Dmitry A. Kazakov
2012-07-19  8:04       ` Maciej Sobczak
     [not found]         ` <juaghb$fv9$1@munin.nbi.dk>
2012-07-20  7:30           ` Dmitry A. Kazakov
2012-07-21 17:21             ` Vasiliy Molostov
2012-07-21 19:03               ` Dmitry A. Kazakov
2012-07-21 19:37                 ` Vasiliy Molostov
2012-07-21 20:23                   ` Dmitry A. Kazakov
2012-07-21 20:53                     ` Vasiliy Molostov
2012-07-22  7:41                       ` Dmitry A. Kazakov
2012-07-22  8:00                         ` Vasiliy Molostov
2012-07-22  8:19                           ` Dmitry A. Kazakov
2012-07-22  9:06                             ` Vasiliy Molostov
2012-07-22  9:34                               ` Dmitry A. Kazakov
2012-07-20  8:09           ` Maciej Sobczak
2012-07-20  8:27             ` Dmitry A. Kazakov
2012-07-20 11:30               ` Maciej Sobczak
2012-07-20 12:49                 ` Dmitry A. Kazakov
2012-07-21 22:46                   ` Maciej Sobczak
2012-07-22  8:03                     ` Dmitry A. Kazakov
2012-07-22 10:08               ` Florian Weimer
2012-07-22 11:18                 ` Dmitry A. Kazakov
2012-07-21  0:12             ` Randy Brukardt [this message]
2012-07-22  9:52       ` Florian Weimer
replies disabled

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