The implicit conversion between Prolog and Tcl/Tk data is performed in the tcl/3 predicate (Prolog variables are converted to Tcl strings and the resulting Tcl value is converted to Prolog), and by the Tcl command prolog (goal arguments are converted to Prolog and values of Prolog variables are converted to Tcl). (On the other hand, the command call_prolog does not convert Tcl to Prolog, its argument is parsed as a Prolog text.) The implicit conversion is quite intuitive, however there are several subtle incompatibilities caused by the different philosophy of the two languages:
[eclipse 7]: tclsh. % prolog {atom a} fail % prolog {string a} success
As a special case, there is no nil atom in Tcl - the string {} which Prolog users may expect to be equivalent to Prolog's [] is in fact an empty string.
To pass Tcl strings containing spaces to Prolog as strings, the resulting type of the tcl/3 predicate can be specified in a way similar to call_c/2 .[eclipse 5]: tclsh. % prolog {writeq {a b c}} ["a", "b", "c"]success % prolog {writeq "a b c"} ["a", "b", "c"]success