, . library (readutil), read_line_to_codes/2, , .
, / , , , ISO. "/ " ", , SWI-Prolog. :
get_line(L) :-
get_code(C),
get_line_1(C, L).
get_line_1(-1, []) :- !. % EOF
get_line_1(0'\n, []) :- !. % EOL
get_line_1(C, [C|Cs]) :-
get_code(C1),
get_line_1(C1, Cs).
, , ; read_line_to_codes/2 (readutil).
strings Prolog, . , , :
read_string(user_input, _, S),
split_string(S, "\n", "", Lines)
. read_string/5 linewise.
PS. see seen .. :
setup_call_cleanup(open(Filename, read, In),
read_string(In, N, S), % or whatever reading you need to do
close(In))
user1812457