use newly available library predicate read_n_chars/3
:- use_module(library(freeze)).
:- use_module(library(iso_ext), [setup_call_cleanup/3, partial_string/1, partial_string/3]).
:- use_module(library(lists), [member/2, maplist/2]).
+:- use_module(library(charsio), [read_n_chars/3]).
:- meta_predicate(phrase_from_file(2, ?)).
:- meta_predicate(phrase_from_file(2, ?, ?)).
@@ -42,7 +43,7 @@ reader_step(Stream, Pos, Xs0) :-
set_stream_position(Stream, Pos),
( at_end_of_stream(Stream)
-> Xs0 = []
- ; '$get_n_chars'(Stream, 4096, Cs),
+ ; read_n_chars(Stream, 4096, Cs),
partial_string(Cs, Xs0, Xs),
stream_to_lazy_list(Stream, Xs)
).
