Skip to content

Instantly share code, notes, and snippets.

@martincox
Created April 6, 2017 20:17
Show Gist options
  • Select an option

  • Save martincox/3a3d5e62329185710bfce10d21e65199 to your computer and use it in GitHub Desktop.

Select an option

Save martincox/3a3d5e62329185710bfce10d21e65199 to your computer and use it in GitHub Desktop.
-module(hofun).
-compile(export_all).
init() ->
PrepareAlarm = fun(Room) ->
io:format("Alarm set in ~s.~n",[Room]),
fun() -> io:format("Alarm tripped in ~s! Call Batman!~n",[Room]) end
end,
AlarmReady = PrepareAlarm("bathroom"),
AlarmReady().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment