Created
November 14, 2015 20:30
-
-
Save darach/adf4d63263e362da4888 to your computer and use it in GitHub Desktop.
ref -> val
This file contains hidden or 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
actor Main | |
new create(env : Env) => | |
var a : Array[String] ref = [ "a", "b", "c" ] | |
var b : Array[String] trn = recover Array[String] end | |
b.push("foo") ; b.push("bar") ; b.push("baz") | |
for i in a.values() do | |
b.push(i) | |
end | |
let c : Array[String] val = consume b | |
for i in c.values() do | |
env.out.print("Got: " + i) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment