implement less defaulty interface in cont.pl

This commit is contained in:
Mark Thom
2019-12-23 12:19:18 -07:00
parent dded56af78
commit 85e37a9977
3 changed files with 15 additions and 6 deletions

View File

@@ -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'.