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

-t Goal command line option would be useful #2651

Open
triska opened this issue Oct 31, 2024 · 2 comments
Open

-t Goal command line option would be useful #2651

triska opened this issue Oct 31, 2024 · 2 comments

Comments

@triska
Copy link
Contributor

triska commented Oct 31, 2024

As mentioned in #187 (comment), a -t Goal command line option would be useful.

This would allow us to invoke Scryer Prolog as:

$ scryer-prolog -g run -t halt program.pl

and have it reliably return to the shell (instead of starting the toplevel interaction), also if the specified goal fails or yields an exception.

@hurufu
Copy link
Contributor

hurufu commented Oct 31, 2024

I think this feature must be well documented, because it is not immediately obvious what is the difference between "running the query" an "running the query in a toplevel".

Also you can currently use multiple -g switches:

$ scryer-prolog -g 'throw(error)' -g 'write(hello)' -g 'halt'
throw(error) causes: error
hello⏎           

@triska
Copy link
Contributor Author

triska commented Oct 31, 2024

Excellent point about multiple -g switches! This could be used to solve the issue where this most recently arose (aarroyoc/doclog#9) more elegantly!

The key difference between that and the proposed -t option would be that -t lets us specify an alternative toplevel as well, to which Scryer would turn to after the goals succeed, fail or throw an exception.

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