David -
On Tue, May 8, 2012 at 8:38 PM, David Oswald <daosw...@gmail.com> wrote: > On Tue, May 8, 2012 at 10:24 AM, David Mertens <dcmertens.p...@gmail.com> > wrote: > > To those not CC'd: > > > > I posted a question on p5p and Nicholas Clark pointed out that sv_cmp > looks > > like it's *exactly* what you need, both as a general comperator, and as a > > means to implement eq, lt, gt, etc. Does this look right? > > David > > Thanks for taking that initiative. I was a little shy about asking on > P5P for some reason; I've been on the p5p list since December, so I've gotten some idea for what passes as acceptable. :-) Perl5Porters doesn't usually get that sort of question, but I've seen far sillier questions, and I've asked similar questions elsewhere and not gotten anywhere. > I guess I wasn't sure if I was asking the right question. > Funny you mention it. I certainly asked the wrong question, but still managed to get the right answer. :-) > It looks like sv_cmp is the right tool for the job. > > It's unfortunate that the API is so opaque in this area. One of > Perl's strengths is text processing, but when writing XS extension > code that should "just work" regardless of whether the text handed to > it is Unicode or not, that strength is stripped away if nobody can > figure out how to do it. I think you and Nicholas made progress. > I've also felt that perlapi generally lacks good examples. I could see myself enjoying expanding these docs. > I probably won't have a chance to work with it for a few days, but > when I do I'll be sure to discuss my experiences here on the Inline > list (hopefully on-topic since I'll use Inline::C or maybe Inline::CPP > and then possibly Rob's c2xs or cpp2xs. > > Dave > > -- > > David Oswald > daosw...@gmail.com > No rush on my end. I've already gained much just learning more about the C API and the process for expanding it was a learning. David -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." -- Brian Kernighan