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

Make Engine Predicate -> Kernel Expression Visitor consistent with Kernel -> Engine visitor #748

Open
OussamaSaoudi opened this issue Mar 17, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@OussamaSaoudi
Copy link
Collaborator

Please describe why this is necessary.

The model for Engine -> kernel expression visiting is different from Kernel -> Engine visitor.

In particular, visit_expression_and is not great to implement over ffi due to the EngineIterator. It would be easier to use the child list abstraction that schema visitor and kernel->engine visitor use.

Moreover, it is not intuitive that the *const c_void child is casted to a usize in this:

#[no_mangle]
pub extern "C" fn visit_expression_and(
    state: &mut KernelExpressionVisitorState,
    children: &mut EngineIterator,
) -> usize {
    let result = Expression::and_from(
        children.flat_map(|child| unwrap_kernel_expression(state, child as usize)),
    );
    wrap_expression(state, result)
}

Describe the functionality you are proposing.

No response

Additional context

No response

@OussamaSaoudi OussamaSaoudi added the enhancement New feature or request label Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant