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:


_______________________________________________
Vala-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to