Re: Named arguments in function calls

Поиск
Список
Период
Сортировка
От Matthew Kirkwood
Тема Re: Named arguments in function calls
Дата
Msg-id Pine.LNX.4.58.0401261758080.20230@sphinx.mythic-beasts.com
обсуждение исходный текст
Ответ на Re: Named arguments in function calls  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Named arguments in function calls  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, 26 Jan 2004, Tom Lane wrote:

> >> If that was IS, then foo(x is 13) makes sense.
>
> > I like that syntax.  For example
> > select interest(amount is 500.00, rate is 1.3)
> > is very readable, yet brief.
>
> On second thought though, it doesn't work.
>
>     select func(x is null);
>
> is ambiguous, especially if func() accepts boolean.

You're unlikely to care, but Oracle's syntax is Perlish:
select interest(amount => 500.0, rate => 1.3);

That'd be ambiguous again, though.  Perhaps:
select interest(amount := 500.0, rate := 1.3);

?

Matthew.


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: 7.5 change documentation
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Disaster!