Hello, I was wondering. Are there languages that use only pass-by-reference as its eval strategy? Thank you.
Fine, may very well be, but you will have to provide some evidence. I don't know all languages.
Dervin Thunk
2010-05-26 15:15:59
It has no functions, therefore its functions are only pass-by-reference. :-P Also, it is turing-complete.
Eric Mickelsen
2010-05-26 15:17:14
+2
A:
I don't know what an "eval strategy" is, but Perl subroutine calls are pass-by-reference only.
sub change {
$_[0] = 10;
}
$x = 5;
change($x);
print $x; # prints "10"
change(0); # raises "Modification of a read-only value attempted" error
Sean
2010-05-26 15:14:58
+1
A:
VB (pre .net), VBA & VBS default to ByRef although it can be overriden when calling/defining the sub or function.
Alex K.
2010-05-26 15:18:56