logo       

Re: SWI-Prolog 5.6.0 problem.: msg#01624

Subject: Re: SWI-Prolog 5.6.0 problem.

On 2005/12/31, at 10:38, Martin Sondergaard wrote:

I've found a problem with the new version, 5.6.0.
I'm using Windows XP.

I can't get "read_line_to_codes" to work.


6 ?- read_line_to_codes(user, X).
ERROR: read_util:read_line_to_codes/2: stream `user' does not exist
ERROR: Unhandled exception: _G1

The same on MacOS X 10.4. A quick read of the documentation states that read_line_to_codes/2 requires that the first argument be a stream. It's not clear that a stream alias ("user" in this case) can also be used. In addition, the alias "user" does not seam to be associated with the default input stream. Try:

        ?- current_input(S), stream_property(S, P).

Your goal will work if you use "user_input" instead of "user". In fact, The ISO Prolog standard specifies in section 7.1.0.2.3 the aliases "user_input" and "user_output" for the predefined standard input and output streams.

Jan: I would expect that stream_property/2 would return the property alias(user_input) for the current input stream at startup; similar for the current output stream.

Cheers,

Paulo


-----------------------------------------------------------------
Paulo Jorge Lopes de Moura
Dep. of Informatics, University of Beira Interior
6201-001 Covilhã, Portugal

Office 4.3  Ext. 3257
Phone: +351 275319700 Fax: +351 275319899
Email: <mailto:pmoura@xxxxxxxxx>

Home page: <http://www.di.ubi.pt/~pmoura>
Research: <http://www.logtalk.org/>
-----------------------------------------------------------------






<Prev in Thread] Current Thread [Next in Thread>