This is disturbing!

classic Classic list List threaded Threaded
31 messages Options
12
Reply | Threaded
Open this post in threaded view
|

This is disturbing!

Bob Sneidar via use-livecode
Did anyone know that "6. " is equal to "6."???

THAT is disturbing! So now we have to check the length of a string as well to make sure there is an exact match???

Bob S


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
wow.  that's not cool.  I just tried "is" and yep.  is.

On Thu, Sep 6, 2018 at 11:47 AM Bob Sneidar via use-livecode <
[hidden email]> wrote:

> Did anyone know that "6. " is equal to "6."???
>
> THAT is disturbing! So now we have to check the length of a string as well
> to make sure there is an exact match???
>
> Bob S
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
It seems to only compare the integer part of the statements. If you substitute the integer with a letter, then it reports false. But still strange as the quotation marks should indicates that this is a string.

Best regards
Tore Nilsen

-------
This mail contains no viruses or bacteria as it is electronically produced and untouched by human hands. Once printed it may or may not contain various microorganisms that can cause diseases. Print and hand out at own risk. Unsolicited distribution of this mail is prohibited.







> 06. sep. 2018 kl. 17:46 skrev Bob Sneidar via use-livecode <[hidden email]>:
>
> Did anyone know that "6. " is equal to "6."???
>
> THAT is disturbing! So now we have to check the length of a string as well to make sure there is an exact match???
>
> Bob S
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
If I put anything else in place of the dot, I get a fail, but with the dot,
i get true

On Thu, Sep 6, 2018 at 11:55 AM Tore Nilsen via use-livecode <
[hidden email]> wrote:

> It seems to only compare the integer part of the statements. If you
> substitute the integer with a letter, then it reports false. But still
> strange as the quotation marks should indicates that this is a string.
>
> Best regards
> Tore Nilsen
>
> -------
> This mail contains no viruses or bacteria as it is electronically produced
> and untouched by human hands. Once printed it may or may not contain
> various microorganisms that can cause diseases. Print and hand out at own
> risk. Unsolicited distribution of this mail is prohibited.
>
>
>
>
>
>
>
> > 06. sep. 2018 kl. 17:46 skrev Bob Sneidar via use-livecode <
> [hidden email]>:
> >
> > Did anyone know that "6. " is equal to "6."???
> >
> > THAT is disturbing! So now we have to check the length of a string as
> well to make sure there is an exact match???
> >
> > Bob S
> >
> >
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
I think this is because the dot is also the decimal sign. Therefore it interprets the strings as numerical values. And = and is are synonyms.
I guess if you write something like put «6» + «6» you will get 12 as the result.

Best regards
Tore Nilsen

-------
This mail contains no viruses or bacteria as it is electronically produced and untouched by human hands. Once printed it may or may not contain various microorganisms that can cause diseases. Print and hand out at own risk. Unsolicited distribution of this mail is prohibited.







> 06. sep. 2018 kl. 17:57 skrev Mike Kerner via use-livecode <[hidden email]>:
>
> If I put anything else in place of the dot, I get a fail, but with the dot,
> i get true
>
> On Thu, Sep 6, 2018 at 11:55 AM Tore Nilsen via use-livecode <
> [hidden email]> wrote:
>
>> It seems to only compare the integer part of the statements. If you
>> substitute the integer with a letter, then it reports false. But still
>> strange as the quotation marks should indicates that this is a string.
>>
>> Best regards
>> Tore Nilsen
>>
>> -------
>> This mail contains no viruses or bacteria as it is electronically produced
>> and untouched by human hands. Once printed it may or may not contain
>> various microorganisms that can cause diseases. Print and hand out at own
>> risk. Unsolicited distribution of this mail is prohibited.
>>
>>
>>
>>
>>
>>
>>
>>> 06. sep. 2018 kl. 17:46 skrev Bob Sneidar via use-livecode <
>> [hidden email]>:
>>>
>>> Did anyone know that "6. " is equal to "6."???
>>>
>>> THAT is disturbing! So now we have to check the length of a string as
>> well to make sure there is an exact match???
>>>
>>> Bob S
>>>
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
> --
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>   and did a little diving.
> And God said, "This is good."
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
dictionary says when comparing strings we go char by char, and says that
quotes around the literal causes it to be evaluated as a string.

