Created
April 21, 2009 13:47
-
-
Save freshtonic/99146 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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