On Wed, Jul 27, 2005 at 06:01:21PM -0400, Tom Lane wrote:
> Neil (or anyone else with an opinion),
> 
> I'm finding several uses in the planner for some new List primitives
> defined as below.  I'd like to push these into list.c, but before that,
> has anyone got any serious objections?  How about suggestions for better
> names?
> 
>                       regards, tom lane
> 
> 
> 
> /*
>  * list_add adds the datum to the list if it's not already a member
>  * (membership is determined by equal()).
>  */
> static List *
> list_add(List *list, void *datum)
> {
>     if (list_member(list, datum))
>         return list;
>     else
>         return lappend(list, datum);
> }

How about list_push for both of these?  This opens the door for
possible future functionality like list_pop, list_shift,
list_unshift...

Just my uneducated $.02.

Cheers,
D
-- 
David Fetter [EMAIL PROTECTED] http://fetter.org/
phone: +1 510 893 6100   mobile: +1 415 235 3778

Remember to vote!

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to