Created
June 11, 2013 22:50
-
-
Save machisuji/5761456 to your computer and use it in GitHub Desktop.
Using methods instead of anonymous blocks.
This file contains 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
append: aString to: anotherString | |
^ anotherString, ' ', aString | |
"..." | |
#('I' 'like' 'milk') inject: '' into: self class blockFor: #append. | |
" as opposed to " | |
#('I' 'like' 'milk') inject: '' into: [:sentence :word | self append: word to: sentence] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment