Re: WIP: default values for function parameters

Поиск
Список
Период
Сортировка
От David E. Wheeler
Тема Re: WIP: default values for function parameters
Дата
Msg-id 5A28505D-1A2C-401A-BA3A-B1250EB979CD@kineticode.com
обсуждение исходный текст
Ответ на Re: WIP: default values for function parameters  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Dec 12, 2008, at 4:06 PM, Tom Lane wrote:

> "David E. Wheeler" <david@kineticode.com> writes:
>> Hrm. I can see that, I guess. In that case, though, I think I'd  
>> prefer
>> the colon at the beginning of the parameter label:
>
>>   SELECT foo( :bar => 'ick', :baz => 'ack' );
>
> That's ugly, and incompatible with ecpg syntax, and what's the  
> redeeming
> value anyway?

Beauty is in the eye of the beholder, I guess. I got used to it  
hacking Ruby last year.

> In any case, whichever side you put the colon on, Pavel's proposal for
> adding => to it is a nonstarter --- he's ignoring the possibility that
> => is defined as a prefix operator.

Ah.

> Hmm ... actually, ecpg might be a problem here anyway.  I know it has
> special meaning for :name, but does it allow space between the colon
> and the name?  If it does then the colon syntax loses.  If it doesn't
> then you could do "name: value" as long as you were careful to leave
> a space after the colon.

So would that eliminate
  SELECT foo( bar: 'ick', baz: 'ack' );

as a possibility?

Best,

David



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

Предыдущее
От: "Douglas McNaught"
Дата:
Сообщение: Re: WIP: default values for function parameters
Следующее
От: "Robert Haas"
Дата:
Сообщение: Re: Updates of SE-PostgreSQL 8.4devel patches (r1268)