Subject: Re: About read predicate and linux version.

From: Paul Singleton <[email-masked]>
Date: Thu, 24 Feb 2000 18:08:52 +0000

> 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