From liraola@opera.dia.fi.upm.es  Fri Feb 11 14:02:31 2000
Received: from goofy.fi.upm.es (goofy.fi.upm.es [138.100.8.23])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id OAA07402
	for <prolog@swi.psy.uva.nl>; Fri, 11 Feb 2000 14:02:31 +0100 (MET)
Received: from conversion.relay.fi.upm.es by relay.fi.upm.es
 (PMDF V5.2-32 #39034) id <01JLS84NQEGW00086W@relay.fi.upm.es> for
 prolog@swi.psy.uva.nl; Fri, 11 Feb 2000 13:58:23 MET
Received: from opera.dia.fi.upm.es (opera.dia.fi.upm.es [138.100.11.43])
 by relay.fi.upm.es (PMDF V5.2-32 #39034)
 with ESMTP id <01JLS84NGP1S0008FU@relay.fi.upm.es> for prolog@swi.psy.uva.nl;
 Fri, 11 Feb 2000 13:58:23 +0100 (MET)
Received: from localhost by opera.dia.fi.upm.es (8.8.4/FI-4.1) Fri,
 11 Feb 2000 13:57:20 GMT
Date: Fri, 11 Feb 2000 13:57:19 +0000 (WET DST)
From: Luis Iraola Moreno <liraola@opera.dia.fi.upm.es>
Subject: More on escape sequences
In-reply-to: <Pine.SOL.3.95.1000211120217.3737D-100000@opera>
X-Sender: liraola@opera
To: prolog@swi.psy.uva.nl
Message-id: <Pine.SOL.3.95.1000211134301.3737G-100000@opera>
MIME-version: 1.0
Content-type: TEXT/PLAIN; charset=US-ASCII


Hello again,

For writing atoms and strings using escape sequences I have tried write/2
with the options [quoted=true, character_escapes=true].

Everything works fine for atoms:

?- write('a''b
c', [quoted=true, character_escapes=true]).

'a\'b\nc'

yes.

But the same goal with a string does not insert the appropriate escape
sequences:

?- write("a""b
c", [quoted=true, character_escapes=true]).

"a""b
c"

yes.

(I was expecting "a\"b\nc" instead).

It seems like escape sequences work well for atoms (when reading,
concatenating and writing) but not so well (just reading) for strings.

Best regards,

Luis.

