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

documentation for catch/3 suggests discarding choices in scope, contrary to behaviour #121

Closed
prologbyexample opened this issue Jan 2, 2023 · 1 comment

Comments

@prologbyexample
Copy link

prologbyexample commented Jan 2, 2023

The documentation for catch(Goal, Exception, Handler) has the following phrase:

all choice points generated by Goal are cut, the system backtracks to the start of catch/3

However, the observed behaviour is that solutions found in the scope of Goal before an exception is thrown remain.

This issue is discussed with an example in this stackoverlflow [question.](all choice points generated by Goal are cut, the system backtracks to the start of catch/3)

Should the documentation be clearer, or have I misunderstood it?

@JanWielemaker
Copy link
Member

The docs do not say anything about solutions produced by Goal before the exception. It only says that remaining choicepoints are cut (pruned might be a better term).

I don't think the docs are wrong. Whether they are clear is another matter. Describing these procedural predicates is usually hard. I think that is more something to discuss on the discourse forum. If anyone comes up with a correct and clearer description this will of course be used.

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

2 participants