[m-dev.] A flavour of programming in Opium

Erwan Jahier Erwan.Jahier at irisa.fr
Mon Jun 8 17:30:01 AEST 1998


Fergus Henderson wrote:
> > skip_np :-
> >       current_pred(PredName),
> >       f_get(-,-,-,[exit, port],-, PredName,-,-,-,-).
> 
> That's not the correct behaviour.
> You don't want to skip until a final port for the same PredName,
> nor even until a final port for the same predicate
> (= <pred or func> module:predname/arity).  Rather,
> you want to skip until a final port for the same _call_.

Yes you are rigth. 

skip_np :-
	current_line(-, CallNumber, Depth, -, Module, PredName, Arity,
ModeNum,-,-,-),
	f_get(-, CallNumber, Depth, [exit, port], Module, PredName, Arity,
ModeNum,-,-,-).


> > skip :-
> >       finish_np,
> >       print_line.
> 
> Presumably you meant s/finish_np/skip_np/.

Yes.


> > > continue
> > >         Continues execution until it reaches the end of the program.
> >
> > continue :-
> >       f_get(1,1,1,exit,-,main,-,-,-,-,-,-).
> 
> This is not correct behaviour -- you missed part of the spec:
> 
> | strict commands:
> | When a debugger command steps over some events without user interaction at
> | those events, the *strictness* of the command controls whether the debugger
> | will stop execution and resume user interaction at events to which a spy point
> | or break point with state "stop" applies. By default, the debugger will stop
> | at such events.
> 
> "continue" was not specified as being "strict", so it needs to stop at
> break/spy points .

OK, but it my intend was not really to implement the *continue*
predicate but to show how simply you can scecify a request the move
forward until the end of the trace.
Anyway, I think my leap/0 does that job (assuming that the execution
stops at the last event, which is desirable).

Morover, now you have implemented a spy point mechanism, we could use it
(if it is really more efficient, which is not certain) and then my
continue/0 predicate would have the rigth behaviour. 

Again my intend was to show how simply we can implement features such as
spy points within Opium (and, in order to keep it very simple, my spy/1
doesn't exactly match your specification neither ;-). 


-- 
R1.



More information about the developers mailing list