The Sweet With
Christopher Wright
dhasenan at gmail.com
Tue Mar 10 15:23:31 PDT 2009
Sorry about the name...
Tomasz Sowiński wrote:
> A blunt one would be screaming out an error whenever the compiler has trouble choosing an overload. Would it be too hard to live with?
For programmers? It would be ugly.
For the compiler? It would be ugly, and result in a lot of
special-casing, I feel. With current with statements, you start a new
scope and add a bunch of symbols to it. Using this proposed with
statement syntax, you don't create a new scope, so you have to add a
step or three to resolving symbols.
Also, you'd have to find all possible overloads of a function and do
some semantic analysis on them before you could resolve the arguments.
Overload resolution becomes a lot more difficult.
And what does the programmer gain? Very little. People seldom use enums,
I think.
More information about the Digitalmars-d
mailing list