2012-01-26

Vala 0.15.1 released

The new 0.15.1 version of the Vala programming language has been released. This version introduces a lot of enhancements and regression fixes with regards to the previous 0.15.0 release.

Changes

  • Support arrays with nullable elements.
  • Add support to .gir reader and writer.
  • Switch clutter-gtk-1.0 bindings to .gir.
  • Switch gio-2.0 bindings to .gir.
  • Add cogl-pango-1.0 bindings.
  • Add gdl-3.0 bindings.
  • Add libnl-3.0 bindings.
  • Add packagekit-glib2 bindings.
  • Add xtst bindings.
  • Many bug fixes and binding updates. 
Important breakage note
Now captured parameters of array type are no more copied implicitly by Vala. A captured parameter is one of the following:
  • Either it is a parameter of an async method
  • Or it is a parameter used inside of a closure
The advantage is that async methods in GIO that have arrays as parameters (like buffers) can finally be overridden, otherwise impossible. Same goes parameters referred by closures.
Therefore, if you were relying on the implicit array copy made by Vala in these cases, please take care of this change.

More information and downloads at the Vala homepage.

3 comments:

  1. About the async method thing: Does that mean the array types (e.g. uint16[] ) will be passed as reference and the array has to be taken care of manually, so that it will exist until the async function has been finished? This would mean that an array type parameter would have to be in the global scope of the class to make sure this works.
    Am I getting this right?

    ReplyDelete
  2. I haven't been clear enough in the post, sorry. It must be noted that we're talking about async methods written in Vala.

    The arrays were passed by reference before as well, but methods did copy the array internally.

    Yes, if the method is directly modifying the original array, the array must be kept alive by the caller. This is an addition, something that never worked before.

    What affect existing code is if you were relying on array copy. In this case you can simply assign the parameter to a local variable at the very top of your method.

    ReplyDelete
  3. Great thoughts you got there, believe I may possibly try just some of it throughout my daily life. Journal support

    ReplyDelete