I am looking for a predicate that captures the goal from the interactive mode.
When I am in the interactive mode, I would like something like this:
Welcome to SWI-Prolog (threaded, 64 bits, version 8.0.3) SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software. Please run ?- license. for legal details. For online help and background, visit http://www.swi-prolog.org For built-in help, use ?- help(Topic). or ?- apropos(Word). ?- append([this, is, some], [predicate], X), capture_goal(G). X = [this, is, some, predicate], G = ['append([this, is, some], [predicate], X)', 'capture_goal(G)'].
I know how to capture the command line entry with
current_prolog_glag(os_argv, Args) but I want to capture the goal inside the interactive mode.
swipl -g is not an option for me.