Re: pattern equality test?
From: Michael Mendelsohn (keine.Werbung.1300_at_michael.mendelsohn.de)
Date: 03/19/04
- Next message: Ben Alan Lichter: "My programs always become evil"
- Previous message: Albert Hofkamp: "Re: FDC Controller"
- In reply to: Arthur J. O'Dwyer: "Re: pattern equality test?"
- Next in thread: Arthur J. O'Dwyer: "Re: pattern equality test?"
- Reply: Arthur J. O'Dwyer: "Re: pattern equality test?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 19 Mar 2004 09:40:54 +0100
"Arthur J. O'Dwyer" schrieb:
> > after all it's supposed to be neither language nor OS-specific, and some
> > C code that gets posted is pretty language specific (using array index
> > -1, for example)...
>
> That's not specific to C -- it's not even part of C! :)
Compiles & works, though.
> If I'd just dumped two pages of C code on the newsgroup, instead of
> my algorithm in English, you wouldn't have needed me to clarify what I
> meant by two prefixes' "matching," for example.
Yes, either I'd have taken the extra time to read the code, or I
wouldn't have cared.
I would have consulted a C manual to clarify e.g. this:
int prefixMatch(char* patt1, char* patt2)
{
while ( *patt1 == *patt2 && *patt1++ ) patt2++;
return ( *patt1=='*' || *patt2=='*' || !*patt1 || !*patt2 );
}
Oh, and if I write a comment to show what it does, then I can as well
write the comment without the code and not need to clarify. :)
I'm sure you wouldn't write code like this.
Michael
-- Feel the stare of my burning hamster and stop smoking!
- Next message: Ben Alan Lichter: "My programs always become evil"
- Previous message: Albert Hofkamp: "Re: FDC Controller"
- In reply to: Arthur J. O'Dwyer: "Re: pattern equality test?"
- Next in thread: Arthur J. O'Dwyer: "Re: pattern equality test?"
- Reply: Arthur J. O'Dwyer: "Re: pattern equality test?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|