/Cinderella2.scala Secret
Last active
January 3, 2018 08:56
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
object Cinderella2 extends App { | |
def f: (Int, Vector[String]) = { | |
(42, Vector("Generating random int")) | |
} | |
def g(i: Int): (Int, Vector[String]) = { | |
(i % 2, Vector("Applying complex mathematical formula")) | |
} | |
val (i, vs1) = f | |
val (result, vs2) = g(i) | |
val printStatements = vs1 ++ vs2 | |
println(printStatements) | |
println(result) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment