Arrays in LC [was: Re: [TAO] value() to obtain pointer functionality]

Peter Haworth pete at lcsql.com
Wed Aug 20 12:55:22 EDT 2014


Forgot to say that I'm not sure I see the need for indexed arrays. Then
again, I'm also not sure I understand the difference.

If it's just that deleting a key shuffles all the other keys up, it's
pretty trivial to do that in a script as is inserting a new key and
shuffling the other keys down.  I have standard handlers that do that in a
few lines.

It seems that folks are somewhat confused about how to use one type of
array so adding another would probably just increase that confusion, but if
there are other benefits other than the key shuffling I guess it might be
worthwhile.

Pete
lcSQL Software <http://www.lcsql.com>
Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>


On Wed, Aug 20, 2014 at 9:33 AM, Peter Haworth <pete at lcsql.com> wrote:

> I wouldn't be in favor of using {}.  Problem is that LC currently accepts
> those characters as delimiters for the keys of an array.  I don't use them
> on purpose but every now and again I notice I typed one by mistake.  Seems
> like a backwards compatibility problem.
>
> Pete
> lcSQL Software <http://www.lcsql.com>
> Home of lcStackBrowser <http://www.lcsql.com/lcstackbrowser.html> and
> SQLiteAdmin <http://www.lcsql.com/sqliteadmin.html>
>
>
> On Wed, Aug 20, 2014 at 8:23 AM, <jbv at souslelogo.com> wrote:
>
>> I was thinking :
>> set the indexedarray of myArray to true
>> set the indexedarray of myArray to false
>>
>> but then what happens when you switch that property from true
>> to false for the same array within a handler ?
>>
>> Same question for "{}" notation : what happens when the same
>> handler contains these 2 successive lines :
>>   add 1 to myArray{10}
>>   add 1 to myArray[10]
>>
>> Best
>> jbv
>>
>> > How about using {} instead of []?
>> >
>> > Bob S
>> >
>> >
>> > On Aug 20, 2014, at 07:24 , Richard Gaskin
>> > <ambassador at fourthworld.com<mailto:ambassador at fourthworld.com>> wrote:
>> >
>> > So if we were to propose that LiveCode add indexed arrays, the first
>> thing
>> > we'll want to do is come up with the syntax for specifying those when
>> > those are what we want, ideally allowing all other usage to continue
>> using
>> > associative arrays as they have all these years.
>> >
>> > Suggestions on what that syntax should look like?
>> >
>>
>>
>> _______________________________________________
>> 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