[mercury-users] carriage return escaping

Michael Day mikeday at bigpond.net.au
Tue Aug 28 13:56:46 AEST 2001


Can anyone explain why the output of the program below is:


on my system rather than:





'\r' seems to be converted into the number 13 in the generated C code,
which seems correct. "\r" is getting converted to ^M, not sure exactly
what that is in this case.


:- module return.

:- interface.

:- import_module io.

:- pred main(io__state, io__state).
:- mode main(di, uo) is det.

:- implementation.

:- import_module char, string.

main -->
    write("\r"), nl,
    write('\r'), nl.

mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe

More information about the users mailing list