From jan@swi.psy.uva.nl Tue Feb 13 11:54:29 2001
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.152.30])
	by swi.psy.uva.nl (8.11.2/8.11.2) with ESMTP id f1DAsTZ14687;
	Tue, 13 Feb 2001 11:54:29 +0100 (MET)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id LAA01291;
	Tue, 13 Feb 2001 11:54:28 +0100
Date: Tue, 13 Feb 2001 11:54:28 +0100
Message-Id: <200102131054.LAA01291@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: [SWIPL] writef bug?
To: "Samoocha, Jonatan" <Jonatan.Samoocha@ps.net>,
   prolog@gollem.swi.psy.uva.nl
In-Reply-To: Samoocha, Jonatan's message of Tue, 13 Feb 2001 10:44:26 -0000
Phone: +31 - 20 - 525 6121

> According to the writef/2 help, the string '\\' should print a (single)
> backslash character.
> However, using SWI-prolog version 3.4.4 (NT), I get the following error:
> 
> ?- writef('\\').
> ERROR: Arithmetic: `''/0' is not a function
> ?- 
> 
> Is this a bug or am I doing something really stupid?

Using writef :-)

The problem is that ISO character escapes interfere with writef.  So ISO
turns writef('\\') into writef(\), which makes writef unhappy.  This
requires a bit of thinking. To write a \ you need \\\\. To write a
newline however \\n and \n produce the same result.

I would suggest using format/[2,3].  

	--- Jan

