3 points

Emil Jerabek jerabek at math.cas.cz
Mon Jun 14 12:57:29 CEST 2010


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.)

Kind regards,
Emil Jerabek





More information about the Gpc mailing list