comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Default value for a record component
Date: Tue, 24 Jul 2007 02:54:17 -0700
Date: 2007-07-24T02:54:17-07:00	[thread overview]
Message-ID: <1185270857.459100.34770@q75g2000hsh.googlegroups.com> (raw)
In-Reply-To: <f83kdj$sbq$1@jacob-sparre.dk>

On 24 Lip, 03:27, "Randy Brukardt" <ra...@rrsoftware.com> wrote:

> This is a rather stupid question, especially given the C++ example that you
> give later. The closest analog to a C++ class in Ada is a controlled type.

What is the analog of C++ struct with a constructor, then?

> Hinestly, I don't see any sane reason for being unwilling to use a
> controlled type here.

Honestly, me neither. The question is really about the language design
and its ability to express orthogonal concepts. For me field
visibility and its initialization are orthogonal. Well, should be.

This question and my motivation for asking it has absolutely nothing
to do with how I design the actual software, so I take the liberty not
to answer the other parts of your post (the ones with "stupid",
"silly" and "hammer"), which are not really relevant to what I'm
asking.

> In any case, having a type that is visible rather than a private type is
> almost always a mistake.

Can't you think about examples where it isn't? (the "almost always"
part has to be complemented by something)

--
Maciej Sobczak
http://www.msobczak.com/




  reply	other threads:[~2007-07-24  9:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-21 21:19 Default value for a record component Maciej Sobczak
2007-07-22  8:08 ` Dmitry A. Kazakov
2007-07-22 19:44   ` Maciej Sobczak
2007-07-22 21:44     ` Robert A Duff
2007-07-23 19:17       ` Maciej Sobczak
2007-07-23 19:41         ` Dmitry A. Kazakov
2007-07-22 20:01   ` Jeffrey R. Carter
2007-07-24  1:27 ` Randy Brukardt
2007-07-24  9:54   ` Maciej Sobczak [this message]
2007-07-24 19:12     ` 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