[Vala] Genie does not allow foreach methods, patch included

There is an issue in Genie trying to invoke any method named foreach.

foreach is a keyword in vala to iterate over sequences.

But, Genie uses the more pythonic approach of using the for keyword:
  for item in container do ....

foreach is not a keyword in Genie, and it has no usage.

However, Genie reserves the word in the parser, and when any method
called for each is invoked, an error occur. For example:

$ cat test.gs
def f(taglist: Gst.TagList, tag_name: string)
        var L = new Gst.TagList()

$ valac test.gs --pkg gstreamer-0.10
test.gs:7.11-7.17: error: syntax error, expected identifier

And the same happen for any method named foreach.

I already raised a bug:

With a patch to remove foreach from the genie parser:

Because of this issue, Genie can't practically use containers
like GstTagList, HashTable, Datalist and so on.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]