You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I write e.g. [Pair(String).new("a", b"), ...] I get an Array'ref, but how do I turn this into a Array'val? On the callee side, I can use an argument type Array'box which works fine, though just curious, if the argument type would be Array'val, how would I create an Array literal asArray'val?
The text was updated successfully, but these errors were encountered:
We do not yet have "recover" blocks as in Pony, or proper region analysis that would be used to construct such a feature.
As a result, the only way to create an Array'iso or Array'val literal, is to ensure that each element has a sendable cap. If that condition is met, then any array literal which is being "assigned to" something of a val or iso type will be automatically lifted to a val or iso array literal.
In this case, your example failed only because Pair.new creates ref objects.
In lieu of recover blocks, this problem can be sidestepped by adding a val and/or iso constructor to the Pair type.
When I write e.g.
[Pair(String).new("a", b"), ...]
I get anArray'ref
, but how do I turn this into aArray'val
? On the callee side, I can use an argument typeArray'box
which works fine, though just curious, if the argument type would beArray'val
, how would I create an Array literal asArray'val
?The text was updated successfully, but these errors were encountered: