Re: Radical New Debug Tool

new topic     » goto parent     » topic index » view thread      » older message » newer message

c.k.lester wrote:
> 
> }}}
<eucode>constant vUnitTesting = find("-unittest", command_line())
> 
> if vUnitTesting then
>     debug 1 -- instead of a 'with debug' use 'debug X' where x is true or
>             -- false (default setting)
> end if</eucode>
{{{

> 
> Would that work better?  I guess you could even mix types at that point,
> though I can't imagine a scenario where that would be beneficial/useful.

If we did it the same way as trace, I think that would work fine.
with debug  -- at the top of the program, compiler parses dotted code as
-- conditionally executed statement blocks.
debug(0) -- do not execute dotted code
debug(1) -- execute code with a single dot
debug(2) -- execute code with one or two dots
debug(3) -- execute code with one, two, or three dots
etc.

This would already be familiar from the way trace works, and if "with trace"
is omitted from the top, all dotted code would be compiled as comments and
debug() calls would end up doing nothing (probably also optimized out of
the resultant IL).

It may be a little more complicated than the original; but I think it would 
be a valuable enhancement.  Perhaps the with debug and dot parsing could be
done in one release (with debug(1) as the default), and debug() calls in 
another.  I know you recommended the calls without parentheses, but I can
easily see myself getting tripped up by that for being so different from
anything else Euphoria does.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu