From bug-request at octave dot org Fri Apr 14 10:26:21 2006 Subject: Re: strcmpi doesn't check input types From: =?ISO-8859-1?Q?S=F8ren?= Hauberg To: Bill Denney Cc: bugs at octave dot org Date: Fri, 14 Apr 2006 17:24:47 +0200 fre, 14 04 2006 kl. 11:15 -0400, skrev Bill Denney: > On Fri, 14 Apr 2006, John W. Eaton wrote: > > > I agree that the current behavior is not right, but an error would > > make the behavior of strcmpi different from strcmp, so I think it > > should just return 0 if the arguments are not the right type. > > I would view that as a silent failure. I, as a user, assume that if I > don't see an error that I have done things correctly. If I give strcmp a > double and a char, I'd prefer to be told of that. I'd say that instead of > returning 0 like strcmp, strcmp should be changed to give an error. I agree. > What case(s) would be better with a returned 0 instead of an error? Matlab compatibility is the issue. From the matlab documentation: strcmp is intended for comparison of character data. When used to compare numeric data, strcmp returns logical 0. > Bill Søren ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------