This is disturbing!

Lagi Pittas iphonelagi at gmail.com
Fri Sep 7 06:42:13 EDT 2018


Hi

We had the same "problem" in Foxpro because of the Dbase legacy.

Here is a partial list  of comparisosn with the SET EXACT <ON/OFF> switch
setting

                       OFF  ON   OFF or ON
"abc" = "abc"  Yes  Yes Yes         -- 1
"ab" = "abc"  No No No -- 2
"abc" = "ab" Yes No No -- 3
"abc" = "ab_" No No No -- 4
"ab" = "ab_" No Yes No -- 5
"ab_" = "ab" Yes Yes No -- 6
"" = "ab" No No No -- 7
"ab" = "" Yes         No        No -- 8
....... You get the picture

the reason that 7 and 8 look weird is because (I believe)
that the comparison scans the length of the operand which
 in this case is zero length, so the strings match up upto
the zeroth character

So why this list? Because without breaking any code we can have a setting -
no different to itemdelimiter
or numeric format etc like SET EXACT  on or off and the engine could do the
"right thing".

But the right thing to me is not the right thing to you, it's an edge case
and the programmer should know his data..

So here is the simplest way out of any pickle, and changes to the docs to
explain this to knew programmers ....


function EQ p1, p2
   return (space & p1 = space & p2)
end EQ

On Mouseup

   local s1, s2

   put "6." into s1
   put "6. " into s2

   answer "S1 = s2 is " &  (s1 = s2)
   answer "S1 = s2 is " &  EQ(s1 = s2)
end Mouseup



<RANT>
And why doesn't my Python Program work - oh "You have an extra space"!! If
there ever was the most stupid design decision of ANY language
that must have been indentation as part of the syntax - and the second -
Case sensitivity - because I want to Use "NAME" and "name"  to help
me differentiate Adults from children

Oh and while in Rant mode don'y get me stated on PHP ...

Case sensitive
variables, constants, array keys, class properties, class constants

Case insensitive
functions, class constructors, class methods, keywords and constructs (if,
else, null, foreach, echo etc.)

</RANT>

So count your blessings ...

Regards Lagi







On Fri, 7 Sep 2018 at 03:42, Richard Gaskin via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Mike Kerner wrote:
> > I like the is vs = idea.
>
> Me too, but I'm afraid decades of code across the entire xTalk world
> form a substantial enough legacy to render the change prohibitive.
>
> Any suggestions for a new operator token to specify numeric equivalence?
>
> --
>   Richard Gaskin
>   Fourth World Systems
>   Software Design and Development for the Desktop, Mobile, and the Web
>   ____________________________________________________________________
>   Ambassador at FourthWorld.com                http://www.FourthWorld.com
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list