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

Removing :default keyword #421

Open
yihozhang opened this issue Sep 6, 2024 · 0 comments
Open

Removing :default keyword #421

yihozhang opened this issue Sep 6, 2024 · 0 comments
Assignees

Comments

@yihozhang
Copy link
Collaborator

yihozhang commented Sep 6, 2024

We have decided that functions no longer accepts a :default argument. In other words, no "non-constructor" functions can no longer be implicitly created. Instead, the user is responsible for initializing functions using set explicitly.

This means the following function (from merge-saturates.egg) is no longer expressible in egglog, because (1) baz should not have a :default and (2) looking up (baz new) in bar's merge expression is not allowed (related: #420).

(function baz (i64) i64 :default 0)

(function bar () i64 :merge (min (baz new) 0))

(set (bar) 1)
(set (bar) 2)

(rule ((= f (baz x)) (< x 50))
      ((set (bar) (+ x 1))))
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