From jan@swi.psy.uva.nl  Fri May 21 15:56:27 1999
Received: from gollem.swi.psy.uva.nl (jan@gollem.swi.psy.uva.nl [145.18.114.15])
	by swi.swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id PAA20917
	for <prolog@swi.psy.uva.nl>; Fri, 21 May 1999 15:56:26 +0200 (MET DST)
Received: from localhost (localhost [[UNIX: localhost]])
	by gollem.swi.psy.uva.nl (8.8.8/8.8.8) id PAA08426;
	Fri, 21 May 1999 15:57:31 +0200
From: Jan Wielemaker <jan@swi.psy.uva.nl>
To: fadushin@blackcat.cat.syr.edu, Fred Dushin <fadushin@blackcat.cat.syr.edu>
Subject: Re: the meaning of ";"
Date: Fri, 21 May 1999 15:48:39 +0200
X-Mailer: KMail [version 0.7.9]
Content-Type: text/plain
Cc: "'prolog@swi.psy.uva.nl'" <prolog@swi.psy.uva.nl>
References: <Pine.LNX.4.00.9905210924460.1680-100000@blackcat.cat.syr.edu>
MIME-Version: 1.0
Message-Id: <99052115573106.06993@gollem>
Content-Transfer-Encoding: 8bit

On Fri, 21 May 1999, Fred Dushin wrote:
>Do you mean '()' or '(t_1, ..., t_n)'?
>
>In general, () is used by the prolog parser to group terms
>using infix operators (',', ';', etc.)  Jan may have
>a better answer to this.
>
>An interesting observation:  ',' is a *binary* functor,
>despite its occurrence in terms like '(t_1, ..., t_n)'.
>Internally, such a term has the following represenatation:
>
>	','( t_1, ','( t_1, ..., ','( t_{n-1}, t_n )...))
>
>Maybe Jab can clarify for other cases, like ';' or user-defined
>operators.
>
>-Fred

() has two meanings.  If proceeded by a functor (i.e. there is
an atom in front of it without a space betweeen the atom and the
'(' as in 'foo(', it delimits an argument list.  The arguments
themselves are separated by the ','.

In all other cases, () takes and expression and reduces the operator
precedence of it to 0.  Effectively this deals with grouping, but it
can also be useful to deal with groups of 1 element: reduce an operator
to an atom to avoid a precedence conflict.

After being parsed, there is no way to tell how the term was written.
I.e. =:=(2,1+1) is the same as 2 =:= 1+1 is the same as 2 =:= (1+1),
etc.

	Regards --- Jan 

