Re: Repetition cycles



rsm wrote:
> I have a lot of experience with languages such as C or Pascal. I am
> beginning to learn prolog (SWI Prolog) and I have a doubt: other
languages
> have several repetition structures like Repeat, While, For and prolog
> haven't. How can we implement by example a For cycle with prolog?

Most Prolog implementations have a repeat/0 predicate that you'll want
to take a look at. However, as a general rule, you should carefully
consider whether or not such things are really what you want. Doing
things in a procedural fashion isn't really what Prolog is geared
towards.

Cheers,
Ovid

.



Relevant Pages

  • Re: In which cases/problems is Prolog faster than Java?
    ... We've OOP languages built from functional languages foundations ... they are envy of imperative programming styles. ... still a predicate either in plain Prolog or encapsulated in a Prolog ... People often use Java not because its OO features per se but because ...
    (comp.lang.prolog)
  • Re: Is Prolog good for AI? (was: Minsky still posting)
    ... > than a programming language suitable for large scale direct human use. ... but it was Prolog nor AI. ... >> than most other languages. ... PHP because it solves a very specific problem. ...
    (comp.lang.prolog)
  • Re: Mainstreaming Prolog a Pragmatic Approach?
    ... > striking feature of Prolog. ... languages with pointers into structures. ... Japanese Fifth Generation project's adoption of the logic programming ... Another part of the problem is recursion. ...
    (comp.lang.prolog)
  • Re: Lisp/AI, Carnegie Mellon University
    ... > I tend to feel the same way about prolog, but people who are very fluent ... I guess it may be partly because Lisp has a core that can be ... > used for a functional programming style, somewhat like Scheme, which is ... > of what theoretical computer scientists call 'functional languages', ...
    (comp.lang.lisp)
  • Re: help about AI
    ... You will need to branch out on languages beyond C++. ... I have used Prolog and Common ... delivery systems and I haven't heard much about Common Lisp keeping up ... hard problem that has never had a reasonable solution. ...
    (comp.ai)