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 10:20:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!news-peer.gradwell.net!not-for-mail Newsgroups: comp.lang.ada From: porton@ex-code.com (Victor Porton) Date: Tue, 12 Nov 2002 22:42: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: <3dd14654$0$300$bed64819@news.gradwell.net> NNTP-Posting-Date: 12 Nov 2002 18:20:04 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1037125204 news.gradwell.net 300 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:30771 Date: 2002-11-12T18:20:04+00:00 List-Id: In article , Stephen Leake writes: > Simon Wright writes: > >> > It also would be great to have the debug version of Booch, checking >> > validity of iterators and raising an exception. With GNAT it can be >> > done as in C by #ifdef/#endif preprocessor directives (assigning a >> > long (may be 64, 128, or 256 bytes) counter incrementing on each >> > invalidation to each container and analogous counters to iterators >> > and comparing these counters). >> > I believe "pragma Assert" is supported by all major Ada compilers at > this time; that could be used to give a good "debug version". I'm not about asserting but about records which have or don't have a component dependingly on whether it is the debuging version. 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)?