Skip to content

Instantly share code, notes, and snippets.

@vderyagin
Created December 6, 2012 17:46
Show Gist options
  • Select an option

  • Save vderyagin/4226455 to your computer and use it in GitHub Desktop.

Select an option

Save vderyagin/4226455 to your computer and use it in GitHub Desktop.
lisp-style "if" condition is Scala
def lispyIf(condition: => Boolean)(thenClause: => Unit)(elseClause: => Unit) {
if (condition) thenClause
else elseClause
}
lispyIf(1 < 2) {
println("true")
} {
println("false")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment