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,96ae138aab3beb03 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-31 08:52:18 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!dfw-service2.ext.raytheon.com.POSTED!not-for-mail Message-ID: <3CF79BFF.B3CD0E9F@raytheon.com> From: Mark Johnson X-Mailer: Mozilla 4.76 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Localized Variable Declaration References: <3CF77998.9040806@yahoo.com> <3CF77CDA.3090805@yahoo.com> <3CF78D3D.3030400@yahoo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 31 May 2002 10:51:27 -0500 NNTP-Posting-Host: 192.27.48.39 X-Complaints-To: news@ext.ray.com X-Trace: dfw-service2.ext.raytheon.com 1022860338 192.27.48.39 (Fri, 31 May 2002 10:52:18 CDT) NNTP-Posting-Date: Fri, 31 May 2002 10:52:18 CDT Organization: Raytheon Company Xref: archiver1.google.com comp.lang.ada:25090 Date: 2002-05-31T10:51:27-05:00 List-Id: "martin.m.dowie" wrote: > > "David Rasmussen" wrote in message > news:3CF78D3D.3030400@yahoo.com... > > int whatever(int foo) > > { > > ... > > ... > > { // local scope starts here > > int local = 42; > > .... > > } // and ends here > > ... > > } > > now you have 3 lines not 1! ;-) > [I noticed the smiley, but really...] If you really care that this counts as three lines of code instead of one you need to get a better line of code counter. It doesn't even have to be very exotic - one of the simplest (and best?) ones I have seen for C merely counts lines that have more than two non comment, non-white space characters in it. It is about a page of code (mostly to count lines by function) and would still count this example as one line. For Ada, you could change that from two characters to two tokens (so you ignore null;) to get the same effect. [and no - I don't want to get into a flame war about how to count lines (or statements) of code :-)] --Mark