Skip to content

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

Open
@JoergStrebel

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions