Re: WIP: default values for function parameters

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Grzegorz Jaskiewicz" <gj(at)pointblue(dot)com(dot)pl>, "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Subject: Re: WIP: default values for function parameters
Date: 2008-12-12 14:57:52
Message-ID: 87y6ylsaof.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com> writes:

> 2008/12/12 Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>:
>
>> We could do it the other way round:
>>
>> SELECT foo( 'ick' AS bar, 'ack' AS baz);

I always assumed we were talking about it this way. Everywhere else in SQL AS
is followed by the labels, not the values.

> I discussed about this form with Tom.
>
> I thing so following should be readable:
>
> name: [ optional => ] value
>
> SELECT foo( bar: 'ick', baz: 'ack' );
> SELECT foo( bar: => 'ick', baz: => 'ack' );
>
> or
>
> SELECT foo( bar: = 'ick', baz: = 'ack' );
>
> reason for optional using of "=>" is too thin char ":", so =>
> optically boost the colon.

These don't solve anything. There's nothing stopping you from defining a unary
prefix operator => or =

In any case this is all weird. SQL isn't C and doesn't have random bits of
punctuation involved in syntax. It uses whole words for just about everything.
Anything you do using punctuation characters is going to look out of place.

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com
Ask me about EnterpriseDB's PostGIS support!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message KaiGai Kohei 2008-12-12 14:58:48 Re: Updates of SE-PostgreSQL 8.4devel patches (r1268)
Previous Message Pavel Stehule 2008-12-12 14:56:56 Re: WIP: default values for function parameters