Auto Package Inclussion
Currently if I want, say, Gtk I use:
using Gtk;
But this is not enough information, because be have now Gtk-4.0 around, so using a directive like the following will help:
using Gtk(4.0);
Declaring using
directives on generated VAPI is useful too, so you can know what package you need to add through --pkg
when compiling software.
This is specially useful for GVls. GVls can check using
directives to search in a pre-defined search paths, all VAPI providing bindings for used namespace, this works well if no other package use the same namespace, but there are lot of VAPI, like GTK+ or any other providing a different API, but using same namespace.
Can be useful for Vala. If the user writes a code like;
using GLib;
using Gda;
Vala compiler can use this directives to search packages providing this namespaces, so compilation switches can be less.
Vala compiler, still needs to know what version you want, so:
using Gtk(3.0);
will instruct Vala compiler to load gtk+-3.0, because this package provides this namespace and file's name (gtk+-3.0.vapi), provides version information. If the source is a GIR one, then API version defined in to the XML or file's name, can be used.