Re: [Vala] va_arg in Vala



Hello,

On Mon, August 24, 2009 11:38, Кутейников Дмитрий wrote:
Hello! How to use va_arg and va_list in Vala functions? I managed to use
it
in vapi bindings, but can't create pure-Vala function with variable list
of
parameters.

I think vala functions should use GLib.Value[] (or Glib.ValueArray)
for passing variable arguments. However, I don't know whether it
implements either of:

 - The (params Value[] args) syntax to automagically create the array
   from normally-looking call (same syntax as C#).
 - Creating Values by, even implicitly, casting something.
 - Casting values to the original types with 'as' and testing them with
   'is' operators or some similar operators. Normally these work on object
   references, but something might not be an object reference.

I think it should, so if it does not, it's a feature request. I don't
have vala around (@work) and I don't see documentation saying either
way.

Alternatively, would it work with Object[] and object references?
I don't think int? works as Object in vala.

-- 
                                        - Jan Hudec <bulb ucw cz>




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