generic function replace<T>(var X: T; NewValue: T):T;
begin
Result := X;
X := NewValue;
end;
begin
x := someoldvalue;
y := specialize replace<TSomeType>(x, somenewvalue);
end.
no strict 'vars';
($old,$x) = ($x, $new);
use strict;
my $old;
my $new = 'new thing';
my $x = 'old thing';
($old,$x) = ($x, $new);
generic function replace<T>(var X: T; NewValue: T):T;
begin
Result := X;
X := NewValue;
end;
begin
x := someoldvalue;
y := specialize replace<TSomeType>(x, somenewvalue);
end.