SWI-Prolog : Out Of Local Stack



I have a DCG predicate that gets a "out of local stack" error when I
try to trace it in the graphical debugger, but works properly when I'm
not in debugging. I read in the manual that can happen because last
call optimization is turned off in the graphical debugger.

It appears to happen due to a dynamically built predicate call. If I
surround that dynamically built predicate call with call/1, then the
graphical debugger works fine. I have no problem using call/1, but if
there are any issues I need to be concerned with by using call/1, then
please let me know. If there's a good page that discusses the issues
between using call/1 and not using it, just point me to it.

There's something about the naked PredCall that causes the DCG
predicate 'C' to have problems when running in the graphical debugger.

x(WordlistFunctor) -->
% Try taking a three words and testing them as a single atom against
the desired predicate.
[W1, W2, W3],
{ concat_all([W1, W2, W3], Matched) ,
PredCall =.. [WordlistFunctor, Matched],
% PredCall, - this will cause an "out of local stack" error with the
graphical debugger.
call(PredCall) % this is OK
},
!.

.