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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,56131a5c3acc678e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-08 20:52:33 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!newsfeeds-atl2!c03.atl99!news.webusenet.com!diablo.voicenet.com!cycny01.gnilink.net!cyclone1.gnilink.net!spamkiller2.gnilink.net!nwrdny01.gnilink.net.POSTED!0e8a908a!not-for-mail From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Question about OO programming in Ada References: <5JmdnUF_9o_ABE-iRTvUrg@rapidnet.com> <1070926760.852068@master.nyc.kbcfp.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Tue, 09 Dec 2003 04:52:31 GMT NNTP-Posting-Host: 162.83.232.160 X-Complaints-To: abuse@verizon.net X-Trace: nwrdny01.gnilink.net 1070945551 162.83.232.160 (Mon, 08 Dec 2003 23:52:31 EST) NNTP-Posting-Date: Mon, 08 Dec 2003 23:52:31 EST Xref: archiver1.google.com comp.lang.ada:3257 Date: 2003-12-09T04:52:31+00:00 List-Id: Chad Bremmon wrote: > The state of the boolean is not kept in a variable. The code I wrote > actually changes the register to turn the light on and off. A boolean > is not necessary to keep track of the light. Either the damn light is > on or off. I quote from your article: type Object is tagged record Address : System.Address; Mask : Opsys.Unsignedshort; Is_On : Boolean := False; end record; procedure Turn_Off (This : in out Object) is Register : Opsys.Unsignedshort; for Register'Address use This.Address; begin if This.Is_On then Register := Register xor This.Mask; end if; end Turn_Off; procedure Turn_On (This : in out Object) is Register : Opsys.Unsignedshort; for Register'Address use This.Address; begin if not This.Is_On then Register := Register xor This.Mask; end if; end Turn_On; What changes Is_On?