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,a327d56b3d5e9a4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-12 12:29:33 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Booch: iterator invalidation Date: 12 Nov 2002 15:11:31 -0500 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <3dcbb4e4$0$299$bed64819@news.gradwell.net> <3dd14654$0$300$bed64819@news.gradwell.net> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1037132546 27374 128.183.235.92 (12 Nov 2002 20:22:26 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 12 Nov 2002 20:22:26 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:30780 Date: 2002-11-12T20:22:26+00:00 List-Id: porton@ex-code.com (Victor Porton) writes: > I'm not about asserting but about records which have or don't have > a component dependingly on whether it is the debuging version. Hmm. I've never done that for testing. Can you give a real example? What sort of "additional information" would you add? I've used "debug storage pools" that report statistics on allocations/deallocations. I guess that is a form of what you are talking about here. Part of the point of "debug stuff" is that it ideally should have _zero_ impact on the "real code". "pragma Assert" comes very close to that; the optimizer may do things differently when it is turned on, but nothing else changes. > Can variant records be used for this without lost of space > efficiency? > > type T_Internal(Debug: Boolean) is > record > -- ... > case Debug is > when True => > -- ... additional debugging stuff > when others => > null; > end case; > end record; > > type T is T_Internal(Use_Debug); -- Use_Debug is a Boolean _constant_ > > Will this not bring "additional debugging stuff" in the release > version (when Use_Debug=False)? Now everything that uses T_Internal has to specify a Debug discriminant. To intrusive for my taste. -- -- Stephe