Last active
December 9, 2015 19:00
-
-
Save azenla/fdd84a9a1b7a90326e51 to your computer and use it in GitHub Desktop.
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
let names = [ | |
"Alex" | |
"Sam" | |
"Logan" | |
] | |
let ages = [ | |
16 | |
18 | |
16 | |
] | |
for name in names and age in ages { | |
print("$(name): $(age)") | |
} | |
let callback = { -> print("Callback called!") } | |
EventLoop.run(callback) | |
let bus = EventBus() | |
bus.on("message") { message -> | |
print("Got Message: $(message)") | |
} | |
// Manual memory management | |
free(bus) | |
bus.emit("message", "Hello World") | |
// With Invoke | |
with "message" and "Hello World" invoke bus.emit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment