A Prolog predicate may succeed, fail or exit using exit_block/1 . The prolog command returns a string success, fail or error depending on the result of the Prolog call:
[eclipse 19]: tclsh. % prolog true success % prolog fail fail % prolog "exit_block 1" error %
The Prolog goal can also contain Prolog variables: top level arguments of Prolog predicates called from Tcl, which start with an upper case character, are interpreted and passed to Prolog as variables:
Note that this is the case only for top level arguments of Prolog predicates; list arguments are passed as strings:[eclipse 23]: tclsh. % prolog "var X" success
[eclipse 15]: tclsh. % prolog {printf "%Qw%n" A} _366 success % prolog {printf "%Qw%Qw%Qw%n" {A B C}} "A""B""C" success