Skip to content

Instantly share code, notes, and snippets.

@machisuji
Created June 11, 2013 22:50
Show Gist options
  • Save machisuji/5761456 to your computer and use it in GitHub Desktop.
Save machisuji/5761456 to your computer and use it in GitHub Desktop.
Using methods instead of anonymous blocks.
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