Making the move...

Mark Smith mark at maseurope.net
Mon Mar 20 22:01:45 EST 2006


I think the point is that when a variable is passed to a function/ 
handler 'normally', the data in it is duplicated, and if the data is  
big, this is not as efficient as passing it by reference - obviously,  
if you need to change the data in the called function/handler, this  
may have unwanted side-effects, in  which case passing it normally is  
going to be better.

Mark


On 21 Mar 2006, at 02:20, Sarah Reichelt wrote:

> On 3/21/06, Rob Cozens <rcozens at pon.net> wrote:
>>
>> G'day Sarah,
>>
>>> In my experience, it's probably due to never passing values by
>>> reference.
>>
>> I'm curious as to why you eschew passing by reference.
>>
>> If one needs to pass large variables, why incur the overhead of
>> duplicating the value of the variable before passing it?  And if a
>> variable value needed at one level is derived from a routine nested
>> several calls deep, simply passing the variable by reference through
>> the nested calls is the simplest way to get the value back to the
>> original caller.
>>
>
> It's not a philosophy, more ignorance :-)
>
> I haven't ever really tested it and I have an instinctive feeling that
> functions should be self-sufficient and shouldn't change anything
> outside them. Maybe it will suit me better in some circumstances.
>
> Cheers,
> Sarah
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list