From: "Dan'l Miller" <optikos@verizon.net>
Subject: Re: Visibility of Indexing aspects
Date: Thu, 26 Jul 2018 14:25:17 -0700 (PDT)
Date: 2018-07-26T14:25:17-07:00 [thread overview]
Message-ID: <71ab145a-83fd-46af-81c3-fe72c67c6897@googlegroups.com> (raw)
In-Reply-To: <f923e960-d3de-4f65-91c6-bbf0a898d2f8@googlegroups.com>
On Thursday, July 26, 2018 at 3:31:04 PM UTC-5, Shark8 wrote:
> On Wednesday, July 25, 2018 at 6:12:24 PM UTC-6, Randy Brukardt wrote:
> > "Dan'l Miller" wrote in message
> > news:googlegroups.com...
> > On Wednesday, July 25, 2018 at 2:58:44 PM UTC-5, AdaMagica wrote:
> > >> Much ado about nothing.
> > >>
> > >> The writer of this code erroneously put things in the private part which
> > >> should have been public. There is a compiler bug leaking from privacy
> > >>which seduced the writer into thinking that his wrong code is correct.
> > >>
> > >> The RM is very precise about this, see the references in this thread.
> > >>
> > >> Love's Labours Lost with any further discussion.
> > >
> > >In other words, I made an insightful good point ...
> >
> > Sounds like babble to me. What's used by the client has to be public,
> > period.
>
> But this is legal:
>
> Package K is
> Type Example is private;
> Private
> Type Example is null record;
> For Example'Size use 4;
> End K;
>
> Package J is
> Type Hex is range 16#0#..16#F#
> with Size => 4;
>
> Type Ex_2 is record
> Item_1 : Hex;
> Item_2 : K.Example;
> end record
> with Size => 8;
>
> End J;
>
> > ...
> > >The _LRM_'s forcing of {Reference, Reference_Holder, Container_Array, ...}
> > >to be public declarations ...
> >
> > ...is perfectly fine -- there's nothing wrong or dangerous with using them
> > directly. Indeed, "indexing" is just a shorthand for a longer call involving
> > Reference -- you're always allowed to make the longer call, just like you
> > are allowed to put in .all even if you could have omitted it. We went to
> > substantial lengths to ensure that you can't keep a reference value longer
> > than the existence of the return object from Reference -- regardless of how
> > you use the package. (Telling people not to do something is never an
> > effective technique for safety!)
>
> But that's not the issue that is being cited in the original post.
> The issue is that all the indexing-attributes are declared/used in the private part and are [apparently]
> being used in the publicly visible part.
>
> Is this correct?
Yes that is correct regarding the OP, but my replies were requesting what the wonderful Ada vision for the alternative to this so-called “severe bug” are. So far the only wonderful Ada vision for a better world than the “severe bug” is to chain-migrate •all• the intended-to-be-private declarations of •all• of {Variable_Indexing, Reference, Refence_Holder, Container_Array, …} gratuitously up to a polluted public view to satisfy the gratuitous over-achievement requirement of _AARM_:2016's ¶22/3 of §4.1.6 on page 189 so that the same semantics shall be able to written in 5 different ways (when the programmer overtly considered 4 of the 5 a bad idea), which is a worse vomit of intended-to-be-private declarations into public than what the so-called “severe bug” divulged:
Find (IB,"pear").Data.all := Element'(...); -- Traditional call
IB.Find ("pear").Data.all := Element'(...); -- Call of prefixed view
IB.Find ("pear") := Element'(...); -- Implicit dereference (see 4.1.5)
IB ("pear") := Element'(...); -- Implicit indexing and dereference
IB ("pear").Data.all := Element'(...); -- Implicit indexing only
Apparently in subsequent replies the justifications for this gratuitous over-achievement requirement of mandating 5 different syntaxes of writing the same semantics (even when the programmer considers 4 of them as a bad idea) is:
1) (perceived?) effort reduction by compiler writers
and
2) syntactic-sugar features get a green-lighted free pass but software-engineering principles (e.g., Steelman requirement 3-5B) get prioritized lower, or worse, perhaps are viewed as governing Ada83-only in the dustbin of history.
next prev parent reply other threads:[~2018-07-26 21:25 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-14 14:18 Visibility of Indexing aspects Jere
2018-07-14 17:04 ` Shark8
2018-07-14 18:29 ` Jere
2018-07-14 18:41 ` Dmitry A. Kazakov
2018-07-14 23:00 ` Shark8
2018-07-14 23:28 ` Jere
2018-07-15 14:41 ` AdaMagica
2018-07-15 15:33 ` Jere
2018-07-16 3:22 ` AdaMagica
2018-07-17 0:35 ` Jere
2018-07-17 9:46 ` AdaMagica
2018-07-17 10:11 ` AdaMagica
2018-07-20 12:08 ` Jere
2018-07-20 16:11 ` AdaMagica
2018-07-20 22:03 ` Dan'l Miller
2018-07-20 22:07 ` Jere
2018-07-21 10:33 ` AdaMagica
2018-07-24 3:32 ` Randy Brukardt
2018-07-24 17:15 ` Dan'l Miller
2018-07-25 5:37 ` Randy Brukardt
2018-07-25 18:26 ` Dan'l Miller
2018-07-25 19:58 ` AdaMagica
2018-07-25 20:57 ` Dan'l Miller
2018-07-26 0:12 ` Randy Brukardt
2018-07-26 2:41 ` Dan'l Miller
2018-07-26 19:09 ` Randy Brukardt
2018-07-26 20:31 ` Shark8
2018-07-26 21:25 ` Dan'l Miller [this message]
2018-07-27 22:05 ` Randy Brukardt
2018-07-28 0:35 ` Dan'l Miller
2018-07-27 21:58 ` Randy Brukardt
2018-07-20 22:23 ` Jere
2018-07-20 22:25 ` Jere
2018-07-21 5:58 ` J-P. Rosen
-- strict thread matches above, loose matches on Subject: below --
2018-08-02 20:31 Randy Brukardt
2018-08-03 0:43 ` Dan'l Miller
2018-08-03 20:56 ` Randy Brukardt
2018-08-03 21:32 ` Dan'l Miller
2018-08-06 21:46 ` Randy Brukardt
2018-08-06 22:12 ` Dmitry A. Kazakov
2018-08-07 15:13 ` Dan'l Miller
2018-08-07 22:41 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox