When new data is to be read from an input stream, the system prints on the specified output stream a prompt, to notify the user.
InStream (and OutStream, when instantiated) can be a symbolic stream name (atom) or a physical stream number (integer). InStream must be an existing stream open in read or update mode. OutStream must be open in write or update mode.
Note that the prompt for toplevel-input printed by the system at the end of each query is made using the predicate toplevel-prompt/1 and not by using the string set by set_prompt/3.
Success: [eclipse]: get_prompt(debug_input,_,input),% find where the % prompt is output; > set_prompt(debug_input,"> ",input). % change it yes. % destructively. [eclipse]: read(X). > a. X = a yes. [eclipse]: get_prompt(input, Old, Out), > set_prompt(input, "Enter a term: ", Out), read(X). Enter a term: a. Old = "> " Out = 1 X = a yes. [eclipse]: get_stream(debug_input,S), % debug input prompt > set_prompt(S, " DEBUG: ", 1). S = 3 yes. [eclipse]: trace. yes. [eclipse]: atom_string(atom, String). B (1) 0 CALL atom_string(atom, _g52) DEBUG: creep B (1) 0 EXIT atom_string(atom, "atom") DEBUG: creep String = "atom" yes. Fail: get_prompt(0,"",S). Error: get_prompt(I, "p", Stream). (Error 4). get_prompt(0, Prompt, "5"). (Error 5). get_prompt(1, Prompt, 2). (Error 192). % 1 in write mode get_prompt(0, Prompt, 30). (Error 193). % no such stream