Ugh, please, please don't implement this in XS. Just write a simple Perl wrapper that allows named arguments and have it call your XS routine with the arguments represented in a way that is easy (preferably trivial) for you to get at them using C code.
By using Perl code to define the interface, you will almost certainly end up with an interface that is easier to use from Perl code, easier to understand, debug, maintain, and enhance, and you won't be doing things in XS that are likely to break with updates to Perl or not work when given "magic" things like tied hashes, etc.
I went back and forth for a while on whether named parameters should be passed as a list of items or as a hash reference. After lots of cases I decided that the hash reference is more versatile and so I always use that now.
- tye (but my friends call me "Tye")In reply to (tye)Re: XS hash question
by tye
in thread XS hash question
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |