The Sweet With
Nick Sabalausky
a at a.a
Tue Mar 10 17:26:01 PDT 2009
"Christopher Wright" <dhasenan at gmail.com> wrote in message
news:gp6p96$2dp9$1 at digitalmars.com...
> 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.
I use enums all the time. But I don't mind prepending "MyEnumType." to enum
literals. It would be nice to have a shortcut in clear-cut cases, but if it
meant a bunch of special casing and such, I can certainly live without it.
More information about the Digitalmars-d
mailing list