ulr...@mips.complang.tuwien.ac.at (Ulrich Neumerkel) schrieb:
> ?- Term = ':- write(\'Hello, world!\'), nl.',
> with_input_from(atom(Term, Stream), load_files(hello,
> [stream(Stream)]).
> Some way to load/compile programs more flexibly does make
> some sense, probably everyone has done it in one way or
> another.
I have the feeling that somebody is trolling here somebody
else, and he doesn't recognize it.
I guess it is not too much of a stretch to claim that it
is too far fetching to see the need of non-pure elements
to solve the problem of the op.
I feel the following predicates are 100% pure, they don't
have any side effects:
read_from_codes/2 (*)
call/1
So what the op tries above can be done without any load
files, it can be directly done as follows:
?- read_from_codes("write(\'Hello, world!\'), nl", X),
call(X).
Bye
(*)
http://prolog-commons.org/PrologCommons.html/codesio.html