From jan@swi.psy.uva.nl Mon May 21 22:18:39 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 f4LKIc301509;
	Mon, 21 May 2001 22:18:38 +0200 (MET DST)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.11.2/8.11.2/SuSE Linux 8.11.1-0.5) id f4LKIc525970;
	Mon, 21 May 2001 22:18:38 +0200
Date: Mon, 21 May 2001 22:18:38 +0200
Message-Id: <200105212018.f4LKIc525970@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: [SWIPL] Help with the definiton of operators.
To: <srsilva@din.uem.br>, <prolog@swi.psy.uva.nl>,
   prolog-request@swi.psy.uva.nl
Phone: +31 - 20 - 525 6121

> Does anybody can explain me why I can't define the operator "@" as having
> precedence 950 in the code below?
> 
> ================================================
> Welcome to SWI-Prolog (Version 4.0.5)
> Copyright (c) 1990-2000 University of Amsterdam.
> Copy policy: GPL-2 (see www.gnu.org)
> 
> For help, use ?- help(Topic). or ?- apropos(Word).
> 
> ?- op(950, yfx, @).
> 
> Yes
> ?- current_op(P, T, @).
> 
> P = 100
> T = fx

Just try a bit harder:

1 ?- op(950, yfx, @).

Yes
2 ?- current_op(P, T, @).

P = 100
T = fx ;

P = 950
T = yfx ;

No
3 ?- 

I.e. something can be an infix and prefix operator at the same time.
@ref is used by XPCE.

	--- Jan

P.s.	Operators declared inside a module remain local to that module.
	You can define a public operator using ?- op(950, yfx, user:(@)).
	(This is not standard, but from what I understand of the ISO
	draft, operators will be local in the future).

