Fun (was Re: Cubist's first bug report)

Dar Scott dsc at swcp.com
Mon Jun 6 01:15:26 EDT 2016


The problem is more general than the use of any and random().  It applies to functions with side effects.  

And if the compiler is allowed to combine like-looking expressions (as in your example), it should prove that there can be no side effects.  

One solution would be to allow the building of user commands that behave like 'add' and can work with chunks.  I don't think this is an easy problem, but I do think it is doable.  Again, the problems are with side effects.  

Dar

> On Jun 5, 2016, at 10:35 PM, Monte Goulding <monte at appisle.net> wrote:
> 
> 
>> On 6 Jun 2016, at 12:47 PM, Mark Wieder <mwieder at ahsoftware.net> wrote:
>> 
>> Turns out an additional note was needed to cover "any".
> 
> I am less concerned about the quirky behavior of any and random chunks considering it is easy to work around it than I am about the re-evaluation of the chunk expression which could be quite costly on large variables. If we can avoid that we should but it would also be nice to avoid doing two evaluations on something like this:
> 
>    put myFunction(item 3 of myVar) into item 3 of myVar
> 
> It would be more complicated though because you would need to compare the expressions in a statement and quite possibly slow down everything else in order to speed up the one use case.
> 
> Cheers
> 
> Monte
> _______________________________________________
> 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