Re: [Vala] Minor features request (about structs and enums)
- From: Michael 'Mickey' Lauer <mickey vanille-media de>
- To: Vala-list <Vala-list gnome org>
- Subject: Re: [Vala] Minor features request (about structs and enums)
- Date: Mon, 02 Nov 2009 19:38:46 +0100
Am Montag, den 02.11.2009, 11:59 -0600 schrieb Wolter Hellmund:
I think Vala is missing some minor features related to type declarations
(such as structs and enums) that both C and C++ have and are really
useful.
For example, if you are to declare a single struct in C or C++, you can
just do:
-----------
struct {
int id;
float mass;
} Object;
------------
In Vala, you cannot (as far as I know by experimentation.
Such is the example with the enum:
------------
enum {
CONSTRUCT
RUN
DESTROY
} Process;
------------
Again, Vala does not support this kind of declaration.
I don't see the benefit of these forms versus
struct Object {
int id;
float mass;
}
respectively
enum Process {
CONSTRUCT,
RUN,
DESTROY
}
or did you miss that these are available?
Another feature that might be out of context, and I don't know if its
implemented but nor Google nor the people at the IRC channel have been
able to answer me, is enum iteration.
foreach ((what type?) item in MyEnum) { ... }
That's not possible indeed. It might be handy, please open a bug ticket.
Thanks,
:M:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]