Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

Calling Perl from Rust #14

Open
1 of 4 tasks
vickenty opened this issue Oct 30, 2016 · 0 comments
Open
1 of 4 tasks

Calling Perl from Rust #14

vickenty opened this issue Oct 30, 2016 · 0 comments

Comments

@vickenty
Copy link
Owner

There are four functions to call into Perl in XS, of which only one is currently supported.

  • I32 call_sv(SV* sv, I32 flags);
  • I32 call_pv(char *subname, I32 flags);
  • I32 call_method(char *methname, I32 flags);
  • I32 call_argv(char *subname, I32 flags, char **argv);

What would be the best way to represent different combinations of flags? Some of them are mutually exclusive, others depend on other flags.

A further improvement can be a macro that hides different ways to call a sub, and handles argument passing, something like:

call!(ctx, sub_sv, a, b, c);
call!(ctx, "Foo::name", a, b, c);
call!(ctx, sv->"name", a, b, c);
call!(ctx, sv->method_sv, a, b, c);
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant