Skip to content

Instantly share code, notes, and snippets.

@aav

aav/.pony Secret

Created February 15, 2017 20:49
Show Gist options
  • Save aav/4d88bfb077d1b6bbd8fe844d49fddc87 to your computer and use it in GitHub Desktop.
Save aav/4d88bfb077d1b6bbd8fe844d49fddc87 to your computer and use it in GitHub Desktop.
class Test
fun x() =>
let a: Array[U8 val] trn = recover trn Array[U8] end
a.push(1)
let b: Array[U8 val] val = consume a
let c: Array[U8 val] val = recover val b.clone() end
@dougmacdoug
Copy link

fun clone_sendable(arr :Array[U8] ref) : Array[U8] val =>
  let n = arr.size()
  let out = recover Array[U8](n) end
  for u in arr.values() do
    out.push(u)
  end
  consume out

@aav
Copy link
Author

aav commented Feb 16, 2017

@dougmacdoug thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment