[TAO] value() to obtain pointer functionality

Mike Kerner MikeKerner at roadrunner.com
Mon Aug 4 00:21:50 EDT 2014


The problem we have with arrays is that they don't let us really use
indirection, i.e. pointers/handles.  It's a lot easier to write generic
handlers for a screen full of controls with pointers/handles.  "DO" is ok,
but it's the same problem we've always had with "DO", namely it's slow.
 It's very, very flexible, but it's slow.

I can also understand the newbie saying "but I can actually read and
understand that code" (meaning, code that uses "do").  Indirection,
references, recursion, etc. definitely can all make code harder to read
and/or follow, and so it has to be documented well, and heavily.

I am pleased that half of my DO's can come out, thanks to being able to
evaluate expressions to indirectly obtain values.  Now, if I could go the
other way, too, it would be even better.


On Sun, Aug 3, 2014 at 10:26 PM, Richard Gaskin <ambassador at fourthworld.com>
wrote:

> Mike Kerner wrote:
>
>  And this won't be truly great until I can
>>
>> put "y" into x
>> put 1 into value(x)
>>
>> because I can use this to get values but not set them, so I'm still stuck
>> with
>>
>> do "put 1 into"&&x
>>
>
> I'm all for inventing radical new programming paradigms, and maybe Open
> Language may help with some of this, but what you have there is a common
> need addressed through a different pattern:
>
> In essence it's a name-value pair, and whenever you have a set of
> name-value pair in which the names can't be known in advance one of the
> most common solutions is an associative array, which LC handles well:
>
>   put 1 into tArray[x]
>
>
> --
>  Richard Gaskin
>  Fourth World Systems
>  Software Design and Development for Desktop, Mobile, and 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
>



-- 
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."



More information about the use-livecode mailing list