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

Syntax proposal: for #455

Open
yihozhang opened this issue Oct 28, 2024 · 1 comment
Open

Syntax proposal: for #455

yihozhang opened this issue Oct 28, 2024 · 1 comment

Comments

@yihozhang
Copy link
Collaborator

It is common to define one-off rulesets and run them instantly for debugging purposes, e.g.,

(ruleset debug)
(rule ((= e (__some_conditions__)))
    ((extract e)
     ;; some other stuffs
    )
    :ruleset debug)
(run debug 1)

This is tedious and may interrupt the debugging flow, so here I propose a convenient form of the above snippet:

(for ((= e (__some_conditions__)))
    ((extract e)
      ;; some other stuffs
    ))

(or more generally for running N iterations:

(for N ((= e (__some_conditions__)))
    ((extract e)
      ;; some other stuffs
    ))

)

@oflatt
Copy link
Member

oflatt commented Oct 28, 2024

This does look useful

Perhaps we should have a little library of sugar you can import? We might want to draw a more explicit line between sugar and the egglog language

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