why is this legal?
Posted: Fri Aug 07, 2009 12:16 pm
by CarlRanson >> Tue, 19 Nov 2002 3:13:49 GMT
Hi all,
Can anyone tell me a valid reason that the following works in Jade???
JadeScript.aaa1(s : String input);begin
s[1] := 'A';
end;
JadeScript.aaa2();
vars
s : String;begin
s := 'abc';
aaa1(s);
write s; // produces Abc ????
end;
I would have thought that s[1] := 'A'; would be considered an update of the input parameter s and therefore should not be allowed.
Arent Input and Constant primitive parameters functionally the same in Jade???
CR
Hi all,
Can anyone tell me a valid reason that the following works in Jade???
JadeScript.aaa1(s : String input);begin
s[1] := 'A';
end;
JadeScript.aaa2();
vars
s : String;begin
s := 'abc';
aaa1(s);
write s; // produces Abc ????
end;
I would have thought that s[1] := 'A'; would be considered an update of the input parameter s and therefore should not be allowed.
Arent Input and Constant primitive parameters functionally the same in Jade???
CR