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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cbd507df3efa824b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-31 13:42:01 PST Path: supernews.google.com!sn-xit-02!supernews.com!isdnet!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsxfer.eecs.umich.edu!news.bu.edu!inmet!not-for-mail From: Tucker Taft Newsgroups: comp.lang.ada Subject: Re: Help with Atomic_Components and whole array assignment Date: Wed, 31 Jan 2001 16:41:59 -0500 Organization: AverStar (formerly Intermetrics) Burlington, MA USA Message-ID: <3A7886A7.F1BB5513@averstar.com> References: <94h55t$9a1$1@nnrp1.deja.com> <94hml1$o64$1@nnrp1.deja.com> <94hno6$p8s$1@nnrp1.deja.com> <3A76E455.AABF2490@averstar.com> <958o8f$vem$1@nnrp1.deja.com> NNTP-Posting-Host: nebula.burl.averstar.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: inmet2.burl.averstar.com 980977319 2279 141.199.8.77 (31 Jan 2001 21:41:59 GMT) X-Complaints-To: usenet@inmet2.burl.averstar.com NNTP-Posting-Date: 31 Jan 2001 21:41:59 GMT X-Mailer: Mozilla 4.75 [en] (X11; U; SunOS 5.7 sun4u) X-Accept-Language: en Xref: supernews.google.com comp.lang.ada:4786 Date: 2001-01-31T21:41:59+00:00 List-Id: Rod Chapman wrote: > > In article <3A76E455.AABF2490@averstar.com>, > Tucker Taft wrote: > > > I don't agree with Robert on this. Have you tried writing it > > as a loop rather than an aggregate assignment. > > Of course, but that would usually be considered bad style in > SPARK. The assignment > A := A_Type'(others => 0); > has information flow "derives A from ;" (i.e. the final value of > A is derived from "nothing" - a constant - which is probably what > you wanted and expected) > > The compound statement > for I in A'Range loop > A(I) := 0; > end loop; > has information flow "derives A from A", which is significantly > different. I don't understand why this derives A from A. Is this just a limitation of SPARK? Clearly, we are assigning a new value to every component of A, making no use of the original values. > ... Our device driver is a fine > example of where we (justifiably) bend the rules... :-) That doesn't surprise me. Device drivers take special care. I just bemoan anything that forces one to start using machine code to write a device driver. I know that 25 years ago Unix was one of the first operating systems to have device drivers written in something other than assembly code. (I know it was not *the* first, given Multics, etc.) If 25 years later I find we have to drop back to assembly code in Ada, I would be quite disappointed, and believe we messed up the language definition somewhere. > - Rod -- -Tucker Taft stt@avercom.net http://www.averstar.com/~stt/ Chief Technology Officer, AverCom, Inc. (A Titan Company) Burlington, MA USA (AverCom was formed 1/1/01 from the Commercial Division of AverStar) (http://www.averstar.com/services/ebusiness_applications.html)