Re: linked list rewrite

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: linked list rewrite
Дата
Msg-id 21900.1083118020@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: linked list rewrite  (Neil Conway <neilc@samurai.com>)
Ответы Re: linked list rewrite  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: linked list rewrite  (Neil Conway <neilc@samurai.com>)
Список pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> Most of your suggestions are agreeable; a few minor quibbles follow.

>> lfirstcell    new function to get first cell, or NULL if none
> [...]
>> llastnode    llastcell

> What do you think of list_head() and list_tail() instead?

No strong objection, though I thought it was a good idea to include
"cell" in the function names to suggest that what you are getting back
is just a cell and not a List.  Anyone else have a preference?

>> set_union    list_union
>> set_ptrUnion    list_union_ptr
>> list_union_int        not currently used
>> set_uniono    list_union_oid

> I don't see the need for anything more than set_difference() and 
> set_difference_ptr() -- if we're passed a T_IntList or a T_OidList, we 
> can examine the list tag and do the Right Thing automagically.

Well, we could, but AFAIK there are no situations where the caller
doesn't know exactly what he wants, and so a switch in the function body
is just a waste of cycles.  It is probable that these functions are slow
enough and seldom-used enough that the extra switch doesn't matter much,
so that argument may not have much force.  I guess the real question in
my mind is whether there is any true gain in symmetry or readability by
doing it this way.  The other functions such as the cons family *will*
need to have the three variants, and so I question that it makes sense
to make these different.  Also the need for the _ptr variant makes it a
bit asymmetric even just when looking at these functions.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Christopher Kings-Lynne
Дата:
Сообщение: Re: Usability, MySQL, Postgresql.org, gborg, contrib,
Следующее
От: Paul Tillotson
Дата:
Сообщение: Re: [pgsql-advocacy] What can we learn from MySQL?