[Gambas-devel] About List interface

Benoît Minisini gambas at ...1...
Sun Sep 2 20:39:00 CEST 2012


Le 02/09/2012 20:04, Tobias Boege a écrit :
> Hmm, having considered this issue a bit further, I would rather leave the
> Current invalid until the user sets it. If it is invalid, MoveNext() is the
> same as MoveFirst() and MovePrev() is the same as MoveLast() but accessing
> List.Current gives error.
>
> The reason for which I didn't choose changing on insertion is that it could
> get cumbersome for the user to save Current before every insertion if they
> don't want it to change.
>
> Last alternative could be using a flag. This is set whenever the user
> explicitly sets Current; before, it is cleared. If the bit is set, Current
> always remains the same, if it is cleared, any insertion moves Current to
> the first node. This sounds like the best solution to me...

Mmm... I find it weird. I'd prefer a less ambiguous and more stupid 
solution: either you always change Current after an insertion, either 
you never change it. Less sources of possible bugs...

And would you rename the component? I'd like a better name than gb.adt. 
Maybe 'gb.data'. Not wonderful, but I don't see what a component with 
that name could do other than something such low-level as storing data.

And if the component is not unstable anymore, write it in the component 
file. You have three choices!

	State=Finished
	State=Unfinished
	State=Experimental

Regards,

-- 
Benoît Minisini




More information about the Devel mailing list