Polysemous Values Qustion
Jari-Matti Mäkelä
jmjmak at utu.fi.invalid
Wed Sep 26 00:55:52 PDT 2007
Christopher Wright wrote:
> If Walter's reading this, he's probably thinking that it's a bad idea to
> allow any type to be unresolved for very long, given the problems people
> have mentioned. And if not, well, that might be reason enough for me to
> stick with D2 rather than going with D3. (I hate, hate, HATE languages
> where it's nontrivial to tell the effective type of something.)
Well AFAICS the polysemous type is an extension to the current type system.
So if you want to explicitly declare all types, you're still free to do so.
It's like the new constness, but in this case types are still backwards
compatible. Btw, a modern IDE can easily determine the inferred type by
doing on the fly semantic analysis and visualize the set of possible types.
In case you haven't noticed, even D 1.x allows you to write long functions
without binding any concrete types, for example:
T fun(T, U, ...)(T t, U u, ...) {
// some code
auto foo = t.children;
auto bar = foo.first;
foreach(c; foo) {
if (bar < c) bar = c;
}
// more code
}
More information about the Digitalmars-d
mailing list