Tom Lane wrote:

On a related note, it would also be nice to have default
parameters and some way to say to use them.


That is fundamentally not ever going to happen, because it blows
overloaded-function resolution out of the water: there is no way to
choose whether "foo(42, 2.5)" matches foo(int, float) or
foo(int, float, something-with-a-default).  Let's try to limit our
attention to something that might actually work.

C++ manages to solve this problem, although I can't remember the exact mechanics (and C++ is usually not a good example to follow anyway ;)


How about just disallowing function signatures that cause ambiguity? i.e. make f(t1,t2,default t3,default t4,..) lay claim to f(t1,t2), f(t1,t2,t3), f(t1,t2,t3,t4) etc, and creation fails if any of those signatures are already claimed by another function.

-O

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to