Created
June 21, 2012 08:24
-
-
Save fjolnir/2964572 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
captureMePlease = "hey I was defined in the root! " | |
a = { :arg | | |
block = {:arg | | |
arg = arg stringByAppendingString:captureMePlease | |
return arg | |
} | |
return block(arg). | |
} | |
myBlock = a | |
numAsStr = a("foo" stringByAppendingString: 321 stringValue.) | |
numAsStr = numAsStr stringByAppendingString:" Three Two One" | |
print(numAsStr) | |
class Foo | |
+ classMethod { | |
print("I'm a class method %@", captureMePlease) | |
} | |
- instanceMethod: iMethArg { | |
print("From: %@ To: %@", iMethArg, self) | |
} | |
end | |
return myBlock. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment