Re: [SWIPL] Unwanted prompt in the output

Jan Wielemaker wrote:
On Mon, Oct 25, 2004 at 12:52:04PM +0200, Roberto Bagnara wrote:
I have question: if I create a file that contains only a blank line (i.e., "\n") and I call it `test' and I do `pl <test >out', the `out' file contains the string "1 ?- | ". Notice that, to avoid ambiguities I am using the C syntax for strings, so by omitting "\n" I imply that the line above is not terminated. However, the problem is the presence of "| ", not the absence of the end-of-line character.
If I modify the `test' file so that it contains two lines, one blank as before followed by one containing "halt.\n" and I do the same thing as before, `out' will then contain "1 ?- ", i.e., without the vertical bar. Is this behavior the intended one? I have tested with several other Prolog systems and they do not seem to make this kind of distinction between EOF on input or an explicit "halt." occurring in it.
I'd have to do some tracing and debugging to find the why. Actually I think there should be no prompt (at least by default) if the input is not associated to a terminal.
Hi Jan,
that is exactly what I was thinking: if there is no terminal there should be no prompt.
For the moment, I guess using the prompt/2 command to kill the prompt is the most sensible thing to do.
Will do as you suggest. Thanks a lot,
Roberto
participants (1)
-
Roberto Bagnara