Re: Calling PL functions with named parameters

From: Gaetano Mendola <mendola(at)bigfoot(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Calling PL functions with named parameters
Date: 2004-08-14 14:00:32
Message-ID: cfl601$f54$1@floppy.pyrenet.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Harald Fuchs wrote:

> In article <411DFBE1(dot)7060007(at)opencloud(dot)com>,
> Oliver Jowett <oliver(at)opencloud(dot)com> writes:
>
>
>>I think you just made my point for me. C++ allows default parameters
>>and resolves the ambiguity by disallowing ambiguous calls when they
>>happen.
>
>
>
>>I'm not sure why C++ doesn't disallow it at declaration time off the
>>top of my head -- perhaps because you'd get inconsistent behaviour if
>>the candidates were split across compilation units.
>
>
> IIRC this was due to multiple unheritance. You could inherit methods
> with the same name and parameter list from two different base classes.
> Disallowing that at declaration time would mean disallowing
> inheritance (even indirectly) from these two base classes, even though
> the derived class didn't use the ambiguous methods.

You get the point, and with a linear hierarchy the last function hide
the previous one:

struct A { void foo(int) { } };

struct B : A { void foo(int, int a = 3) { } };

B b;
b.foo(3);

will call the B::foo.

Regards
Gaetano Mendola

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gaetano Mendola 2004-08-14 14:06:46 Re: PITR on Windows?
Previous Message Oliver Jowett 2004-08-14 13:58:12 Re: Calling PL functions with named parameters