Created
December 16, 2017 17:28
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