Re: [Vala] Setting and getting properties at the same time



On Sat, 2012-11-03 at 08:39 +0800, Nor Jaidi Tuah wrote:
I think chained assignment should have
Semantic B, for the following reasons:

While I don't particularly like chained assignments in general, I prefer
Semantic A.

  * A well designed property should give
    the same result for both semantics

Agreed, however, that's not an argument against or in favor of either
solution.

  * Semantic A is not possible for a
    write only property.

Write-only properties are quite rare, just don't use chained assignments
in these cases. 

  * Semantic A is really confusing. e.g.,
      var1.myproperty = var2.myproperty = y;
    who would have thought that var1.myproperty
    is different from var2.myproperty ?!

It's only confusing for non well-behaving properties. The right solution
is to fix the property.

One reason why I don't like Semantic B is that sensible memory
management wouldn't be possible in that case for non reference-counted
objects.

Regards,
Jürg




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]