SWI-Prolog / packages-pengines

Pengines: Prolog engines
12 stars 13 forks source link

Typo in ground/1 call? #48

Open pmoura opened 5 years ago

pmoura commented 5 years ago

In the following clause:

https://github.com/SWI-Prolog/packages-pengines/blob/463c37310f30a081370f0cf282c5e4a05c5b84d4/pengines_io.pl#L651-L658

Do you meant to write instead ground(Term)?

JanWielemaker commented 5 years ago

That is most likely what was intended. I think the remark also suggests that a ground test is not ok though, so I think I'll leave it as is for now. Nice catch of dubious code though!

pmoura commented 5 years ago

The Logtalk linter flags the ground(json) goal as a goal that's always true. This lint check can be fouled, however. It's also flagging elsewhere in the SWI-Prolog library the goal random(2) =:= 0 was always being false 🙃