Forcing string comparisons, or When is "0" not 0?

Paul Dupuis paul at researchware.com
Thu Oct 15 17:17:27 EDT 2015


On 10/15/2015 3:36 PM, Peter Haworth wrote:
> There is a new operator in LC8, "is really" which may help the
> string/number comparison issue. See the LC8 dictionary for details.
The is really operator is only for types:

/value/ is really [ nothing | a boolean | an integer | a real | a string
| a binary string | an array ]

and as of LC8dp7 it is not working to well:
"0" is a string -> true
0 is a string -> true
0 is an integer -> false
0. is a string -> true
0. is a real -> false
"0." is a string -> true

The proposed "is exactly" syntax is comparing two variables (or values)
for equivalence by type and contents.

Whoever came up with the "is exactly" syntax should submit it as an
enhancement to http://quality.runrev.com/
It would be a great addition to the language.




More information about the use-livecode mailing list