From: AdaMagica <christ-usch.grein@t-online.de>
Subject: Re: How many Ada compiler bugs are here?
Date: Fri, 13 Jan 2012 02:52:29 -0800 (PST)
Date: 2012-01-13T02:52:29-08:00 [thread overview]
Message-ID: <7610c0ee-db98-4530-afab-f29e187ee7d0@h3g2000yqe.googlegroups.com> (raw)
In-Reply-To: 15d37z3l8zllg$.3z2pj9cy5kvq.dlg@40tude.net
> >>> Of course this is legal since it's in the scope of the full view (it's
> >>> a definite type in the full view, an indefinite only in the partial
> >>> view).
>
> >> Only if you have that full view in the function body.
>
> > What do you want to say? Isn't that exactly what I said?
>
> package P is
> type T (<>) is private;
> private
> type T is new Integer;
> end P;
That's a severe design mistake. You cannot declare objects of T -
there are no constructors.
> with P; use P;
> package Q is
> function Foo return T;
> end Q;
You have to declare constructors in P (I know you know that, so why do
you write such nonsense?).
PS: I know that Foo in your terminology is not a constructor.
> package body Q is
> function Foo return T is
> begin
> raise Constraint_Error;
> return Dummy : T; -- No, that won't work!
So what? Yeah, that's not in the scope of the full view.
> end Foo;
> end Q;
>
> The requirement to have a meaningless return might turn to be a serious
> trouble. The example above might look constructed, but things like this
> happen relatively frequently in large projects. And when they do, it forces
> interfaces and package hierarchies reworked. Nasty thing.
Well, yes, design errors happen. Everyone knows that...
But this example is a silly mistake. You know that.
next prev parent reply other threads:[~2012-01-13 10:58 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-12 23:20 How many Ada compiler bugs are here? Maciej Sobczak
2012-01-13 0:21 ` Randy Brukardt
2012-01-13 1:26 ` Adam Beneschan
2012-01-13 8:23 ` Dmitry A. Kazakov
2012-01-13 8:47 ` AdaMagica
2012-01-13 9:07 ` Dmitry A. Kazakov
2012-01-13 9:35 ` AdaMagica
2012-01-13 10:00 ` Dmitry A. Kazakov
2012-01-13 10:38 ` georg bauhaus
2012-01-13 11:39 ` Dmitry A. Kazakov
2012-01-13 12:43 ` Georg Bauhaus
2012-01-13 13:06 ` AdaMagica
2012-01-13 13:16 ` AdaMagica
2012-01-13 13:22 ` Georg Bauhaus
2012-01-13 13:29 ` Dmitry A. Kazakov
2012-01-13 10:52 ` AdaMagica [this message]
2012-01-13 11:35 ` Dmitry A. Kazakov
2012-01-13 12:58 ` AdaMagica
2012-01-13 13:43 ` Dmitry A. Kazakov
2012-01-13 15:06 ` Robert A Duff
2012-01-13 15:46 ` Dmitry A. Kazakov
2012-01-13 17:42 ` georg bauhaus
2012-01-13 18:52 ` Dmitry A. Kazakov
2012-01-14 0:26 ` Randy Brukardt
2012-01-14 9:49 ` Dmitry A. Kazakov
2012-01-19 1:35 ` Randy Brukardt
2012-01-19 10:33 ` Dmitry A. Kazakov
2012-01-14 2:41 ` Robert A Duff
2012-01-13 17:23 ` Adam Beneschan
2012-01-14 2:41 ` Robert A Duff
2012-01-13 17:15 ` Adam Beneschan
2012-01-13 20:06 ` Blady
2012-01-13 23:30 ` Adam Beneschan
2012-01-14 13:29 ` Brian Drummond
2012-01-19 1:47 ` Randy Brukardt
2012-01-19 4:24 ` Adam Beneschan
2012-01-20 0:04 ` Randy Brukardt
2012-01-14 10:20 ` Maciej Sobczak
2012-01-14 14:03 ` Brian Drummond
2012-01-16 16:35 ` Adam Beneschan
2012-01-20 10:43 ` Brian Drummond
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox