-
How can one use meta-predicates like
The code used: solve(File, Solution) :-
phrase_from_file(parse(Solution), File). parse is defined as a DCG, let's say: parse(C) --> [C]. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The linter warnings about calling a predicate as a non-terminal or a non-terminal as a predicate are new and there may be a case here (where the meta-predicate is defined in a Prolog module) that's not yet handled that results in a false positive. These linter warnings were added to help enforce coding guidelines and allow in the future grammar rules to be compiled differently. |
Beta Was this translation helpful? Give feedback.
-
In Logtalk 3.73.0-b07 and later versions, the linter checks if the caller of the non-terminal is a phrase-like predicate declared in the backend adapter file. This avoids the false positive linter warning in your case. |
Beta Was this translation helpful? Give feedback.
In Logtalk 3.73.0-b07 and later versions, the linter checks if the caller of the non-terminal is a phrase-like predicate declared in the backend adapter file. This avoids the false positive linter warning in your case.