A string doesn't equal itself
Bill Marriott
wjm at wjm.org
Thu Apr 12 14:58:55 EDT 2007
Richard,
What about
put "3.141592653589793238461" is "3.141592653589793238462"
Guess what Rev says? (True.) Longstanding behavior in xTalk, going back to
HyperCard days.
but
put "3.141592653589793238461" & null is "3.141592653589793238462" & null
returns false.
Seems like the "best practice" right now is: to coerce string-based
evaluation over possible numeric evaluation, use the & null operation.
> I can understand attempting to coerce to numbers if two string literals
> have an arithmetic operator between them, e.g.:
>
> "5" + "5"
>
> ...but if quoted and merely checking for equivalence, offhand I can think
> of no case where these wouldn't be true:
>
> "5" is "5"
>
> "55e555" is "55e555"
>
> "a" = "a"
More information about the use-livecode
mailing list