From pmoura@noe.ubi.pt  Thu Feb 24 15:21:21 2000
Received: from noe.ubi.pt (noe.ubi.pt [193.136.64.94])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id PAA23763
	for <prolog@swi.psy.uva.nl>; Thu, 24 Feb 2000 15:21:20 +0100 (MET)
Received: from noe.ubi.pt (delta.ubi.pt [193.136.64.178])
	by noe.ubi.pt (8.9.3/8.9.3) with ESMTP id OAA18779;
	Thu, 24 Feb 2000 14:19:44 GMT
Message-ID: <38B53E24.EAE9DDCD@noe.ubi.pt>
Date: Thu, 24 Feb 2000 14:20:05 +0000
From: Paulo Jorge Lopes de Moura <pmoura@noe.ubi.pt>
Reply-To: pmoura@noe.ubi.pt
Organization: University of Beira Interior, Portugal
X-Mailer: Mozilla 4.7 (Macintosh; I; PPC)
X-Accept-Language: en,pdf
MIME-Version: 1.0
To: Alfonso Ortega de la Puente <alfonso@ii.uam.es>
CC: "prolog@swi.psy.uva.nl" <prolog@swi.psy.uva.nl>
Subject: Re: About read predicate and linux version.
References: <01BF7ED5.6F1D7AC0@priamo.ii.uam.es>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by swi.psy.uva.nl id PAA23763


Alfonso Ortega de la Puente wrote:
> 
>         I'm using swi-prolog 3.2.3 for Windows. Is there any reason for the following behaviour?
> 
>         treat_number:-
>                 read(A),
>                 A < 0
>                 ->
>                         B is A * 3, write(B) ;
>                         C is A * 4, write(C).
> 
>         If a number is read from a file by means of the see/seen mechanism, why the variable A in the last sentence remains unbound?

Maybe what you want is:

	treat_number:-
		read(A),
		(A < 0 ->
			B is A * 3, write(B)
			;
			C is A * 4, write(C)).
 
Regards,

Paulo


-----------------------------------------------------------
Paulo Jorge Lopes de Moura
Dep. of Mathematics and Informatics   Office 4.32 Ext. 3251
University of Beira Interior          Phone: +351 275319700
6200 Covilhã                          Fax:   +351 275319732
Portugal

mailto:pmoura@noe.ubi.pt
http://www.ci.uc.pt/logtalk/pmoura.html
-----------------------------------------------------------