On Thu, Sep 6, 2018 at 11:57 AM Mike Kerner <[hidden email]>
wrote:

> If I put anything else in place of the dot, I get a fail, but with the
> dot, i get true
>
> On Thu, Sep 6, 2018 at 11:55 AM Tore Nilsen via use-livecode <
> [hidden email]> wrote:
>
>> It seems to only compare the integer part of the statements. If you
>> substitute the integer with a letter, then it reports false. But still
>> strange as the quotation marks should indicates that this is a string.
>>
>> Best regards
>> Tore Nilsen
>>
>> -------
>> This mail contains no viruses or bacteria as it is electronically
>> produced and untouched by human hands. Once printed it may or may not
>> contain various microorganisms that can cause diseases. Print and hand out
>> at own risk. Unsolicited distribution of this mail is prohibited.
>>
>>
>>
>>
>>
>>
>>
>> > 06. sep. 2018 kl. 17:46 skrev Bob Sneidar via use-livecode <
>> [hidden email]>:
>> >
>> > Did anyone know that "6. " is equal to "6."???
>> >
>> > THAT is disturbing! So now we have to check the length of a string as
>> well to make sure there is an exact match???
>> >
>> > Bob S
>> >
>> >
>> > _______________________________________________
>> > use-livecode mailing list
>> > [hidden email]
>> > Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> > http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
> --
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>    and did a little diving.
> And God said, "This is good."
>


--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
It seems as long as all characters in the string can be numerical values, they are treated as such. Space is treated as whitespace or empty. My guess for  «6» + «6» to return 12 was right.


Tore Nilsen

-------
This mail contains no viruses or bacteria as it is electronically produced and untouched by human hands. Once printed it may or may not contain various microorganisms that can cause diseases. Print and hand out at own risk. Unsolicited distribution of this mail is prohibited.







> 06. sep. 2018 kl. 18:02 skrev Tore Nilsen via use-livecode <[hidden email]>:
>
> I think this is because the dot is also the decimal sign. Therefore it interprets the strings as numerical values. And = and is are synonyms.
> I guess if you write something like put «6» + «6» you will get 12 as the result.
>
> Best regards
> Tore Nilsen
>
> -------
> This mail contains no viruses or bacteria as it is electronically produced and untouched by human hands. Once printed it may or may not contain various microorganisms that can cause diseases. Print and hand out at own risk. Unsolicited distribution of this mail is prohibited.
>
>
>
>
>
>
>
>> 06. sep. 2018 kl. 17:57 skrev Mike Kerner via use-livecode <[hidden email]>:
>>
>> If I put anything else in place of the dot, I get a fail, but with the dot,
>> i get true
>>
>> On Thu, Sep 6, 2018 at 11:55 AM Tore Nilsen via use-livecode <
>> [hidden email]> wrote:
>>
>>> It seems to only compare the integer part of the statements. If you
>>> substitute the integer with a letter, then it reports false. But still
>>> strange as the quotation marks should indicates that this is a string.
>>>
>>> Best regards
>>> Tore Nilsen
>>>
>>> -------
>>> This mail contains no viruses or bacteria as it is electronically produced
>>> and untouched by human hands. Once printed it may or may not contain
>>> various microorganisms that can cause diseases. Print and hand out at own
>>> risk. Unsolicited distribution of this mail is prohibited.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>> 06. sep. 2018 kl. 17:46 skrev Bob Sneidar via use-livecode <
>>> [hidden email]>:
>>>>
>>>> Did anyone know that "6. " is equal to "6."???
>>>>
>>>> THAT is disturbing! So now we have to check the length of a string as
>>> well to make sure there is an exact match???
>>>>
>>>> Bob S
>>>>
>>>>
>>>> _______________________________________________
>>>> use-livecode mailing list
>>>> [hidden email]
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> [hidden email]
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>>
>>
>> --
>> On the first day, God created the heavens and the Earth
>> On the second day, God created the oceans.
>> On the third day, God put the animals on hold for a few hours,
>>  and did a little diving.
>> And God said, "This is good."
>> _______________________________________________
>> use-livecode mailing list
>> [hidden email]
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
On 2018-09-06 18:02, Mike Kerner via use-livecode wrote:
> dictionary says when comparing strings we go char by char, and says
> that
> quotes around the literal causes it to be evaluated as a string.

Where in the dictionary? That should be revised.

