From jan@swi.psy.uva.nl  Mon Oct 25 10:00:02 1999
Received: from gollem.swi.psy.uva.nl (root@gollem [145.18.114.15])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id KAA07511
	for <prolog@swi.psy.uva.nl>; Mon, 25 Oct 1999 10:00:02 +0200 (MET DST)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3) id KAA32050
	for prolog@swi.psy.uva.nl; Mon, 25 Oct 1999 10:01:20 +0200
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Organization: SWI, University of Amsterdam
To: prolog@swi.psy.uva.nl
Subject: Re: single quotes
Date: Mon, 25 Oct 1999 09:54:59 +0200
X-Mailer: KMail [version 1.0.21]
Content-Type: text/plain
References: <199910250641.OAA24663@sun1000.cc.nctu.edu.tw>
MIME-Version: 1.0
Message-Id: <99102510012000.31764@gollem>
Content-Transfer-Encoding: 8bit

On Mon, 25 Oct 1999, clee@cc.NCTU.edu.tw wrote:
>I am using SWI-Prolog 3.2.8 for Windows.  According to Clocksin and
>Mellish (1987):
>
>	"If an atom is enclosed in single quotes "'", then the atom 
>	may have any characters in its name." p. 22.
>
>However, in the following statement for a finite state transducer:
>
>	arc(0,1,'-'/a).
>
>I get the following error message from SWI-Prolog:
>
>	[WARNING: (d:/pl/bin/test.pl:1)
>	        d:/pl/bin/test.pl:1: Syntax error: Operator expected]
>
>If I change '-' to a simple atom, then there is no problem.  If I change the
>arc statement to:
>
>	arc(0,1,a/'-').
>
>There there is no problem.  I do not find this problem with Sicstus Prolog.
>
>What is going on here?

- is an operator (prefix and infix) with higher priority than / and
thus cannot an argument of /.  Now, this is the basic rule.  I tried
this on Quintus, which gives a syntax-error too.  Both SWI and SICStus
are a bit more liberal and try to read non-ambiguous constructs without
warning.  Appearently this fails for this case in SWI-Prolog.

The ISO standard demands this term to be written as

	arc(0, 1, (-)/a)

which is also expressed by SICSTus:

	| ?- write(arc(0, 1, '-'/a)).
	arc(0,1,(-)/a)
	yes

	Regards --- Jan

