Created
May 24, 2021 22:35
-
-
Save germandiagogomez/a3ac60b4e28e875b88723be559e317bd to your computer and use it in GitHub Desktop.
Functions with guards in ChaiScript
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
def maybeCallMe(x) : x > 2 && x < 5 { | |
} | |
def maybeCallMe(x) : x >= 5 { | |
} | |
maybeCallMe(3) // Calls the top one | |
maybeCallMe(6) // Calls the second one |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment