[Vala] Classes as objects?
- From: Robert Schroll <rschroll gmail com>
- To: vala-list gnome org
- Subject: [Vala] Classes as objects?
- Date: Sun, 03 Jun 2012 13:57:39 -0400
Hi all,
Is it possible to treat classes as objects in Vala, similar to how
delegates let you treat methods as objects?
What I'm trying to do is go through a list of classes and call a static
method on each. In Python, I could do this as
for klass in [Class1, Class2]:
klass.static_method()
In Vala, when I try
foreach (var klass in {Class1, Class2})
klass.static_method();
I get "error: initializer list used for unknown type" at the open brace.
If it helps, all of the classes are descended from the same superclass.
Thanks in advance,
Robert
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]