One liners in Smalltalk
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
"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