[Vala] [PATCH] enum: foreach capability

14 views
Skip to first unread message

Sebastian Reichel

unread,
Feb 24, 2012, 11:46:17 AM2/24/12
to vala...@gnome.org
Hi,

Please consider applying the attached patch. It adds support for
using foreach with enums like this (and closes #624691):

> foreach (Enum e in Enum.all_values) {
> stdout.printf ("%s\n", e.to_string ());
> }

-- Sebastian

enum-foreach.patch
signature.asc

Sebastian Reichel

unread,
Mar 23, 2012, 11:53:09 PM3/23/12
to vala...@gnome.org

ping? Is there really no interest in having this in vala? It's quite
useful to fill e.g. Gtk.Combobox with values from the enum.

-- Sebastian

signature.asc

Nor Jaidi Tuah

unread,
Mar 24, 2012, 1:20:57 AM3/24/12
to vala...@gnome.org

> ping? Is there really no interest in having this in vala? It's quite
> useful to fill e.g. Gtk.Combobox with values from the enum.

Perhaps the vala team are currently looking at
other issues and have missed your message or
put it at the back of a long queue.

As a vala user, I'm raising my hand in support
of enum.foreach. But I prefer this syntax:

foreach (Enum e) {
....
}

and let the compiler automatically fill in the "... in Enum.all_values).


hand
Nor Jaidi Tuah


_______________________________________________
vala-list mailing list
vala...@gnome.org
http://mail.gnome.org/mailman/listinfo/vala-list

Steven Oliver

unread,
Mar 24, 2012, 4:13:04 PM3/24/12
to Sebastian Reichel, vala...@gnome.org

> _______________________________________________
> vala-list mailing list
> vala...@gnome.org
> http://mail.gnome.org/mailman/listinfo/vala-list


I'm interested in having this but sadly can't help you get it in. The bug repository is also has quite a few patches that appear to have never been applied for whatever reason.

Reply all
Reply to author
Forward
0 new messages