in Gwion. Using the newly implemented pattern matching ability.
fun int setalarm(const bool employed, const bool vacation) { match employed { case true: return !vacation; case _: return false; } } <<< setalarm(true, true) >>>; <<< setalarm(false, true) >>>; <<< setalarm(false, true) >>>; <<< setalarm(true, false) >>>;
I should implement implicit casting from bool to int and vice-versa.
EDIT: done and working.
BONUS:
!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
in Gwion.
Using the newly implemented pattern matching ability.
I should implement implicit casting from bool to int and vice-versa.
EDIT: done and working.
BONUS:
!
operator as boolean, which hopefully makes more sense