Comment by Galanwe
So you have to do:
io.async(saveFile, .{io, data, "saveA.txt"}).await(io);
That is 3 references to `io` in a single call.Considering there is very little use case for mix and matching different Ios, any chance of having some kind of default / context IO to avoid all these ?
If you're going to immediately await it, you can just do
EDIT: following up on that, I'm actually not sure that will even be valid code. Futures in this article are declared as var, meaning mutable. This appears to be because Future.await is going to take a pointer as its initial argument. However, because it's a temporary and therefore treated as const, the return value of io.async will not be passable to a .await function expecting a *Future as its initial argument without first being stored in a mutable var.So this would be valid:
But the original presented in the parent comment would be equivalent to the following, and therefore invalid: