by reference parameters

Alex Rice alex at mindlube.com
Wed Sep 17 12:37:01 EDT 2003


On Wednesday, September 17, 2003, at 08:28  AM, Rob Cozens wrote:
> I see two uses for referenced parameters, and one involves 
> optimization (or execution speed).
>
> From my perspective, the speed difference only comes into play when 
> the arguments are large.  For example, the record buffer in SDB is 
> ALWAYS passed by reference.

OK, thanks. I didn't think of testing large parameters. For small 
parameters the speed difference is not noticeable.

> The other reason for passing by reference is that in some designs it 
> just makes sense to have the handler update the original variable 
> directly instead of returning a value that then replaces the original.

A so called "destructive function". Harder to debug, harder to test. 
But I've done it too. :-)

Alex Rice <alex at mindlube.com> | Mindlube Software | http://mindlube.com

what a waste of thumbs that are opposable
to make machines that are disposable  -Ani DiFranco




More information about the use-livecode mailing list