Created
August 10, 2017 06:31
-
-
Save anonymous/025fda3c45603a5c18c88bed625daede to your computer and use it in GitHub Desktop.
the description for this gist
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
// builds an expression like: println(s"$text ${a + (b + 1)}") | |
def buildComplexExpression(text: String, a: Int, b: Int) = new ScalaToLanguageBridge[String] { | |
override def apply[Wrapper[_]](implicit F: Language[Wrapper]): Wrapper[String] = { | |
val addition = F.add(F.number(a), F.increment(F.number(b))) | |
F.concat(F.text(text), F.toString(addition)) | |
} | |
} | |
val fullExpression = buildComplexExpression("Result is ", 10, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment