Skip site navigation (1) Skip section navigation (2)

Re: Named arguments in function calls

From: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Named arguments in function calls
Date: 2004-01-25 19:29:06
Message-ID: Pine.LNX.4.44.0401252015580.30205-100000@zigo.dhs.org (view raw or flat)
Thread:
Lists: pgsql-hackers
On 25 Jan 2004, Greg Stark wrote:

> > >  foo (x => 13, y => 42)
> > > 
> 
> Is it really necessary to steal it?

Yes, it is necessary since the arguments to a function are just 
expressions. If you do not the above would be ambigious and there is no 
clean way to fix that. Say that => is an operator returning a boolean, 
then the above could either be the function foo called with x=13 and y=42 
or the function foo called with two booleans.

We could of course make up some other syntax that does not involve => but 
then you loose compability with oracle.

I've not checked if there is anything similar in the sql2003 draft yet.  
I will do that of course. If someone has information about that, please
speak up.

-- 
/Dennis Björklund


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2004-01-25 19:54:12
Subject: Re: Named arguments in function calls
Previous:From: Greg StarkDate: 2004-01-25 17:38:28
Subject: Re: Named arguments in function calls

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group