Re: proposed API change



On Tue, May 27, 2003 at 09:23:08AM -0400, muppet wrote:

René Seindal said:
 Adding the model to the list will make otherwise simple and straightforward
code more complicated and error prone.  If we really want to stick to the C
API, the call should be

    my $model;
    @paths = $selection->get_selected_rows(\$model);

If that is chosen, I think we should also have

    $iter = $selection->get_selected(\$model);

where in either case the argument can be left out, just as it can be NULL in
the C API.

i very strongly disagree with this, on the grounds that it is highly
non-perlish to write through references passed as arguments.  this is a C
idiom that perl goes out of its way to avoid and i do not want it to leak
through.

I that case I think the model argument should simply be left out, at
least in the case of get_selected_rows() where it is more intrusive.  As
for get_selected() a simple test on the context can determine what to
return.

-- 
René Seindal (rene seindal dk)                  http://sights.seindal.dk/




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