Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small glitch in docu of library(dcg/high_order)). #1303

Closed
Jean-Luc-Picard-2021 opened this issue Aug 14, 2024 · 0 comments
Closed

small glitch in docu of library(dcg/high_order)). #1303

Jean-Luc-Picard-2021 opened this issue Aug 14, 2024 · 0 comments

Comments

@Jean-Luc-Picard-2021
Copy link

Jean-Luc-Picard-2021 commented Aug 14, 2024

While trying to do protobuf syntax with library(dcg/high_order))
it seems there is small glitch in the docu. It says here:

Element?, (Sep,Element)*

https://www.swi-prolog.org/pldoc/doc_for?object=sequence//3

But what it actually does is this here:

(Element, (Sep,Element)*) ?

Here is some testing. Omitting the first Element and then
repeatedly sep with Element doesn't work, thats why the last
test case fails. So it must have another specification:

?- phrase(foo(L), [i]).
L = [i].

?- phrase(foo(L), []).
L = [].

?- phrase(foo(L), [i,',',i]).
L = [i, i].

?- phrase(foo(L), [',',i]).
false.

The test code was:

foo(L) --> sequence(bar, baz, L).
bar(i) --> [i].
baz --> [','].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant