[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Patch to remove auto-casting between numbers and strings
- From: Andreas Stenius <kaos@...>
- Date: Mon, 11 Sep 2006 11:48:03 +0200
Mark Hamburg skrev:
> [...] I really wish there were a code in string.format for
"take the corresponding argument and run it through tostring". This would
help a lot when generating debugging output where the data may have
arbitrary types.
I agree. One suggestion would be to add another option to string.format
that means "debugging format" and the passed data can put in whatever is
meaningful for the type in question (optionally with support for a
__debug metamethod that returns the string value to use).
I've not come up with this, not sure who has, but it's available in pike
(http://pike.ida.liu.se)
Pike btw has more nice format features, take a look at:
http://pike.ida.liu.se/generated/manual/modref/ex/predef_3A_3A/sprintf.html
Regards,
Andreas