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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b30ef5c12f872cb8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.35.68 with SMTP id f4mr10986218pbj.5.1322215603514; Fri, 25 Nov 2011 02:06:43 -0800 (PST) Path: lh20ni16053pbb.0!nntp.google.com!news2.google.com!postnews.google.com!cc2g2000vbb.googlegroups.com!not-for-mail From: AdaMagica Newsgroups: comp.lang.ada Subject: Re: Why constant components are not permitted ? Date: Fri, 25 Nov 2011 02:06:43 -0800 (PST) Organization: http://groups.google.com Message-ID: <14efc07c-744c-4f9a-905b-b9e3ad353e55@cc2g2000vbb.googlegroups.com> References: <1856c00b-1994-406a-bbb3-73d93785099a@i6g2000vbe.googlegroups.com> <9j8sg4FfjuU1@mid.individual.net> NNTP-Posting-Host: 80.156.44.178 Mime-Version: 1.0 X-Trace: posting.google.com 1322215603 2191 127.0.0.1 (25 Nov 2011 10:06:43 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 25 Nov 2011 10:06:43 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: cc2g2000vbb.googlegroups.com; posting-host=80.156.44.178; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESRCNK X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0,gzip(gfe) Xref: news2.google.com comp.lang.ada:14640 Content-Type: text/plain; charset=ISO-8859-1 Date: 2011-11-25T02:06:43-08:00 List-Id: Useful applications for constant components could be (this is what you can have in C++): record -- *not* Ada Name: constant String := "James Bond"; Id : constant Positive := 007; -- e.g employee number of a company other variable components end record; In Ada, you hide the components (private record), define a constructor function providing the values for the constant items and provide only read operations for them.