From p.singleton@keele.ac.uk  Fri Feb 25 04:05:50 2000
Received: from cmailg3.svr.pol.co.uk (cmailg3.svr.pol.co.uk [195.92.195.173])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id EAA06284
	for <prolog@swi.psy.uva.nl>; Fri, 25 Feb 2000 04:05:50 +0100 (MET)
Received: from modem4294967190.crime.dialup.pol.co.uk ([195.92.0.234] helo=keele.ac.uk)
	by cmailg3.svr.pol.co.uk with esmtp (Exim 3.13 #0)
	id 12OB4p-00066T-00; Fri, 25 Feb 2000 03:05:59 +0000
Message-ID: <38B573B4.5D5D2F8@keele.ac.uk>
Date: Thu, 24 Feb 2000 18:08:52 +0000
From: Paul Singleton <p.singleton@keele.ac.uk>
Organization: SmartArts Computing Consultancy
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
To: "prolog@swi.psy.uva.nl" <prolog@swi.psy.uva.nl>
CC: Alfonso Ortega de la Puente <alfonso@ii.uam.es>
Subject: Re: About read predicate and linux version.
References: <01BF7ED5.6F1D7AC0@priamo.ii.uam.es> <38B53E24.EAE9DDCD@noe.ubi.pt>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

> Alfonso Ortega de la Puente wrote:

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

Paulo Jorge Lopes de Moura wrote:

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

SWI-Prolog 3.3 wrote:

?- listing(treat_number_alfonso).

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

Yes
?- listing(treat_number_paulo).

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

Paul Singleton

