Re: [Vala] [PATCH 2/2] Map GIRepository "record" type to Class instead of Struct



Hi,
                   في خ، 29-07-2010 عند 21:14 -0400 ، كتب Calvin Walton:
The GObject Introspection "record" type is actually a reference type,
unlike the pass-by-value semantics of the Vala Struct. Map the "record"
type to Vala's Class (with is_compact set), as that seems to be the
closest mapping.
I don't quite agree with this one :
* There is no difference in passing structs and compact classes except
for out/ref arguments. (structs aren't passed by value in the GObject
profile).
* in some cases, both struct and 
* Some heuristcs can be used (e.g. if it doesn't have a constructor it's
a struct) but they aren't always reliable.
* G-I already has the caller-allocates for passing out arguments, which
I believe is the right thing for this if it can move to the type
definition rather than in some out argument.

So, in the end I'd rather file a bug on gobject-introspection for moving
caller-allocates from the argument definition to the type definition and
use that (that's likely to be painful since some bindings already use
this, but remember the magic word "Vala", it can help ;-)).

As for Alias, you want it to be of the same type as the parent, but I
can't find how to do it (how to find the type of the parent before the
symbol resolver is run).


Abderrahim




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