Skip to content

Instantly share code, notes, and snippets.

@Skrylar
Created March 26, 2014 20:41
Show Gist options
  • Save Skrylar/9792937 to your computer and use it in GitHub Desktop.
Save Skrylar/9792937 to your computer and use it in GitHub Desktop.
An example of my attempts at event map macros.
type
CommandEvent = object
Actions = enum
AMeep,
APacake
MakeIntoEvent CommandEvent
when isMainModule:
var poopage: EventQueue
poopage.Init
var x = CommandEvent()
poopage.Enqueue AMeep, x
poopage.Enqueue APacake, x
HandleEvents(poopage):
# First form
On(CommandEvent, AMeep, debugEcho("Meep Command!"))
On(CommandEvent, APacake, debugEcho("Pancake Command!"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment