#202405 - 2011-06-03 10:24 AM
Re: Bug when checking equality with 0
[Re: Richard H.]
|
It_took_my_meds
Hey THIS is FUN
   
Registered: 2003-05-07
Posts: 273
Loc: Sydney, Australia
|
Yes yes I agree all that you said and am very accustomed to KiXtart's automatic casting. To answer your questions, $a = "123", $b = 15 and $b= "1" (And yes I have experience with many other languages). Automatic casting is not an issue, it's how equalities are checked that seems odd. 0 should equal "0" but IMHO, when a number is being compared to a string both should be converted to the data type that retains the most information (i.e. String). Yes, we can code around it and I wouldn't wish Ruud to change anything if it made KiXtart less efficient or broke older scripts (which it may well do).
At the least this discussion may have highlighted an idiosyncrasy of KiXtart that people should be aware of. Ruud may wish to consider the data type of both sides of the equality when evaluating if he thinks it is a good idea.
|
Top
|
|
|
|
Moderator: ShaneEP, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Ruud van Velsen, Mart
|
0 registered
and 676 anonymous users online.
|
|
|