D - No toString() for built in types?
- "Matthew" <matthew.hat stlsoft.dot.org> Jan 05 2004
- J Anderson <REMOVEanderson badmama.com.au> Jan 05 2004
- "Matthew" <matthew.hat stlsoft.dot.org> Jan 05 2004
- "C" <dont respond.com> Jan 05 2004
I'd like to be able to call toString() as a member for built-in types, as
in:
int i;
printf("%.*s\n", i.toString());
That way I can write generic code that will work for built-ins and Object
derived ones.
Jan 05 2004
Matthew wrote:I'd like to be able to call toString() as a member for built-in types, as in: int i; printf("%.*s\n", i.toString()); That way I can write generic code that will work for built-ins and Object derived ones.
wrap the toString calls in functions. But I think you already know that. Anderson
Jan 05 2004
Matthew wrote:I'd like to be able to call toString() as a member for built-in types, as in: int i; printf("%.*s\n", i.toString()); That way I can write generic code that will work for built-ins and Object derived ones.
wrap the toString calls in functions. But I think you already know that.
Sure. We can use shims, but shims are (in my own little world at least - http://www.cuj.com/documents/s=8681/cuj0308wilson/) in large part a fix for C++'s inadequacies. I've no doubt they'll feature in D to a significant extent, but anywhere we can do without is a boon to readability, even if it makes no difference to performance and expressiveness.
Jan 05 2004
Seconded , I think this little bit will go a long way for the language. C "Matthew" <matthew.hat stlsoft.dot.org> wrote in message news:btbpjq$2fa1$1 digitaldaemon.com...I'd like to be able to call toString() as a member for built-in types, as in: int i; printf("%.*s\n", i.toString()); That way I can write generic code that will work for built-ins and Object derived ones.
Jan 05 2004









"Matthew" <matthew.hat stlsoft.dot.org> 