Created
December 16, 2017 17:28
-
-
Save Papierkorb/946cee0118602e3146aa2438aede96f0 to your computer and use it in GitHub Desktop.
Demo of type inference of local variables through concurrently ran fibers
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
waiter = Channel(Nil).new | |
var = "Hello" | |
spawn do | |
waiter.receive | |
var = 5 | |
end | |
puts "var is a #{typeof(var)}" | |
puts "var right now is a #{var.class}" | |
waiter.send(nil) | |
puts "var right now is a #{var.class}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment