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

MakeStarFn: special handling for returning starlark.Value #17

Open
yangzh opened this issue May 14, 2019 · 0 comments
Open

MakeStarFn: special handling for returning starlark.Value #17

yangzh opened this issue May 14, 2019 · 0 comments

Comments

@yangzh
Copy link

yangzh commented May 14, 2019

First of all, great code and I'm enjoying it!

Not sure if my complain makes sense or any of you are aware of this, but when I tried to use convert.MakeStarFn to construct a *starlark.Builtin object, I will use a user function that will return a Starlark.Value, and convert.MakeStarFn code will put another wrapper about that, which is not good.

To give a concrete example, here is snippet of my code:

fnSomeCtor = covert.MakeStarFn("constructor", func(foo int) (starlark.Value, error) {
// return my own object that implements starlark.Value
})

currently convert.toValue() doesn't let a starlark.Value to pass through unharmed, instead, I think the code wraps it into a GoInterface(?), which is not good, as the consumer (my part) will get confused.

Can you special-case for starlark.Value? thanks.

chasehensel added a commit to chasehensel/starlight that referenced this issue Jul 6, 2020
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

1 participant