Open3
Implements ISO's open/3: opens the source/sink named by the first argument (parsed into a it.unibo.tuprolog.solve.libs.io.Url, both proper URLs and bare filesystem paths are accepted) in the mode named by the second (read, write, or append, see it.unibo.tuprolog.solve.libs.io.IOMode), registers the resulting channel under an auto-generated alias, and unifies the third argument with its $stream(...) term. Equivalent to open/4 with an empty options list; see Open4 for the full contract, including exceptions.
?- open('theory.pl', read, Stream), read(Stream, Term), close(Stream).Content copied to clipboard