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

Error in passing string value to function of type NativeFunctionData #633

Closed
elasmojs opened this issue Aug 14, 2020 · 3 comments · Fixed by #625
Closed

Error in passing string value to function of type NativeFunctionData #633

elasmojs opened this issue Aug 14, 2020 · 3 comments · Fixed by #625
Assignees
Labels
API enhancement New feature or request
Milestone

Comments

@elasmojs
Copy link
Contributor

Hi

The dev branch seems pass string values along with quotes when passing arguments to functions of type NativeFunctionData

thanks

@elasmojs elasmojs added the bug Something isn't working label Aug 14, 2020
@HalidOdat
Copy link
Member

The dev branch seems pass string values along with quotes when passing arguments to functions of type NativeFunctionData

Could you give an example of this?

@elasmojs
Copy link
Contributor Author

elasmojs commented Aug 14, 2020

Could you give an example of this?

I just issued a pull request for #446 (#634) , it has the snippet in modulehandler.rs line 44
hope that helps

@HalidOdat
Copy link
Member

This is not a bug, when you call value.to_string() it calls value Display trait which puts quotes around strings. instead use Interperter::to_string(value) after #625 this should be more intuitive. since to display it you have to call Value::display() and to turn the value to a string you call Value::to_string(ctx).

@HalidOdat HalidOdat removed the bug Something isn't working label Aug 15, 2020
@HalidOdat HalidOdat linked a pull request Aug 15, 2020 that will close this issue
@HalidOdat HalidOdat self-assigned this Aug 15, 2020
@HalidOdat HalidOdat added API enhancement New feature or request labels Aug 15, 2020
@Razican Razican added this to the v0.10.0 milestone Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants