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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,75ffc1f081ec10e3 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Newsgroups: comp.lang.ada Subject: Re: Constant record components References: <12ad8guf3sg1o0d@corp.supernews.com> <1loq7utmaxvll$.yqsxj5edzqgv.dlg@40tude.net> <12afs64kh432q0e@corp.supernews.com> <12aihj2lrjqpc3a@corp.supernews.com> From: M E Leypold Date: 04 Jul 2006 02:08:38 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Some cool user agent (SCUG) NNTP-Posting-Host: 88.72.219.12 X-Trace: news.arcor-ip.de 1151971322 88.72.219.12 (4 Jul 2006 02:02:02 +0200) X-Complaints-To: abuse@arcor-ip.de Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor-ip.de!news.arcor-ip.de!not-for-mail Xref: g2news2.google.com comp.lang.ada:5464 Date: 2006-07-04T02:08:38+02:00 List-Id: "ME" writes: > "Dmitry A. Kazakov" wrote in message > news:t7hmlpeqyass.1fjxzy2pl8z82$.dlg@40tude.net... > > On Sun, 2 Jul 2006 09:13:54 -0700, ME wrote: > > > >> "Dmitry A. Kazakov" wrote in message > >> news:1loq7utmaxvll$.yqsxj5edzqgv.dlg@40tude.net... > >>> On Sat, 1 Jul 2006 09:25:06 -0700, ME wrote: > >>> > >>>> What was the rationale for prohibiting constant record components? > >>> > >>> Initialization and composition issues. Then often it is argued that > >>> discriminants are, though limited. > > > >> What were these issues? > > > > You should ask language lawyers. Consider aggregates: > > > > type Semimutable is record > > A : constant Integer := 10; > > B : Integer; > > end record; > > > > X : Semimutable := (A => 20, B => 40); -- Constraint_Error? > > Y : Semimutable := (A => 10, B => 40); > > > > It might become tricky when A is a composite or private type. Should it > > finalize the component and initialize it *same*? In which sense same? Does > > it skip A upon assignments? > Yes, why not. Anyway , discriminants allow a type of constant component so > the mechanism is possible. If constant record fields are needed, wouldn't it be simpler to just wrap the whole initializing and assigning into a functional interface? It would als help to isolate effects of changes if you switch representation. Regards -- Markus