On 2012-07-12 09:59, Jonathan M Davis wrote:

For the most part, I think that operating on Objects like that is horrible,
and we certainly don't encourage it, but it's been possible for ages, so I'm
willing to bet that there's plenty of code which does it. For instance, what's
Tango do? As I understand it, they're fairly Java-esque in their general
approach to things, so it wouldn't entirely surprise me if their containers
held Object rather than being templated (though the need to hold primitive
types may have made it so that they didn't go that route).

All containers in Tango are templated classes, interfaces or structs. Just because Tango have more of a class hierarchy and nested packages than Phobos doesn't mean it doesn't use templates.

2. Will this work with toString? How much stuff relies on being able to get a
string from Object? We've been switching everything in Phobos over to use
variadic templates, which should make it easy enough to get around that
problem (presumably, classes are then in the same boat as structs which don't
define toString), but we may have older functions which will run into problems
with this, and some stuff in other libraries could be completely screwed by
this. Again, what does Tango do? Does it use variadic templates for its print
function, or does it use D style variadics? At first glance, it seems to me
that getting rid of toString on Object would screw over its use with D style
variadics. That may or not be true, but if it is, we're closing doors on stuff
which currently works.

Tango uses D style variadics for printing.

--
/Jacob Carlborg

Reply via email to