2014-07-23

Vala 0.25.1 released

This new release of the Vala programming language brings a new set of features together with several bug fixes.

Changes

  • Support explicit interface method implementation.
  • Support (unowned type)[] syntax.
  • Support non-literal length in fixed-size arrays.
  • Mark regular expression literals as stable.
  • GIR parser updates.
  • Add webkit2gtk-3.0 bindings.
  • Add gstreamer-allocators-1.0 and gstreamer-riff-1.0 bindings.
  • Bug fixes and binding updates.
The explicit interface method implementation allows to implement two interfaces that have methods (not properties) with the same name. Example:

interface Foo {
 public abstract int m();
}

interface Bar {
 public abstract string m();
}

class Cls: Foo, Bar {
 public int Foo.m() {
  return 10;
 }

 public string Bar.m() {
  return "bar";
 }
}

void main () {
 var cls = new Cls ();
 message ("%d %s", ((Foo) cls).m(), ((Bar) cls).m());
}

Will output 10 bar.

The new (unowned type)[] syntax allows to represent "transfer container" arrays. Whereas it's possible to do List<unowned type>, now it's also possible with Vala arrays.
Beware that doing var arr = transfer_container_array; will not correctly reference the elements. This is a bug that will eventually get fixed. It's better to always specify (unowned type)[] arr = transfer_container_array;
Note that inside the parenthesis only the unowned keyword is currently allowed.

The non-literal length in fixed-size arrays has still a bug (lost track of it) that if not fixed may end up being reverted. So we advice not to use it yet.

Thanks to our Florian for always making the documentation shine, Evan and Rico for constantly keeping the bindings up-to-date to the bleeding edge, and all other contributors.

More information and download at the Vala homepage.