D - printf_assert
- "Matthew" <matthew stlsoft.org> Mar 14 2004
- Piotr Fusik <Piotr_member pathlink.com> Mar 14 2004
- J C Calvarese <jcc7 cox.net> Mar 14 2004
- "Matthew" <matthew stlsoft.org> Mar 14 2004
- J Anderson <REMOVEanderson badmama.com.au> Mar 14 2004
We could really do with a printf_assert(), in order to print out details of asserts and assert in a single statement
Mar 14 2004
We could really do with a printf_assert(), in order to print out details of asserts and assert in a single statement
assert foo == bar, "foo=$foo bar=$bar"; or (Java-like): assert foo == bar : "foo " ~ foo ~ " bar=" ~ bar;
Mar 14 2004
Piotr Fusik wrote:We could really do with a printf_assert(), in order to print out details of asserts and assert in a single statement
I'd prefer: assert foo == bar, "foo=$foo bar=$bar"; or (Java-like): assert foo == bar : "foo " ~ foo ~ " bar=" ~ bar;
assert(x==1, "x: %d", x); assert(testExpression, formattingString, ...); (I like the parentheses on assert.) I think adding optional output options on assert would be great. I think I'd use it often. -- Justin http://jcc_7.tripod.com/d/
Mar 14 2004
"J C Calvarese" <jcc7 cox.net> wrote in message news:c31vsi$vo6$1 digitaldaemon.com...Piotr Fusik wrote:We could really do with a printf_assert(), in order to print out details
asserts and assert in a single statement
I'd prefer: assert foo == bar, "foo=$foo bar=$bar"; or (Java-like): assert foo == bar : "foo " ~ foo ~ " bar=" ~ bar;
assert(x==1, "x: %d", x); assert(testExpression, formattingString, ...);
That's a good suggestion. I've spent heaps of time putting printf stuff in and around invariants this w/e, as I've been working on DTL containers. Lists were especially assertive ... ;)(I like the parentheses on assert.)
Indeed.
Mar 14 2004
J C Calvarese wrote:I'd prefer: assert(x==1, "x: %d", x); assert(testExpression, formattingString, ...); (I like the parentheses on assert.) I think adding optional output options on assert would be great. I think I'd use it often.
Me too. It's just common sense that assert with printf functionality would look like this. C/C++ programmers will instantly know how to use this. -- -Anderson: http://badmama.com.au/~anderson/
Mar 14 2004









"Matthew" <matthew stlsoft.org> 