From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8ab6ed0f71c479cd X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!news.glorb.com!news2!nlpi057.nbdc.sbc.com!prodigy.net!newspeer.monmouth.com!newsswitch.lcs.mit.edu!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: API design problem - buffer scatter I/O Date: Tue, 25 Nov 2008 09:25:03 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1b06d68d-a6d8-4af3-8464-92e44224dcd6@20g2000yqt.googlegroups.com> <0b91f255-820a-4901-9785-746e0f01c788@g38g2000yqd.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: pcls4.std.com 1227623104 30170 192.74.137.71 (25 Nov 2008 14:25:04 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 25 Nov 2008 14:25:04 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:2Yuomsx8i0wApqbxdudounYgAuA= Xref: g2news2.google.com comp.lang.ada:3755 Date: 2008-11-25T09:25:03-05:00 List-Id: christoph.grein@eurocopter.com writes: > Thank you, Bob, for these illustrative comments. Problems with wiki is > that people with no good knowledge about the innards of a language > implementation may contribute (and I include myself into this class). > > I fear you do not feel like correcting the wiki. I know, it's much > work, the whole chapter has to be rearranged. You're right -- I don't have time to do a good job of that, so I'm not even going to try. I do appreciate the efforts of others who choose to help out with the wiki, even if it's not always perfect. >> >...This is not an implementation >> > detail. >> >> Sure it is. �How a compiler represents data types (including access >> types) is an implementation detail. > > What I meant is the incompatibility between pointers to constrained > and unconstrained: > > type Unc is array (Integer range <>) of Character; > type Acc_Unc is access Unc; > > CO: aliased Unc (-1 .. +1) := (-1 .. +1 => ' '); > UO: aliased Unc := (-1 .. +1 => ' '); > > A: Acc_Unc := CO'Access; -- illegal > B: Acc_Unc := UO'Access; -- OK > C: Acc_Unc (CO'Range) := CO'Access; -- also illegal > > which is not an implementation detail. Ah, sorry, I misunderstood what you were referring to. I agree that this restriction (A is illegal) is not an implementation detail. The declaration of A makes perfect sense, but it is forbidden for efficiency reasons. Well, not efficiency, really -- distributed overhead. Some say that was a bad language design choice, and I'm at least half convinced. ;-) I'd suggest removing C from the wiki. Constrained subtypes of access types are a weird and nearly-useless feature. I wouldn't teach about them to beginners -- they're confusing. - Bob