4 ms·
I would assume destructuring comes into play: https://austral-lang.org/spec/spec.html#stmt-let-destructure https://austral-lang.org/spec/spec.html#stmt-let-dest
by masklinn 4y ago
I would assume destructuring comes into play: https://austral-lang.org/spec/spec.html#stmt-let-destructure https://austral-lang.org/spec/spec.html#stmt-let-destructure
Whatever underlying value would be moved out of the linear record by destructuring (and thus consuming) it, then released via the underlying platform's operation (e.g. close(2), CloseHandle, ...)
edit: from the linked section, it looks like field access is a linear operation:
> when you have a linear record type, you can’t extract the value of a linear field from it, because it consumes the record as a whole, and leaves unconsumed any other linear fields in the record
so for a "newtype" (a single field wrapper type) you can just access the one field, maybe.