comp.lang.ada
 help / color / mirror / Atom feed
* (no subject)
@ 2012-07-26 15:06 
  0 siblings, 0 replies; only message in thread
From:  @ 2012-07-26 15:06 UTC (permalink / raw)


Thu, 26 Jul 2012 08: 06:41 -0700 (PDT)
        Thu, 26 Jul 2012 08:06:40 -0700 (PDT)
MIME-Version: 1.0
Path: p10ni64698300pbh.1!nntp.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!q21no3655192qas.0!news-out.google.com!a15ni105485768qag.0!nntp.google.com!q21no17643801qas.0!news-out.google.com!b9ni64983258pbl.0!nntp.google.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.straub-nv.de!news-2.dfn.de!news.dfn.de!feeder.erje.net!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail
From: "Randy Brukardt" <randy@rrsoftware.com>
Newsgroups: comp.lang.ada
Subject: Re: Ada 2005 puzzle
Date: Thu, 19 Jul 2012 21:41:46 -0500
Organization: Jacob Sparre Andersen Research & Innovation
Lines: 66
Message-ID: <juaghb$fv9$1@munin.nbi.dk>
References: <1arp60wtxes8h$.1qs6bt732ztgp.dlg@40tude.net> <030cde76-7435-405d-9f12-ac7f730ecab8@googlegroups.com> <1f9q6vk5z2r3t$.1hayo9rmxfwu7$.dlg@40tude.net> <ju8atj$734$1@munin.nbi.dk> <7308644e-bfbe-44c1-8359-d67392d483e1@googlegroups.com>
NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net
X-Trace: munin.nbi.dk 1342752108 16361 69.95.181.76 (20 Jul 2012 02:41:48 GMT)
X-Complaints-To: news@jacob-sparre.dk
NNTP-Posting-Date: Fri, 20 Jul 2012 02:41:48 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5931
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157
Bytes: 4075
X-Received-Bytes: 4600

"Maciej Sobczak" <see.my.homepage@gmail.com> wrote in message 
news:7308644e-bfbe-44c1-8359-d67392d483e1@googlegroups.com...
W dniu czwartek, 19 lipca 2012 08:53:35 UTC+2 uzytkownik Randy Brukardt 
napisal:

>> (With the obvious exception that &quot;limited&quot; almost never is 
>> really what you
>> want in Ada,
>
>I disagree. Limited is a very frequent case - this seems to be very much in 
>the Ada spirit, which
> in many places promotes reduction of available operations in order to ease 
> analysis and increase
> safety.

Sure, it's frequent. But it's still not what you *really* want, because you 
almost always need some copying. You just want that copying to be 
destructive (that is a move) or a creator (making a new object) or as a 
cloner (making a copy that acts as if it is the original).

For example, you can't put limited objects into containers. We spent quite a 
bit of mental energy trying to come up with some way to do so, but 
eventually it proved futile, because you need some sort of copy to get the 
objects into (and something out of) the container.

Which means that you can't let Ada do the storage management for you (as in 
the containers); you have to use explicit access types. That's a huge step 
backwards.

> Note also that protected objects are limited by nature and in Ada 2005 
> that fact has to
> play well with interfaces, and so on.

Well, I think interfaces are useless, and this is a reason. :-)

As for protected objects, that is why we tried so hard to make containers 
for limited objects. But it can't be done in any general way. So you have to 
resort to 1980's programming to use them.

Almost every protected object I've ever used has been a global object 
(usually a queue or lock). And that's in part because you can't make usable 
data structures out of them.

>> clever use of Adjust fixes
>
>If you have to be *clever* to *fix* something and make it kinda sorta work, 
>then this is just
> hacking around and has little to do with software engineering.

And the alternative is to fill your program with raw access types and 
Unchecked_Deallocation. And *that* has little to do with software 
engineering.

As I said to Dmitry, the problem isn't so much that you don't have uses for 
limited types, the problem is that neither "no-copying" nor "free-copying" 
is appropriate for most such types. The majority of types I've written fit 
into neither box. And there are no other choices possible in Ada. So you 
have to be *clever* in some way in order to fit the types into the boxes Ada 
gives you. And note that I don't have an answer here, only a problem. I 
personally would rather be *clever* to *fix* something than to retreat into 
1980's programming that cannot be done right by any technique. But your 
mileage may vary.

                              Randy. 





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-26 15:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-26 15:06 

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