Re: Variadic parameters vs parameter defaults

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Variadic parameters vs parameter defaults
Дата
Msg-id 162867790812171515j6c477dfdqd87857bea9f25597@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Variadic parameters vs parameter defaults  (Gregory Stark <stark@enterprisedb.com>)
Ответы Re: Variadic parameters vs parameter defaults  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
2008/12/17 Gregory Stark <stark@enterprisedb.com>:
> Tom Lane <tgl@sss.pgh.pa.us> writes:
>
>> Peter Eisentraut <peter_e@gmx.net> writes:
>>> On Wednesday 17 December 2008 20:50:22 Tom Lane wrote:
>>>> The behavior at zero arguments is
>>>> certainly a judgment call, but it seems to me that we'll wind up with
>>>> more warts and less flexibility if we try to make the system install a
>>>> default behavior for that case.
>>
>>> Maybe we'll just let it be for now and see what kind of user demands we get.
>>
>> Fair enough.  We could possibly have the system install a "default
>> default" for variadic arguments, but I'd rather add that later
>> on the basis of demand than stick it in now.
>
> My inclination would be to say zero arguments is zero arguments and you get a
> zero-length array. We could eliminate the problem with anyelement by saying
> the variadic argument can't be the only polymorphic argument.
>

I disagree. Polymorphism is strong feature and without it, you have to
repeat code. Or maybe divide this problem to two cases: zero typed
variadic arguments, and nnempty polymorphic variadic argument.

Regards
Pavel Stehule

> I think there are going to be more users using non-polymorphic arguments who
> are surprised that no arguments is a special case than people using
> polymorphic arguments who are annoyed by restrictions at the intersection.
>
> Actually I think my vote would be for whatever requires the least code now. If
> you've already committed something then let's just go with that.
>
> --
>  Gregory Stark
>  EnterpriseDB          http://www.enterprisedb.com
>  Ask me about EnterpriseDB's Slony Replication support!
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Preventing index scans for non-recoverable index AMs
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Variadic parameters vs parameter defaults