Skip to content

Instantly share code, notes, and snippets.

@pdtwonotes
Last active December 25, 2016 19:18
Show Gist options
  • Save pdtwonotes/ec591158d16614c0076808eb4979d11f to your computer and use it in GitHub Desktop.
Save pdtwonotes/ec591158d16614c0076808eb4979d11f to your computer and use it in GitHub Desktop.
Multiple calls on an iso
This convoluted construction works:
class Foo
var n: USize = 0
new iso create() => None
fun iso set_n( m: USize ): Foo iso^ =>
n = m
consume this
actor Main
new create( env: Env ) =>
let foo = Foo.create()
let foo2 = (consume foo).set_n(3)
let foo3 = (consume foo2).set_n(4)
let destination = Other.create()
destination(consume foo3)
actor Other
new create() => None
be apply( x: Foo iso ) => None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment