[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: if

From: Fergus Henderson
Subject: Re: if
Date: Tue, 30 Jan 2001 15:36:34 +1100

On 30-Jan-2001, Ron Stodden <address@hidden> wrote:
> Eduardo Damasio da Costa wrote:
> > 
> > I am new to prolog and I am surprised apparently there is no "if" predicate.
> In a pure sense, that is true.

I'm not sure what you mean by that.
But the ISO Prolog standard definitely has an if-then-else construct.

Perhaps you mean that "pure Prolog" doesn't have if-then-else?
If so, I think that is a red herring.

> There is no need for an if construct because Prolog is a logical language,

If you want to write practical Prolog programs, there is every need
for an if-then-else construct.

In logic languages which don't have if-then-else, but which do have
cut, e.g. Lambda Prolog, you can simulate if-then-else using cut.
But this is a hack; it's nicer if the language supports if-then-else

Fergus Henderson <address@hidden>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <>  |     -- the last words of T. S. Garp.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]