I’m using: SWI-Prolog version 8.0.1
I’ve written a prolog program that generates some prolog code. To use the generated code later, it is written to a file.
To test the generated code I do something like this:
test_code :-
Code = [(add(A, B, C) :- C is A + B)],
open('generated.pl', write, OutStream),
maplist(portray_clause(OutStream), Code),
close(OutStream),
consult('generated.pl'),
add(1, 2, 3).
Is it possible to load the code without writing it to a file? If so how can the code be loaded?
Thank you