It would be very useful for debugging to support custom tracing. At its simplest something like...
/ Future ooRexx release /
call on EACHCLAUSE
-- code here
/ Custom watch handler /
-- condition delayed until return
if x > 0 | y < 0 then do
say '*** Watch triggered, Line=' sigl
say 'Watch: X=' || x ', Y=' y
-- ?? EACHCLAUSE remains delayed during
-- interactive trace
/ I have no idea how much overhead would be
involved. Maybe it should require an invocation
of a new option of TRACE to enable. To take it further...
/ Multiple Watch Handlers /
trace 'W' -- enable custom watch handling
-- WATCH condition raised if expr = .true
call on WATCH 'WATCH1' (x > 0 | y < 0)
call on WATCH 'WATCH2' (s \== '')
-- WATCH condition raised if X or Y changes value
call on WATCH 'WATCH1' VAR X Y
-- handler: display name, expr, etc.
/ Maybe it could be used from the trace prompt
to enter one-off watches:
trace> call on watch NONAME (x = 0) TRACE ?I
trace> trace 999
back to trace prompt after (x = 0) or 999 clauses/
/ eventually it would be nice if signal and call
handlers could be defined for CLASSes or PACKAGEs.