0

I am trying to execute the example code from RosettaCode's take on writing an evolutionary algorithm in Prolog (see here).

Can anybody tell me how to generate the same output as displayed below the code example?

  • 1
    I don't get exactly the same output, but if you start Prolog with `swipl --traditional` then it runs. The problem is that quotation marks used to mean list of chars, but now it apparently means something else. – Tomas By Jan 19 '18 at 13:30
  • What have you tried and what specific issue are you encountering? – lurker Jan 19 '18 at 14:02
  • I tried executing the `time(weasel).` line in the swipl-environment and it told me, it threw a type error (expected: List, found: string) in line 13. This could be solved by either starting Prolog the way @TomasBy suggested or by replacing all quotation marks in the code with backquotes/graves (`). Thank you very much! – user2562389 Jan 19 '18 at 14:35

1 Answers1

1

The problem is the interpretation of quotation marks in newer SWI Prolog versions (> 7.x).

Two solutions:

  1. Start Prolog with swipl --traditional
  2. Replace all quotation marks in the code with backquotes (`)

Thank you Thomas By for your help!