Created
March 12, 2014 08:42
-
-
Save Nicd/9503114 to your computer and use it in GitHub Desktop.
Elixir looks nice
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
@doc """ | |
Pop the next mode from the stack and return new Status record with the | |
mode or nil if there were no modes to pop. | |
""" | |
def pop(status) do | |
[head | tail] = status.mode_stack | |
status = status.mode_stack tail | |
case head do | |
[] -> nil | |
_ -> status.current_mode head | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment