Skip to content

Expression enum and Root variant - #9247

Open
mhk197 wants to merge 3 commits into
developfrom
mk/root-expression
Open

Expression enum and Root variant#9247
mhk197 wants to merge 3 commits into
developfrom
mk/root-expression

Conversation

@mhk197

@mhk197 mhk197 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Makes Root an Expression variant instead of a ScalarFnVTable implementation.

This is groundwork for lambdas and variables — those are also nodes whose dtype comes from the
scope rather than from their children, and they need the same treatment.

Root is not a scalar function. Its dtype comes from the scope rather than from its children (it has no children) and it is not executable.

This PR makes Expression an enum instead of a struct. Root becomes a variant, and upcoming Lambda and Variable become variants as well.

pub enum Expression {
    Scalar { scalar_fn: ScalarFnRef, children: Arc<Vec<Expression>> },
    Root,
}

@mhk197 mhk197 changed the title root as expression variant Expression as enum instead of struct Aug 6, 2026
@mhk197 mhk197 changed the title Expression as enum instead of struct Expression enum and Root variant` Aug 6, 2026
@mhk197 mhk197 changed the title Expression enum and Root variant` Expression enum and Root variant Aug 6, 2026
mhk197 added 2 commits August 6, 2026 11:55
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
@mhk197 mhk197 linked an issue Aug 6, 2026 that may be closed by this pull request
Signed-off-by: Matt Katz <mhkatz97@gmail.com>
@mhk197
mhk197 force-pushed the mk/root-expression branch from 8dc4b89 to 996a4e3 Compare August 6, 2026 19:23
@mhk197
mhk197 marked this pull request as ready for review August 6, 2026 19:54
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

Successfully merging this pull request may close these issues.

Epic: Support Higher Order Functions

1 participant