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 20:13:39 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!lon1-news.nildram.net!news-peer.gradwell.net!not-for-mail Newsgroups: comp.lang.ada From: porton@ex-code.com (Victor Porton) Date: Wed, 13 Nov 2002 07:43:07 +0500 References: <3dcbb4e4$0$299$bed64819@news.gradwell.net> Organization: Extreme Code Software (http://ex-code.com) Subject: Re: Booch: iterator invalidation Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Content-Type: text/plain; charset=us-ascii X-URL: http://www.ex-code.com/ Message-ID: <3dd1d172$0$307$bed64819@news.gradwell.net> NNTP-Posting-Date: 13 Nov 2002 04:13:38 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1037160818 news.gradwell.net 307 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:30790 Date: 2002-11-13T04:13:38+00:00 List-Id: In article , Stephen Leake writes: > 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. Yes, it is of such kind. Also it may be e.g. back references from a container to iterators for checking validity etc. >> 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. It is meant for user code to use _only_ T, not T_Internal. (In OO style T_Internal should be in private section.) All compiler implementors should consider this to ensure that they have zero space-efficiency.