From 9691a0843dc3b898bf653eb41f872a8f6985af66 Mon Sep 17 00:00:00 2001 From: ubu32 Date: Mon, 14 Feb 2011 11:28:44 -0800 Subject: [PATCH] port flush predicates. --- pl/boot.yap | 17 +++++++++++++---- pl/consult.yap | 1 - pl/yio.yap | 6 ------ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/pl/boot.yap b/pl/boot.yap index 0a9050f85..01a62a75a 100755 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -610,7 +610,7 @@ true :- true. % the arguments. % '$present_answer'(_,_):- - '$flush_all_streams', + flush_output, fail. '$present_answer'((?-), Answ) :- nb_getval('$break',BL), @@ -648,8 +648,8 @@ true :- true. '$skip'(user_input,10), '$ask_again_for_another' ). -'$add_nl_outside_console' :- - '$is_same_tty'(user_input, user_error), !. +%'$add_nl_outside_console' :- +% '$is_same_tty'(user_input, user_error), !. '$add_nl_outside_console' :- format(user_error,'~n',[]). @@ -658,7 +658,7 @@ true :- true. '$another'. '$write_answer'(_,_,_) :- - '$flush_all_streams', + flush_output, fail. '$write_answer'(Vs, LBlk, FLAnsw) :- '$purge_dontcares'(Vs,IVs), @@ -1430,3 +1430,12 @@ prompt1(X) :- swi_prompt1(X). prompt(Old, New) :- swi_prompt(Old, New). + +flush_output :- + swi_flush_output. +flush_output(Stream) :- + swi_flush_output(Stream). +ttyflush :- + swi_ttyflush. + + diff --git a/pl/consult.yap b/pl/consult.yap index b6061c6f4..138b58fd1 100755 --- a/pl/consult.yap +++ b/pl/consult.yap @@ -290,7 +290,6 @@ use_module(M,F,Is) :- nb_setval('$consulting',Old), nb_setval('$consulting_file',OldF), cd(OldD), - nb_setval('$if_level',OldIncludeLevel), % surely, we were in run mode or we would not have included the file! nb_setval('$if_skip_mode',run), % back to include mode! diff --git a/pl/yio.yap b/pl/yio.yap index c8e30b4be..313272746 100644 --- a/pl/yio.yap +++ b/pl/yio.yap @@ -594,12 +594,6 @@ ttyput(N) :- N1 is N, '$put'(user_output,N1). ttynl :- nl(user_output). -ttyflush :- flush_output(user_output). - -flush_output :- - current_output(Stream), - flush_output(Stream). - current_line_number(N) :- current_input(Stream), line_count(Stream, N).