Stream may be a physical stream number or a reserved or user-defined symbolic stream name. The stream can be of any type, e.g. file, tty, socket, queue, string, etc.
If Stream is an opened input stream, its content is read and compiled as in compile/1. The compilation stops at the stream end, but the stream remains open.
compile_string(String) :-
open(string(String), read, S),
compile_stream(S),
close(S).
Error:
compile_stream(X). (Error 4).
compile_stream(1.0). (Error 5).
compile_stream(1). (Error 192).
compile_stream(2). (Error 192).
compile_stream(20). (Error 192).
compile_stream(a). (Error 193).