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
This is actually very useful to me as for message passing a proc might want to take ownership of a message, update it and sink it into a channel. A var param would be needed otherwise and wouldn't be able to express the sink semantics.
i.e. this compiles
procfoo(x: sinkint) =
x +=1echo x
procmain() =var z =3foo(z)
main()
However, this mutability of sink parameter is not clearly specified in the destructors spec.
If it's intentional, it should be added, if not it should be removed (and a sink var would be useful).
The text was updated successfully, but these errors were encountered:
It seems like
sink
parameter can be mutated.This is actually very useful to me as for message passing a proc might want to take ownership of a message, update it and sink it into a channel. A
var
param would be needed otherwise and wouldn't be able to express thesink semantics
.i.e. this compiles
However, this mutability of sink parameter is not clearly specified in the destructors spec.
If it's intentional, it should be added, if not it should be removed (and a sink var would be useful).
The text was updated successfully, but these errors were encountered: