diff options
Diffstat (limited to 'ruby/call_by_reference.rb')
-rwxr-xr-x | ruby/call_by_reference.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ruby/call_by_reference.rb b/ruby/call_by_reference.rb new file mode 100755 index 0000000..12dc933 --- /dev/null +++ b/ruby/call_by_reference.rb @@ -0,0 +1,14 @@ +#!/usr/bin/env ruby + + +def fun w + w << "x" +end + + +w = [1,3,4,5] + +fun w + +puts w.to_s + |