[Gtk-sharp-list] Generating returns instead of out params

Mike Kestner mkestner@speakeasy.net
25 Feb 2003 22:54:19 -0600


On Tue, 2003-02-25 at 13:23, fd wrote:

> is still generated as
> 
>         public void GetIterAtOffset(out Gtk.TextIter iter, int
>         char_offset) {}
> 
> Should we look into generating this instead?
> 
>         public Gtk.TextIter GetIterAtOffset(int char_offset) {}
> 
> Where in Parameters.cs would this particular manipulation be made? A lot
> of the logic to detect this situation already seems to exist in there,
> so I don't want to reinvent the wheel.

It can't really be done completely within parameters.  IsAccessor is the
Parameters method that is used to detect the single out param variety,
but that's a much simpler case to deal with. In this case, you still
have a method not a property, with a variably placed return param.  It
would require changes to Method and Parameters since the return type of
the Method would have to be manipulated.

If you want to do some investigation, and propose a solution, I'd be
happy to help refine it.  You might want to grep the generator for
is_get and getter. That'll point you to the Property generation code and
the Method/Parameter fu.

-- 
Mike Kestner <mkestner@speakeasy.net>