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

Monte Goulding monte at appisle.net
Mon Jun 6 01:33:20 EDT 2016


> On 6 Jun 2016, at 3:15 PM, Dar Scott <dsc at swcp.com> wrote:
> 
> 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.  

Hmm… certainly an interesting idea:

put 1,2,3 into tVar
myAdd 5, item 3 of tVar

command myAdd pToAdd, @xAddTo
   put pToAdd+xAddTo into xAddTo
end myAdd

tVar = 1,2,8

I doubt we should get our hopes up Dar ;-)

Of course if we can do that it means ruling out what I was suggesting as the chunk could mutate from one reference to the next. The case of a command mutating a single chunk is much simpler as it’s just a case of retaining the evaluation.

Cheers

Monte


More information about the use-livecode mailing list