valueDiff for arrays?

Mark Waddingham mark at livecode.com
Wed Aug 8 19:16:58 EDT 2018


On 2018-08-08 23:19, Mark Wieder via use-livecode wrote:
> On 08/08/2018 10:54 AM, Mark Waddingham via use-livecode wrote:
>> Yup - but isSequence would be correct - false.
>> 
>> The extents might be 1,10
>> 
>> But isSequence would check whether it was 1,9 ...
> 
> Ah. OK, but I was actually replying to Dick Kriesel's isSequence
> function, which incorrectly would reply true. I'm not familiar with
> any other isSequence function. Do you have a reference for that?

Haha - okay yes - I must confess I missed one very important line in 
your 'test' handler:

    put "false" into sArray[pi]

This actually means there is a bug in the engine 'extents()' function 
(the lower-level routines the engine uses to check for Sequences / 
NumericSequences are correct as they use an optimized form, as they 
don't require generation of the extents).

Specially, the extents function is parsing the array key (item list - 
extents can act on multi-dimensional arrays) as numbers, not as 
integers. Therefore it is erroneously returning a set of extents for an 
array which contains a non-integer key.

So - Dick's function is correct, it is the extents function which is 
currently incorrect.

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps





More information about the use-livecode mailing list