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: f43e6,ea99940253996e3e X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,ea99940253996e3e X-Google-Attributes: gid103376,public X-Google-Thread: 109fba,ea99940253996e3e X-Google-Attributes: gid109fba,public X-Google-Thread: 108717,ea99940253996e3e X-Google-Attributes: gid108717,public X-Google-ArrivalTime: 2003-10-04 12:07:15 PST Path: archiver1.google.com!news2.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: "Jakob Bieling" Newsgroups: comp.software-eng,comp.programming,comp.lang.c++,comp.lang.ada Subject: Re: Spell-checking source code (Was: ISO Studies of underscores...) Date: Sat, 4 Oct 2003 21:06:16 +0200 Organization: T-Online Message-ID: References: <2cfd1a4e.0309252032.3e3c0a1a@posting.google.com> <863cefjy6l.fsf@strudel.futureapps.de> <86ad8i7d1d.fsf_-_@huldreheim.huldreskog.no> <86zngh5oct.fsf@huldreheim.huldreskog.no> <86r81s6elg.fsf@huldreheim.huldreskog.no> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.t-online.com 1065294335 00 29582 z7ctVOOXSlA2Vu 031004 19:05:35 X-Complaints-To: usenet-abuse@t-online.de X-ID: Vfy-beZfoecZb1nrMmxWuqh3KEGHZFeTKFw79u44eEDj1WljmgMqUG X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Xref: archiver1.google.com comp.software-eng:56 comp.programming:356 comp.lang.c++:861 comp.lang.ada:229 Date: 2003-10-04T21:06:16+02:00 List-Id: "Leif Roar Moldskred" wrote in message news:86r81s6elg.fsf@huldreheim.huldreskog.no... > "Jakob Bieling" writes: > > > But it is that kind of word-matching I would personally like to see in > > more compilers (specifically C++ compilers). > > > > I do agree with Kevin Morenski (news:3f7df3af_2@nntp2.nac.net) that a > > real spell-checker for source code is not practicable. You said that the > > spell-checker would just have to ask you whether to ignore it or how else to > > proceed. Have you thought about how annoying 100s or even 1000s of those > > messages boxes, asking how to proceed, will be when compiling already > > existing source with this spell-checker? > > Oh, I wouldn't want it to be part of the compiler, or continiously on. Rather, > I'd just want to be able to run a command in my editor to spell-check the > source-code I'm currently working on - much like I today invoke ispell in > emacs for regular text files. Ah, I did not consider this difference even. *g* My point was, checking my own identifier names for spelling errors based on natural language rules is a bad idea. Instead, a special code-spell-checker would be great: a/ 'Created' identifiers are automatically added to the list of known words (for the current compilation run only) b/ When an identifier is used, but not found, the spell-checker tries to find out what I meant (like any spell-checker) c/ Comments are spell-checked like in any other word processor, except that identifier names should also be considered So let us assume we have this (rather useless) piece of C++ code: 1 int main () 2 { 3 char* pRok = new char; 4 *pork = 'p'; 5 delete pRok; // do not forget t delete pRok! 6 } In line 3, the spell-checker should not question the identifier name and try to tell me that I meant 'pork' (see a/ above). Instead, it should tell me in line 4 that I most probably meant 'pRok' and not 'pork' (see b/ above). And last but not least, in line 5, the spell-checker should point out the missing 'o' (ie. ".. forget to ..") but leave 'pRok' undiagnosed. regards -- jb (replace y with x if you want to reply by e-mail)