Created
December 6, 2012 17:46
-
-
Save vderyagin/4226455 to your computer and use it in GitHub Desktop.
lisp-style "if" condition is Scala
This file contains hidden or 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
| 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