
28 Nov
2003
28 Nov
'03
12:08 p.m.
On Thu, Nov 27, 2003 at 02:19:53PM +0000, Malcolm Wallace wrote:
Apart from changing the evaluation order of expressions, trace has other drawbacks, noted I think by Lennart(?) but I can't remember exactly where. One issue is this:
Consider an expression where the printable argument to 'trace' causes the evaluation of another expression which itself is defined using 'trace'. The nested 'trace' outputs will appear interspersed with each other. In recursive definitions this can become quite painful to disentangle.
Perhaps trace should be redefined: trace msg v = foldr seq (old_trace msg v) msg