Re: [Vala] Ownership syntax changes
- From: Jürg Billeter <j bitron ch>
- To: Xavier Bestel <xavier bestel free fr>
- Cc: vala-list <vala-list gnome org>
- Subject: Re: [Vala] Ownership syntax changes
- Date: Sat, 20 Dec 2008 13:04:35 +0100
On Sat, 2008-12-20 at 12:19 +0100, Xavier Bestel wrote:
Le vendredi 19 décembre 2008 à 12:10 +0100, Jürg Billeter a écrit :
I just committed some ownership syntax changes to trunk. The old syntax
will continue to be supported but is planned to be deprecated after the
release of Vala 0.5.4.
* `owned' type modifier replaces `#' type modifier
This is not often used, but `#' was very unintuitive as a type modifier,
and I therefore decided to replace it by the hopefully better
understandable `owned' modifier. Example of new syntax:
public void foo (owned string bar) {
[...]
}
I like the idea, but the word "owned" doesn't really tells by who it's
owned (caller or callee). How about something like "callers" or
"transfer" ?
`owned' applied to a parameter means that the parameter owns the object,
that is, the ownership of the object is transferred in the same
direction as the parameter value: to the callee for input paramters, to
the caller for output parameters, and input to the callee and output to
the caller for `ref' parameters.
The issue with the caller/callee owned terminology is that this does not
apply very well to `ref' parameters and fields, which means that we
would need yet another modifier in those places.
Jürg
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]