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

Display rules defined in REPL environment #108

Closed
tsandall opened this issue Oct 1, 2016 · 1 comment
Closed

Display rules defined in REPL environment #108

tsandall opened this issue Oct 1, 2016 · 1 comment

Comments

@tsandall
Copy link
Member

tsandall commented Oct 1, 2016

Busy or long-lived REPL sessions would benefit from a command to dump rules that are defined in the REPL environment. All REPL input is evaluated within a module, so the REPL environment is essentially the currently active module.

The simplest option would be a REPL command to "show" the currently active module, for example:

> p :- true
> show
package repl

p :- true

Another, more complex option, would allow the REPL to drop into the user's $EDITOR with an "edit" command. The editor would receive the text representation of the REPL's currently active module. This would be nice because then users could create and update complex rules, on the fly, with their choice of editor. (something which is a bit of a pain today).

@timothyhinrichs
Copy link
Member

I don't know of any REPLs that will open an editor. If the Repl did open in an editor, I think people would want it to work so that if they hit Save, it would update the REPL. That sounds somewhat complex. If someone wants to edit in an editor and yet use OPA for debugging, a simpler approach would be to make OPA watch for changes to files on disk and reload those files when they change.

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