On Mon, Jun 14, 2010 at 12:57:29PM +0200, Emil Jerabek wrote:
On Mon, Jun 14, 2010 at 11:32:12AM +0200, spir wrote:
Is it at all possible to write the following 'show' tool func: show(x); // 'x : 1' --> stdout show(x+1); // 'x+1 : 2' --> stdout ? (my dream debugging tool)
Not a function, I guess, but you can do this easily with a preprocessor macro:
{$define show(X...) writeln (#X ': ', X)}
(The dots make it accept more than one argument.)
Better yet, debugging info should probably go to stderr rather than stdout:
{$define show(X...) writeln (stderr, #X ': ', X)}
Regards, Emil