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

improve return value convention for hsperl_return_conv #19

Open
phlummox opened this issue Feb 6, 2021 · 0 comments
Open

improve return value convention for hsperl_return_conv #19

phlummox opened this issue Feb 6, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@phlummox
Copy link
Owner

phlummox commented Feb 6, 2021

The C function SV ** hsperl_return_conv (int count) has a needlessly complex way of returning values and errors – it allocates an array of SVs, with up to two NULL terminators (explanation here),

It'd be better to just provide an "out" parameter, that might contain return values or errors, and use an int return value to indicate which is the case. But also - there doesn't seem to be any reason to provide multiple error values. (I think one is intended to be always a string, the other, potentially, a reference to a more complex Perl structure.) We can just provide one, and let the caller work out how best to deal with it.

@phlummox phlummox added the enhancement New feature or request label Feb 6, 2021
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