Re: Named arguments in function calls - Mailing list pgsql-hackers

From Matthew Kirkwood
Subject Re: Named arguments in function calls
Date
Msg-id Pine.LNX.4.58.0401261758080.20230@sphinx.mythic-beasts.com
Whole thread Raw
In response to Re: Named arguments in function calls  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Named arguments in function calls  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, 26 Jan 2004, Tom Lane wrote:

> >> If that was IS, then foo(x is 13) makes sense.
>
> > I like that syntax.  For example
> > select interest(amount is 500.00, rate is 1.3)
> > is very readable, yet brief.
>
> On second thought though, it doesn't work.
>
>     select func(x is null);
>
> is ambiguous, especially if func() accepts boolean.

You're unlikely to care, but Oracle's syntax is Perlish:
select interest(amount => 500.0, rate => 1.3);

That'd be ambiguous again, though.  Perhaps:
select interest(amount := 500.0, rate := 1.3);

?

Matthew.


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: 7.5 change documentation
Next
From: Bruce Momjian
Date:
Subject: Re: Disaster!