Quotes make no difference - numbers and strings which look like numbers
are treated the same... When doing comparisons, the engine tries to
convert both sides to numbers before comparing, if both sides are
numbers they are compared as numbers.

Both '1 is 1.0' or '"1" is "1.0"' have the same result.

Warmest Regards,

Mark.

P.S. The engine has *always* worked like this - as have xTalks in
general. It's why you never have to put any explicit type conversion
anywhere when you are interchanging anything and things still work as
expected.

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
Dictionary:
First, if you look in the operands, it says
*The operands value1 and value2 can be numbers, literal strings of
characters (delimited with double quotes), or any sources of value,
including arrays.*
The example for comparing two strings is

"ABC" = "abc" -- true if and only if caseSensitive is false
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
so the description seems to imply that the comparison should be as strings
if double-quotes are included around the literals.

On Thu, Sep 6, 2018 at 12:14 PM Mike Kerner <[hidden email]>
wrote:

> Dictionary:
> First, if you look in the operands, it says
> *The operands value1 and value2 can be numbers, literal strings of
> characters (delimited with double quotes), or any sources of value,
> including arrays.*
> The example for comparing two strings is
>
> "ABC" = "abc" -- true if and only if caseSensitive is false
>
>

--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
On 09/06/2018 09:06 AM, Mark Waddingham via use-livecode wrote:

> P.S. The engine has *always* worked like this - as have xTalks in
> general. It's why you never have to put any explicit type conversion
> anywhere when you are interchanging anything and things still work as
> expected.
>

Yeah. IMO automatic type conversion is one of the failure points of the
xtalk paradigm, but it's always been thus.

--
  Mark Wieder
  [hidden email]

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
On 2018-09-06 18:14, Mike Kerner via use-livecode wrote:
> Dictionary:
> First, if you look in the operands, it says
> *The operands value1 and value2 can be numbers, literal strings of
> characters (delimited with double quotes), or any sources of value,
> including arrays.*
> The example for comparing two strings is
>
> "ABC" = "abc" -- true if and only if caseSensitive is false

To be fair, the 'is' entry it doesn't say anything about what is
interpreted 'as a string' explicitly - it just says 'literal strings of
characters (delimited by double quotes)' - however as worded it is a
little misleading.

All the comparison operator docs could do with some revision to make the
actual behavior crystal clear :D

Warmest Regards,

Mark.

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
On 2018-09-06 18:21, Mark Wieder via use-livecode wrote:
> Yeah. IMO automatic type conversion is one of the failure points of
> the xtalk paradigm, but it's always been thus.

To be fair, in the days of HyperCard when everything was strings (and
numbers were decimal strings) the rules worked absolutely fine I think.

However, the use of doubles as the internal rep for numbers, and
introduction of arrays broke a few invariants a consistent
implementation of the above view relies upon - hence the annoying points
of friction.

I don't think implicit type conversion is the problem per-se - just the
precise details of what gets converted to what, and the inability to say
'at this point, this needs to actually be a <foo>'.

If you want to be abstract about it then you can view a programming
language as a compression algorithm - it is a way to express a set of
possible outcomes in a linear sequence of text. With that point of view,
they suffer exactly the same problem as any compression algorithm
suffers - all compression algorithms will expand some input.

i.e. What you might gain in some places in terms of ease / clarity /
ability; you will lose elsewhere - the hard bit is making sure that such
cases are 'edge' cases and easily avoided.

Warmest Regards,

Mark.

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
Right.  If the explanation is clear then it's not an issue (even if it is a
little weird - "6.abc"="6.xyz" is false but "6."&CR is "6."&space is true)

On Thu, Sep 6, 2018 at 12:43 PM Mark Waddingham via use-livecode <
[hidden email]> wrote:

