Skip to content

Instantly share code, notes, and snippets.

@mzimecki
Last active December 23, 2015 06:09
Show Gist options
  • Save mzimecki/6592195 to your computer and use it in GitHub Desktop.
Save mzimecki/6592195 to your computer and use it in GitHub Desktop.
[Scala] Functions and(x,y) and or(x,y)
def and(x: Boolean, y: =>Boolean) = if (x) y else false
def or(x: Boolean, y: =>Boolean) = if (x) true else y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment