Re: Calling PL functions with named parameters

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Subject: Re: Calling PL functions with named parameters
Date: 2004-08-13 23:10:48
Message-ID: 411D4A78.7010806@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Oliver Jowett wrote:

> David Fetter wrote:
>
>> Dennis has pointed out that mixing the call-with-named-parameter
>> interface with call-by-order-of-parameters one would cause confusion,
>> and I think it would be OK to disallow this type mixing, so
>>
>> SELECT foo_func(name AS 'yet another name', 35);
>>
>> would be disallowed.
>
>
> Python's equivalent syntax allows you to mix the two forms so long as
> all the by-position parameters come first:
>
> >>> def f(a,b,c,d):
> ... print a,b,c,d
> ...
> >>> f(1,2,3,4)
> 1 2 3 4
> >>> f(1,2,c=3,d=4)
> 1 2 3 4
> >>> f(1,2,d=4,c=3)
> 1 2 3 4
> >>> f(1,d=4,2,c=3)
> SyntaxError: non-keyword arg after keyword arg

python don't have overloaded function...

Regards
Gaetano Mendola

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-08-13 23:12:14 Re: Calling PL functions with named parameters
Previous Message Tom Lane 2004-08-13 23:02:33 Re: [Fwd: Re: [pgsql-hackers-win32] Import from Linux to Windows]