[Gambas-user] string operator ==

Caveat Gambas at ...1950...
Wed Nov 10 13:38:56 CET 2010


Thanks for the (as usual) speedy reply Benoit.

You are right that the == operator is not often used.  I have just
double-checked that the = operator does work as intended (phew!).  My
only fear is that I may have introduced an == somewhere, purely out of
habit as a java programmer.

I'll hold off on shipping anything out of the current 2.19 I have, to be
on the safe side. :-)

Just out of curiosity, is there a difference between = and == when
working with strings?
In java, = is an assignment and == means "are these 2 things the same
object?".  If you want to compare strings, you have to use the ugly and
ungainly "some string".equals("some other string") method, which breaks
horribly if your string is null... ho hum!

Regards,
Caveat

On Wed, 2010-11-10 at 13:04 +0100, Benoît Minisini wrote:
> > Am I missing something here?  This would seem to me to be a fairly
> > critical bug.
> > 
> > I'm running v2.19 here as provided by my distro (Ubuntu 10.04 64-bit)
> > and am also seeing the "turned around" logic giving what seems like
> > wrong results for all equality string comparisons.
> > 
> > Can we expect an update to the version(s) in the respositor(y)(ies),
> > considering the seriousness of this bug?
> > 
> > Do we know since when this has been broken?  I'd hate to think I'd
> > shipped any software based on Gambas that includes this bug (although I
> > have a feeling even the most rudimentary tests would have picked this
> > up... I hope!)
> > 
> > Thanks and regards,
> > Caveat
> > 
> 
> I will release a 2.22 version soon. Hopefully, this operator is rarely used!
> 






More information about the User mailing list