> On 2018-09-06 18:21, Mark Wieder via use-livecode wrote:
> > Yeah. IMO automatic type conversion is one of the failure points of
> > the xtalk paradigm, but it's always been thus.
>
> To be fair, in the days of HyperCard when everything was strings (and
> numbers were decimal strings) the rules worked absolutely fine I think.
>
> However, the use of doubles as the internal rep for numbers, and
> introduction of arrays broke a few invariants a consistent
> implementation of the above view relies upon - hence the annoying points
> of friction.
>
> I don't think implicit type conversion is the problem per-se - just the
> precise details of what gets converted to what, and the inability to say
> 'at this point, this needs to actually be a <foo>'.
>
> If you want to be abstract about it then you can view a programming
> language as a compression algorithm - it is a way to express a set of
> possible outcomes in a linear sequence of text. With that point of view,
> they suffer exactly the same problem as any compression algorithm
> suffers - all compression algorithms will expand some input.
>
> i.e. What you might gain in some places in terms of ease / clarity /
> ability; you will lose elsewhere - the hard bit is making sure that such
> cases are 'edge' cases and easily avoided.
>
> Warmest Regards,
>
> Mark.
>
> --
> Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
On 2018-09-06 18:52, Mike Kerner via use-livecode wrote:
> Right.  If the explanation is clear then it's not an issue (even if it
> is a
> little weird - "6.abc"="6.xyz" is false but "6."&CR is "6."&space is
> true)

Well the explanation can be fixed :)

Its hard to say whether the language would be better or worse if only
'strict' numeric strings were considered equal. After all you'd still
have that "1.00000" is "1" is "1.0" is ... which whilst more obvious
perhaps, still means you have to work harder to do strict string
equality checking (or comparison).

Warmest Regards,

Mark.

--
Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
On 9/6/2018 11:46 AM, Bob Sneidar via use-livecode wrote:
> Did anyone know that "6. " is equal to "6."???
>
> THAT is disturbing! So now we have to check the length of a string as well to make sure there is an exact match???
>

This is the price of having a "type-less" programming language. "6." get
evaluated to see if it is numeric, which it is an is treated as the
number 6. Likewise with "6. " and 6 does equal 6.

Now, in  typed language, you would have declared both things as STRINGs
and you would get a false.

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
Ignoring the leading or trailing whitespace is weird and counterintuitive.
If the language was more perfect, I think it would first not ignore the
other characters in the string no matter what they look like, then do the
implicit type coercion and then the comparison, even though there are
definitely use cases where 1≠1.0≠1.0000000000, but those sorts of edge
cases perhaps better left documented and not handled.
In all cases, where intuition and behavior are not in line, the manual
should fill in the gap.


On Thu, Sep 6, 2018 at 1:02 PM Mark Waddingham via use-livecode <
[hidden email]> wrote:

> On 2018-09-06 18:52, Mike Kerner via use-livecode wrote:
> > Right.  If the explanation is clear then it's not an issue (even if it
> > is a
> > little weird - "6.abc"="6.xyz" is false but "6."&CR is "6."&space is
> > true)
>
> Well the explanation can be fixed :)
>
> Its hard to say whether the language would be better or worse if only
> 'strict' numeric strings were considered equal. After all you'd still
> have that "1.00000" is "1" is "1.0" is ... which whilst more obvious
> perhaps, still means you have to work harder to do strict string
> equality checking (or comparison).
>
> Warmest Regards,
>
> Mark.
>
> --
> Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
> LiveCode: Everyone can create apps
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
By way of rehtoric, and by no means a suggestion of any change in the engine, it might have been better if "is" did a strict string comparison, while "=" or "is equal to" attempted a numerical type conversion, and reverted to a string comparison if either arguement failed.

What *might* be possible is adding support for "exactly equal to" or "==" where 1.0 == 1 is still true, but "1.0" == "1" is not.

Bob S


> On Sep 6, 2018, at 10:01 , Mark Waddingham via use-livecode <[hidden email]> wrote:
>
>> Right.  If the explanation is clear then it's not an issue (even if it is a
>> little weird - "6.abc"="6.xyz" is false but "6."&CR is "6."&space is true)
>
> Well the explanation can be fixed :)
>
> Its hard to say whether the language would be better or worse if only 'strict' numeric strings were considered equal. After all you'd still have that "1.00000" is "1" is "1.0" is ... which whilst more obvious perhaps, still means you have to work harder to do strict string equality checking (or comparison).
>
> Warmest Regards,
>
> Mark.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
In reply to this post by Bob Sneidar via use-livecode
I have come across this before .....   I think what I encountered was "" = 0

I had to do a workaround, figured it was a a decision based on other engine
factors.

I can see it being ok in 99% of cases.


On Thu, Sep 6, 2018 at 1:25 PM Mike Kerner via use-livecode <
[hidden email]> wrote:

