Properties no longer work?
Jarrett Billingsley
kb3ctd2 at yahoo.com
Thu Jul 27 12:16:37 PDT 2006
"BCS" <BCS at pathlink.com> wrote in message
news:eaarq2$1h47$1 at digitaldaemon.com...
> It gets worse. If foo is overloaded, then DMD silently grabs the lexically
> first version and uses it. This is in direct contradiction of the idea
> that lexical order of functions/classes/etc. should not effect semantics.
> (I seem to recall that this is one of the goals of D, but I can't find the
> reference).
That is ugly. In fact, I even came up with a solution for it in my
scripting language (before it was dynamically typed): an "overload
resolution expression."
It goes like this:
void foo(int x)
{
}
void foo(float x)
{
}
&foo // ambiguous
&foo.(int) // foo(int) overload
&foo.(float) // foo(float) overload
The dot is in there so that the parser doesn't interpret it as a function
call. And as far as I know, there is no other syntax that allows the ".("
sequence.
More information about the Digitalmars-d-learn
mailing list