MEL argument as reference


#1

Hello guys, i always thought MEL procedures doesnt reference arguments, but now i stumbled about this:

proc test(float $a[])
{
	$a = {($a[0] * 2),($a[1] * 2),($a[2] * 2)};
};

{
	float $var[] = {1,2,3};
	print $var;
	test($var);
	print $var;
};
1
2
3
4
5
6

is this a bug or by design?


#2

Arrays are referenced, scalar variables are copied. So, yes by design.