Am Sonntag, 9. November 2008 schrieb Cyril ADRIAN: > On Sat, Nov 8, 2008 at 10:28 PM, Raphael Mack <[EMAIL PROTECTED] mack.de>wrote: > > Paolo wrapped G_LIST, which seems to be a useful data structure, > > especially, when wrapping libs, which are based on glib. > > > > ATM this class inherits COLLECTION from se lib, which is in principle > > very nice, but I think it does not fit. - a G_LIST can be frozen, but > > a COLLECTION can always be modified. So, I think we should remove this > > inheritance. > > You could inherit from TRAVERSABLE instead. It presents a read-only view > of a sequence of elements.
Mh. To solve this I suggest the following scheme: G_LIST inherit TRAVERSABLE G_LIST_COLLECTION inherit COLLECTION insert G_LIST invariant: is_mutable This way each G_LIST instance which may be modified by the eiffel code may return a G_LIST_COLLECTION, and we have the nice eiffel interface for the collection on the G_LIST. Whenever a lib forbids modifying the list a G_LIST may be returned. For the classes WRAPPER_COLLECTION and FREEZABLE I do not see much use. Shall we just remove them? Rapha _______________________________________________ Eiffel-libraries-devel mailing list [email protected] https://mail.gna.org/listinfo/eiffel-libraries-devel
