Re: Named arguments in function calls

Поиск
Список
Период
Сортировка
От Dennis Bjorklund
Тема Re: Named arguments in function calls
Дата
Msg-id Pine.LNX.4.44.0401260603362.30205-100000@zigo.dhs.org
обсуждение исходный текст
Ответ на Re: Named arguments in function calls  (Greg Stark <gsstark@mit.edu>)
Список pgsql-hackers
On 25 Jan 2004, Greg Stark wrote:

> expression "a,b". It's "fixed" by just declaring "," special inside function
> calls. If you want to use the operator in the function call you have to use an
> extra set of parentheses.

Well, it would work. It's just that it felt like such a big hack that I
didn't want to touch it at first. In general if one adds one thing like
this after another, we end up like some other database with lots of
strange ugly features.

> I'm sure that's a bit harder when you want => to be a regular identifier
> outside of a function call.

It doesn't have to be very hard to parse it. One can just parse it as an
expression and have a transformation phase that checks if the expression
is a top level "=>" with a single identifier to the left. If it is we
transform it to named argument. Probably one also need to record if the
top level expression is in () and set a flag to not trigger the above
logic.

-- 
/Dennis Björklund



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Disaster!
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: What's left?