Re: Radical New Debug Tool
- Posted by c.k.lester <euphoric at ck?ester?com> Aug 10, 2007
- 457 views
Michael J. Sabal wrote: > c.k.lester wrote: > > When a . begins a line, it is considered debug code. > For simple projects, I would likely use this method; but for more complicated > or distributed projects, I would probably use the more classic "if DEBUG > then" method. Here's why: any "with" statement cannot (and should not) be > defined within an "if". I say "should not" because Euphoria does not > presently support compiler directives (e.g., conditional includes). What about my mod of Derek's code?
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
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.