Skip to content

Instantly share code, notes, and snippets.

@germandiagogomez
Created May 24, 2021 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save germandiagogomez/a3ac60b4e28e875b88723be559e317bd to your computer and use it in GitHub Desktop.
Save germandiagogomez/a3ac60b4e28e875b88723be559e317bd to your computer and use it in GitHub Desktop.
Functions with guards in ChaiScript
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