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 Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!bcklog1.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Fri, 07 Jul 2006 16:03:28 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <12ad8guf3sg1o0d@corp.supernews.com> <1loq7utmaxvll$.yqsxj5edzqgv.dlg@40tude.net> <12afs64kh432q0e@corp.supernews.com> <12aihj2lrjqpc3a@corp.supernews.com> <7bednaJHX_FTMDTZnZ2dnUVZ_uudnZ2d@megapath.net> <12ak5urrrj6d756@corp.supernews.com> <12arsrtbe8flpf8@corp.supernews.com> Subject: Re: Constant record components Date: Fri, 7 Jul 2006 16:04:13 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-BObd3CXVVGibFMCRrkWX8fQcOqr4rymVGU/FSFiZ/0EqN4gj/gUf3nPeyy2BJGpvNUot5oK6iQcSrGi!GcKZN3esYxYe2I3NTD4gn7Qps4+YQb2NAgw8gE/b1anG11GF1mdWbN0GCrWnwlDjAVb799XknM+8!zOET6qdYHDHk/Q== X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:5560 Date: 2006-07-07T16:04:13-05:00 List-Id: "ME" wrote in message news:12arsrtbe8flpf8@corp.supernews.com... > What I am looking for is a way to read in a values from a file ,assign them > once to records and disallow any future assignment i.e. these "constant > parts of the records represent a structure that I don't want to ever change > during the life of the program (write once and read only afterwards). It > would be similar to a constant declaration but inside of a record. I don't > think that it is disgusting at all. The problem with that is that the Initialize routine is just an ordinary subprogram. That means that either constant components can't be initialized with them (only directly when the object is created), or you have to have some rule like "they're read-write in the body", which is what is disgusting. And remember that Initialize isn't the only routine of this type; user-defined Read and Input routines also need this property. There are also issues on complete record assignment of objects with constant components: what happens if one of the constant components changes? If it doesn't change (raises Constraint_Error), then you have a discriminant (effectively); if it does change, then how constant is it?? There may in fact be a solution to these issues, but it has never seemed important enough to spend the intensive effort needed to find one. Randy.