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.59.229 with SMTP id c5mr11010219pbr.6.1322216218443; Fri, 25 Nov 2011 02:16:58 -0800 (PST) Path: lh20ni16079pbb.0!nntp.google.com!news2.google.com!postnews.google.com!o5g2000yqa.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:16:58 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <1856c00b-1994-406a-bbb3-73d93785099a@i6g2000vbe.googlegroups.com> <9j8sg4FfjuU1@mid.individual.net> <14efc07c-744c-4f9a-905b-b9e3ad353e55@cc2g2000vbb.googlegroups.com> NNTP-Posting-Host: 80.156.44.178 Mime-Version: 1.0 X-Trace: posting.google.com 1322216218 8590 127.0.0.1 (25 Nov 2011 10:16:58 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 25 Nov 2011 10:16:58 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: o5g2000yqa.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:14642 Content-Type: text/plain; charset=ISO-8859-1 Date: 2011-11-25T02:16:58-08:00 List-Id: > 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. Then you are safe against inadvertant component changes by the client, but inside, where you have full visibility, you can inadvertantly change components which should be constants.