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

include op to return results from evaluated sub-script #684

Merged
merged 2 commits into from
May 6, 2024

Conversation

luketpeterson
Copy link
Contributor

This is a change requested by @TeamSPoon to match behavior of the old import op. With this change, the include op will return the last result from evaluating the sub-script.

@luketpeterson luketpeterson requested a review from vsbogd May 6, 2024 04:30
// `import!` before before module isolation. However that means the results prior to
// the last are dropped. I don't know how to fix this or if it's even wrong, but it's
// different from the way "eval-type" APIs work when called from host code, e.g. Rust
Ok(eval_result.into_iter().last().unwrap_or_else(|| vec![]))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, yeah, as only last result is returned and other are dropped I am not sure if this really required change. On the other hand I don't object so we can merge it. @TeamSPoon does this change help?

@luketpeterson luketpeterson merged commit 8b00b42 into trueagi-io:main May 6, 2024
2 checks passed
@vsbogd
Copy link
Collaborator

vsbogd commented May 6, 2024

@luketpeterson , please change type() method as well.

@luketpeterson
Copy link
Contributor Author

Ah. Oops. Thanks for catching that.

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.

2 participants