diff options
Diffstat (limited to 'stdlib.pl')
-rw-r--r-- | stdlib.pl | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -110,6 +110,29 @@ open(SourceSink, Mode, Stream) :- close(StreamOrAlias) :- close(StreamOrAlias, []). +flush_output :- + current_output(S), + flush_output(S). + +stream_property(S, P) :- + stream_properties(Props), + member(prop(S,P), Props). + +at_end_of_stream :- + current_input(S), + stream_property(S, end_of_stream(E)), + !, + (E = at ; E = past). + +at_end_of_stream(S_or_a) :- + ( atom(S_or_a) + -> stream_property(S, alias(S_or_a)) + ; S = S_or_a + ), + stream_property(S, end_of_stream(E)), + !, + (E = at; E = past). + % Standard exceptions instantiation_error :- |