views:

69

answers:

3

Hello, I was wondering. Are there languages that use only pass-by-reference as its eval strategy? Thank you.

A: 

How about Brainfuck?

Eric Mickelsen
Fine, may very well be, but you will have to provide some evidence. I don't know all languages.
Dervin Thunk
It has no functions, therefore its functions are only pass-by-reference. :-P Also, it is turing-complete.
Eric Mickelsen
+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
+1  A: 

VB (pre .net), VBA & VBS default to ByRef although it can be overriden when calling/defining the sub or function.

Alex K.