Re: Newbie can't understand Prolog answer
- From: "Dave Roberts" <dave-remove-no-spam@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 23 Jan 2008 20:47:03 -0800
"Jan Wielemaker" <jan@xxxxxxxxxxxxxxxxxxx> wrote in message news:slrnfpdv7f.268.jan@xxxxxxxxx
Possible some of the confusion is that Prolog isn't just a logical
language. It has side-effects and these are needed in many programs, for
example to write output. In the old days it would only print for
alternatives if it had an answer to a non-ground query. But people
complained that if you did
?- writeln(a) ; writeln(b).
It would write 'a' and 'Yes'. These people were confused too, and with
a reason.
Okay, that makes sense. I figured that side-effects were the ultimate reason. And you're right that I'm probably confusing Prolog with a pure logical language. I'm reading The Art of Prolog right now and the first chapters are all about idealized logical programming, and I'm guessing there may be divergences from actual Prolog.
-- Dave
.
- References:
- Newbie can't understand Prolog answer
- From: Dave Roberts
- Re: Newbie can't understand Prolog answer
- From: Dave Roberts
- Newbie can't understand Prolog answer
- Prev by Date: Re: Newbie can't understand Prolog answer
- Next by Date: Re: Newbie can't understand Prolog answer
- Previous by thread: Re: Newbie can't understand Prolog answer
- Next by thread: Parsing Context-sensitive languages with Prolog
- Index(es):
Relevant Pages
|
|