-Original Message-
From: David Oswald
Sent: Thursday, August 15, 2013 7:45 AM
To: inline
Subject: Using Inline::C to Implement a binary search with callback
(clobbering $a, $b, leaking)
I'm working on implementing a binary search using Inline::C.
Eventually I want to be able to ca
I'm working on implementing a binary search using Inline::C.
Eventually I want to be able to call it like this:
my $found_ix = binary_search { $a <=> $b } @ordered_numbers;
or
my $found_ix = binary_search { $a cmp $b } @ordered_strings;
Currently I've got it to this point:
my $found = binary_
Rob,
Thanks!
My use-case is that I'm rewriting List::BinarySearch in XS via
Inline::C and eventually InlineX::C2XS. I haven't had a chance to put
your clues to the test, but should be able to get to it this
afternoon.
My eventual goal (once I get around to figuring out prototypes via
Inline::C)
-Original Message-
From: David Oswald
Sent: Wednesday, August 14, 2013 7:24 AM
To: inline
Subject: Implementing a callback with Inline::C
See also http://www.perlmonks.org/index.pl?node_id=976632 for some other
ideas.
The "perfect" approach still eludes me, however.
Cheers,
Rob