On Tue, 5 Nov 2013 18:23:42 -0200 Felipe Magno de Almeida <[email protected]> said:
there is the other view that appeanding/prepending relative TO something.. if something is NULL.. then that something does not exist, so calling these calles with NULL as relative is "silly". the behavior is "being nice" and functioning anyway even if used stupidly. :) as tom said... the discussion is moot as any change would be an api/abi break and it's not going to happen (well not knowingly etc.). > Hello, > > Both eina_inlist_prepend_relative and eina_list_prepend_relative_list > takes three arguments: list, data and relative. If relative is NULL, > both execute the non-relative version: eina_inlist_prepend and > eina_list_prepend. > > This means that there's no way to make eina_inlist_prepend_relative > and eina_list_prepend_relative_list to append on the end of the list. > I think that NULL should be considered as a past-the-end element and > the result would be prepending relative to the past-the-end element, > i.e., appending. > > If we consider this list: > > [a -> b -> c -> d -> NULL] > > We can see that prepending relative to /a/ means eina_list_prepend, > relative to /b/ means inserting the element between /a/ and /b/. And > if we consider the following empty list: > > [NULL] > > eina_list_prepend and eina_list_prepend_relative prepends before the > past-the-end node. So: > > Eina_List* list = NULL; > > List list: [NULL] > > int i = 5; > void* data = &i; > > list = eina_list_prepend_relative(list, data, NULL); > > [i -> NULL] > > The current behavior of doing normal prepend when relative is NULL > forces some algorithms to do > > if(pos) > list = eina_list_prepend_relative_list(list, data, pos); > else > list = eina_list_append(list, data); > > Which seems unnecessary. Am I missing something? > > Regards, > -- > Felipe Magno de Almeida > > ------------------------------------------------------------------------------ > November Webinars for C, C++, Fortran Developers > Accelerate application performance with scalable programming models. Explore > techniques for threading, error checking, porting, and tuning. Get the most > from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk > _______________________________________________ > enlightenment-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel > -- ------------- Codito, ergo sum - "I code, therefore I am" -------------- The Rasterman (Carsten Haitzler) [email protected] ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
