Update bindings to use constructors
Opened this issue · 0 comments
Once #461 is merged, we need to update what is emitted in egglog.
In terms of the disallowing lookups in actions, this will just be a breaking change.
For the other part, renaming functions to constructors, this can be done automatically. It's a bit tragic because we use @function
and @method
in the Python codebase, and now @function
would likely emit a constructor
not a function
, so it's a bit confusing.
But basically, we can emit a constructor whenever the result is an eqsort (user defined) and a function if the result is a primitive.
However, we can also have an eqsort returning function, which only allows it to be set once and not unioned. We could add this as a kwarg constructor=False
to force this even if you return an eqsort.
However, things are still in flux, so this may change.