[Vala] struct assignment
- From: "Alberto Ruiz" <aruiz gnome org>
- To: Vala paldo org
- Subject: [Vala] struct assignment
- Date: Wed, 29 Aug 2007 01:46:06 +0100
In C it's pretty common to do struct assignment like this:
typedef struct _Foo {
int a;
int b;
int c;
} Foo;
Foo thing = {1, 2, 3};
The problem is, once wrapped, you need to do the assignment field by field:
var thing = new Foo();
thing.a = 1;
thing.b = 2;
thing.c = 3;
The problem gets worse with things like this:
Foo[] thing = {{1,2,3}, {4,5,6}, {7,8,9}, ...};
Can't we sort this out somehow? Since valavapigen doesn't support class/struct extensibility (through -
custom.vala files) I cannot even create a helper function with a sane name.
Any ideas?
--
Un saludo,
Alberto Ruiz
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]