[Vala] wish for Type Inference working for weak local variables
- From: lukpank o2 pl (Łukasz Pankowski)
- To: vala-list <vala-list gnome org>
- Subject: [Vala] wish for Type Inference working for weak local variables
- Date: Sat, 01 Aug 2009 16:36:36 +0200
Hello
According to the Vala tutorial
"Finally Vala has a mechanism called Type Inference, whereby a local
variable may be defined using var instead of giving a type, so long as
it is unambiguous what type is meant."
Type Interface works great for owned variables (for example in
declaration of variable b below) but not for weak variable (neither
declaration of c2 nor c3 works).
I would prefer just "weak" (as in declaration of c2) as shorter, but
maybe "weak var" would be more readable/discoverable?
What do you think about the idea? Would this be hard to implement?
class Foo {}
void main ()
{
// var for short
Foo a = new Foo();
var b = new Foo();
// no `weak' for short
weak Foo c1 = a;
weak c2 = a; // syntax error
weak var c3 = a; // syntax error
}
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]