comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: limited types (Was: Records that could be arrays)
Date: Fri, 24 Feb 2006 15:57:46 -0600
Date: 2006-02-24T15:57:46-06:00	[thread overview]
Message-ID: <BfCdnQZCaeilHWLenZ2dnUVZ_vmdnZ2d@megapath.net> (raw)
In-Reply-To: Xns9774B59B784EFemailenonmoc@212.27.42.197

"Thierry Bernier" <email@enon.moc> wrote in message
news:Xns9774B59B784EFemailenonmoc@212.27.42.197...
> Stephen Leake <stephe_on_the_web@toadmail.com> wrote :
>
> > If we implemented points as limited private types, we wouldn't be
>
> Please do not.limited is like the flu : a record containing a limited
field must be
> limited itself.
> For example, you can not extend a Gtk.Window.Gtk_Window_Type with an
> extension containing a limited type, or else the root of these types must
> be limited (and I don't own it).
>
> limited should be used only when the type is really limited (when using
> accesses, tasks, etc).
>
> Disagrees ?

Limited is a flu, as you put it, but it is a pretty mild flu. Indeed, in Ada
200Y, it pretty much means that you can't assign it, and that's it. You can
have aggregates and functions with suitable limitations.

Indeed, many of us think that "limited" should be the default for Ada. (It
certainly ought to be for interfaces and tagged types, because that allows
more uses.) Only if you *need* assignment should something be non-limited.

For example, your window example *should* be limited; it doesn't make sense
to assign windows. (Yes, Claw does this wrong, too, mainly because of the
limitations on the use of limited in Ada 95 that no longer apply.) That's
especially valuable because then the extensions can include any kind of
component.

Of course, you often do need assignment. The containers are non-limited so
that they can be composed. And that's because it doesn't make sense to have
limited elements (as the elements have to be copied into the container).

But in any case this is decision that needs to be made based on the use of
the type, not for philosophical reasons...

                              Randy.





  reply	other threads:[~2006-02-24 21:57 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-24 16:51 limited types (Was: Records that could be arrays) Thierry Bernier
2006-02-24 21:57 ` Randy Brukardt [this message]
2006-02-25  2:21   ` Matthew Heaney
2006-02-25  3:38     ` Matthew Heaney
2006-02-25 11:06   ` Dmitry A. Kazakov
2006-02-25 15:05     ` Matthew Heaney
2006-02-26  1:01       ` Randy Brukardt
2006-02-26  9:00       ` Dmitry A. Kazakov
2006-02-26 18:20         ` Matthew Heaney
2006-02-26 20:52           ` Dmitry A. Kazakov
2006-02-26 22:07             ` Matthew Heaney
2006-02-27  9:11               ` Dmitry A. Kazakov
2006-02-27 14:34                 ` Georg Bauhaus
2006-02-27 16:05                   ` Dmitry A. Kazakov
2006-02-27 16:52                     ` Matthew Heaney
2006-02-27 20:21                       ` Dmitry A. Kazakov
2006-02-27 21:40                         ` Georg Bauhaus
2006-02-28  9:38                           ` Dmitry A. Kazakov
2006-02-27 23:00                         ` Matthew Heaney
2006-02-28  9:39                           ` Dmitry A. Kazakov
2006-02-28 17:24                             ` Matthew Heaney
2006-02-28 19:06                               ` Dmitry A. Kazakov
2006-02-28 19:58                                 ` Matthew Heaney
2006-02-28 21:03                                   ` Dmitry A. Kazakov
2006-02-28 21:51                                   ` limited types Simon Wright
2006-03-01  1:59                                     ` Matthew Heaney
replies disabled

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