refining the interpreter

parent 15d38ab6
......@@ -25,6 +25,8 @@
(define -all- (make-fluid false))
(<wrap> add-fluid-dynamics -all-)
(define -nsol- (make-fluid false))
(define *user-data* (make-fluid vlist-null))
(<wrap> add-vhash-dynamics *user-data*)
(<define> (user_set a v)
......@@ -213,7 +215,15 @@
((@ (guile) if) #f #f)))
(cont
`((@ (logic guile-log) <continue>)))
`((@ (guile) begin)
((@ (guile) fluid-set!)
(@@ (logic guile-log guile-prolog interpreter) -nsol-)
,(cond
(all? '(@ (logic guile-log iso-prolog) true))
(nn? nn?)
(else
'(@ (logic guile-log iso-prolog) false))))
((@ (logic guile-log) <continue>))))
(fail?
'((@ (guile) begin)
......@@ -295,7 +305,6 @@ HELP FOR PROLOG COMMANDS
(#(XL) #(YL) (<cut> (vtosym4 XL YL I H)))
(_ _ (<cut> <fail>))))
(define -nsol- (make-fluid false))
(<wrap> add-fluid-dynamics -nsol-)
(<define> (wrap_namespace x y yy)
......@@ -387,6 +396,8 @@ write_out([V|Vs],[N|Ns])
write_out(Vs,Ns).
wstall :- stall.
more :-
scm[(fluid-ref -all-)] == true -> fail ;
(
......@@ -395,12 +406,13 @@ more :-
N == true -> fail ;
integer(N) -> (N > 1 -> (do[(fluid-set! -nsol- (- (<lookup> N) 1))],
fail)
; throw(finish)) ;
readline(\"more (y/n/a) > \",Ans),
; wstall ,fail) ;
readline(\"more (y/n/a/s) > \",Ans),
(
Ans == \"y\" -> fail ;
Ans == \"n\" -> throw(finish) ;
Ans == \"a\" -> scm[(fluid-set! -all- true)]==1 ;
Ans == \"a\" -> scm[(fluid-set! -all- true)]==1 ;
Ans == \"s\" -> stall, fail ;
write(\" wrong input\"),nl,more
)
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment