Replies: 2 comments 2 replies
-
The DCG primer mentions that we can inspect a rule by declaring it dynamic and using
which looks good. We extract However for the faulty rule, we see this:
So I think I can see two problems here:
The right explicit code (I think) should look something like:
In fact I can run this with phrase and get the expected result:
|
Beta Was this translation helpful? Give feedback.
-
Semicontext has to be a list. Thus for a rule |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
A version of the rule that works as expected is as follows:
however the following minor variation of the rule fails always, and to my eyes it should equivalent to the above one:
Reading the DCG primer, it specifies that:
But it is true that it always uses an explicit list in the semicontext notation section.
I don't really understand why pushing an item that is itself a list doesn't seem to be allowed. Perhaps this is intentional or is it just a limitation on how the rule is parsed?
Beta Was this translation helpful? Give feedback.
All reactions