Re: [Vala] Minor features request (about structs and enums)
- From: pancake <pancake youterm com>
- To: Vala ML <vala-list gnome org>
- Subject: Re: [Vala] Minor features request (about structs and enums)
- Date: Mon, 02 Nov 2009 19:42:41 +0100
Michael 'Mickey' Lauer wrote:
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.
There's another bug report requesting a to_string () method for the
enums that will be nice to have too
I was also thinking on implementing a enumflags keyword that acts like
enum, but shift bits instead of increasing the value. so you can do:
enumflag Mode {
READ
WRITE
}
MyOpen (Mode.READ | Mode.WRITE);
What do you think about adding this new keyword? The thing will be good
when using bitflags so you dont have to use an enum hardcoding the
values in a manual way:
enum Mode {
READ=1,
WRITE=2
...4, 8, 16, 32...
}
--pancake
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]