> Ignoring the leading or trailing whitespace is weird and counterintuitive.
> If the language was more perfect, I think it would first not ignore the
> other characters in the string no matter what they look like, then do the
> implicit type coercion and then the comparison, even though there are
> definitely use cases where 1≠1.0≠1.0000000000, but those sorts of edge
> cases perhaps better left documented and not handled.
> In all cases, where intuition and behavior are not in line, the manual
> should fill in the gap.
>
>
> On Thu, Sep 6, 2018 at 1:02 PM Mark Waddingham via use-livecode <
> [hidden email]> wrote:
>
> > On 2018-09-06 18:52, Mike Kerner via use-livecode wrote:
> > > Right.  If the explanation is clear then it's not an issue (even if it
> > > is a
> > > little weird - "6.abc"="6.xyz" is false but "6."&CR is "6."&space is
> > > true)
> >
> > Well the explanation can be fixed :)
> >
> > Its hard to say whether the language would be better or worse if only
> > 'strict' numeric strings were considered equal. After all you'd still
> > have that "1.00000" is "1" is "1.0" is ... which whilst more obvious
> > perhaps, still means you have to work harder to do strict string
> > equality checking (or comparison).
> >
> > Warmest Regards,
> >
> > Mark.
> >
> > --
> > Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
> > LiveCode: Everyone can create apps
> >
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
>
>
> --
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>    and did a little diving.
> And God said, "This is good."
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: This is disturbing!

Bob Sneidar via use-livecode
I like the is vs = idea.  I disagree with Paul that this is a price of it
being typeless.  No other whitespace character in LC seems to cause this
behavior.  It's not really true that it's typeless e.g. a blob (even though
technically a blob is a type).  It's just that the typing is implied and
the coercion is also implied.

On Thu, Sep 6, 2018 at 1:52 PM Tom Glod via use-livecode <
[hidden email]> wrote:

> I have come across this before .....   I think what I encountered was "" =
> 0
>
> I had to do a workaround, figured it was a a decision based on other engine
> factors.
>
> I can see it being ok in 99% of cases.
>
>
> On Thu, Sep 6, 2018 at 1:25 PM Mike Kerner via use-livecode <
> [hidden email]> wrote:
>
> > Ignoring the leading or trailing whitespace is weird and
> counterintuitive.
> > If the language was more perfect, I think it would first not ignore the
> > other characters in the string no matter what they look like, then do the
> > implicit type coercion and then the comparison, even though there are
> > definitely use cases where 1≠1.0≠1.0000000000, but those sorts of edge
> > cases perhaps better left documented and not handled.
> > In all cases, where intuition and behavior are not in line, the manual
> > should fill in the gap.
> >
> >
> > On Thu, Sep 6, 2018 at 1:02 PM Mark Waddingham via use-livecode <
> > [hidden email]> wrote:
> >
> > > On 2018-09-06 18:52, Mike Kerner via use-livecode wrote:
> > > > Right.  If the explanation is clear then it's not an issue (even if
> it
> > > > is a
> > > > little weird - "6.abc"="6.xyz" is false but "6."&CR is "6."&space is
> > > > true)
> > >
> > > Well the explanation can be fixed :)
> > >
> > > Its hard to say whether the language would be better or worse if only
> > > 'strict' numeric strings were considered equal. After all you'd still
> > > have that "1.00000" is "1" is "1.0" is ... which whilst more obvious
> > > perhaps, still means you have to work harder to do strict string
> > > equality checking (or comparison).
> > >
> > > Warmest Regards,
> > >
> > > Mark.
> > >
> > > --
> > > Mark Waddingham ~ [hidden email] ~ http://www.livecode.com/
> > > LiveCode: Everyone can create apps
> > >
> > > _______________________________________________
> > > use-livecode mailing list
> > > [hidden email]
> > > Please visit this url to subscribe, unsubscribe and manage your
> > > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> >
> >
> > --
> > On the first day, God created the heavens and the Earth
> > On the second day, God created the oceans.
> > On the third day, God put the animals on hold for a few hours,
> >    and did a little diving.
> > And God said, "This is good."
> > _______________________________________________
> > use-livecode mailing list
> > [hidden email]
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode



--
On the first day, God created the heavens and the Earth
On the second day, God created the oceans.
On the third day, God put the animals on hold for a few hours,
   and did a little diving.
And God said, "This is good."
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
12