Closed giovinazzo-kevin closed 11 months ago
A good 80% of the work is done.
Input and output streams can be redirected at the Facade
level, and then individually at the Console
and Solver
levels.
Error streams are not being used for the moment but they are correctly set up.
Predicates that read and write now do so from the relevant streams.
A new interface, IInputReader
, has been added to provide GetKey
functionality. The default implementation, ConsoleInputReader
, defaults to Console.ReadKey
and is suitable for the main shell.
TODO: Further decouple System.Console from Ergo Shell, creating an intermediate IConsole
interface, represent streams as Ergo objects.
Closing for now, since the current pipes work fine. Further work is warranted but not necessary
https://www.swi-prolog.org/pldoc/man?section=IO
Merging Ergo with Fiero has uncovered a serious refactoring urge: the Shell needs to be decoupled from the OS's standard streams.
All write and read predicates should be tweaked to work on streams and an equivalent to set_prolog_IO/3 should be introduced.