Leif Roar Moldskred said:
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