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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ed4a5cc4016f9101 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!q75g2000hsh.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Default value for a record component Date: Tue, 24 Jul 2007 02:54:17 -0700 Organization: http://groups.google.com Message-ID: <1185270857.459100.34770@q75g2000hsh.googlegroups.com> References: <1185052757.500324.16860@22g2000hsm.googlegroups.com> NNTP-Posting-Host: 137.138.37.241 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1185270857 4190 127.0.0.1 (24 Jul 2007 09:54:17 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 24 Jul 2007 09:54:17 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20070601 Red Hat/1.5.0.12-0.1.slc3 Firefox/1.5.0.12,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: q75g2000hsh.googlegroups.com; posting-host=137.138.37.241; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news1.google.com comp.lang.ada:16586 Date: 2007-07-24T02:54:17-07:00 List-Id: On 24 Lip, 03:27, "Randy Brukardt" 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/