Skip to content

Instantly share code, notes, and snippets.

@freshtonic
Created April 21, 2009 13:47
Show Gist options
  • Save freshtonic/99146 to your computer and use it in GitHub Desktop.
Save freshtonic/99146 to your computer and use it in GitHub Desktop.
def foo(bar)
# CHALLENGE: write the body of this method such that
# when it is invoked, the second call to 'puts' below
# prints something different that the first call to 'puts'.
# Getting hold of the Ruby bindings object or reflecting
# over local variables is cheating and would not demonstrate
# pass-by-reference.
end
class A;
end
object = A.new
puts object
foo(object)
puts object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment