Skip to content

Instantly share code, notes, and snippets.

@SergeStinckwich
Created June 4, 2011 15:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SergeStinckwich/1008000 to your computer and use it in GitHub Desktop.
Save SergeStinckwich/1008000 to your computer and use it in GitHub Desktop.
One liners in Smalltalk
"Smalltalk version of http://solog.co/47/10-scala-one-liners-to-impress-your-friends/ "
"1. Multiple Each Item in a List by 2"
(1 to: 10) * 2.
"2. Sum a List of Numbers"
"Version 1"
(1 to:1000) reduce:[:a :b|a+b].
"Version 2"
(1 to:1000) sum.
"3. Verify if Exists in a String"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment