implement less defaulty interface in cont.pl
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
|
||||
:- module(cont, [reset/3, shift/1]).
|
||||
|
||||
reset(Goal, Cont, Term) :-
|
||||
reset(Goal, Ball, Cont) :-
|
||||
call(Goal),
|
||||
'$reset_cont_marker',
|
||||
'$bind_from_register'(Cont, 3),
|
||||
'$bind_from_register'(Term, 4).
|
||||
'$bind_from_register'(Ball, 4).
|
||||
|
||||
shift(Term) :-
|
||||
'$nextEP'(first, E, P),
|
||||
get_chunks(E, P, L),
|
||||
Cont = cont(call_continuation(L)),
|
||||
( L == [] ->
|
||||
Cont = none
|
||||
; Cont = cont(call_continuation(L))
|
||||
),
|
||||
'$write_cont_and_term'(_, _, Cont, Term),
|
||||
'$unwind_environments'.
|
||||
|
||||
|
||||
@@ -2197,8 +2197,12 @@ impl MachineState {
|
||||
self.reset_block(addr);
|
||||
}
|
||||
&SystemClauseType::ResetContinuationMarker => {
|
||||
self[temp_v!(3)] = Addr::Con(Constant::Integer(Integer::from(0)));
|
||||
self[temp_v!(4)] = Addr::Con(Constant::Integer(Integer::from(0)));
|
||||
self[temp_v!(3)] = Addr::Con(Constant::Atom(clause_name!("none"), None));
|
||||
|
||||
let h = self.heap.h;
|
||||
self.heap.push(HeapCellValue::Addr(Addr::HeapCell(h)));
|
||||
|
||||
self[temp_v!(4)] = Addr::HeapCell(h);
|
||||
}
|
||||
&SystemClauseType::SetBall =>
|
||||
self.set_ball(),
|
||||
|
||||
Reference in New Issue
Block a user