LearnPrologNow/lpn

"List as terms" section no longer applicable to SWI Prolog 7

JoergStrebel opened this issue · 0 comments

Learn Prolog now 9.2 introduces the list constructors . and [] and gives some example code :
?- .(a,[]) == [a]. yes

In SWI Prolog 7, this example gives the error

ERROR: Stream user_input:25:1 Syntax error: Unexpected end of clause

After googling, I found the reason: http://www.complang.tuwien.ac.at/ulrich/iso-prolog/SWI7_and_ISO. SWI7 deviates from the Prolog standard a bit as it seems. The workaround in SWI 7 is using [|], such as: ?- [a|[]]==[a].
(please see SWI documentation). Maybe you should add an explanatory message to the LPN mentioned above.