Sylvester Keil wrote in post #1030842:

How could I know that bulder.c -> builder.prefix changed the function an 
instance method to a "function"? I am pretty desperate for some reading 
- and examples - on this matter! Something modern (i. e. Ruby 1.9) and 
something that is about inline C and not necessarily all of Ruby's API.

I changed the code and cleaned up a few things:

Ruby code: http://pastie.org/2831055
Inline code: http://pastie.org/2831058

Now I get a warning - and the wrong output:

/Users/maasha/.ruby_inline/Inline_Scan_5319.c: In function 'backtrack':
/Users/maasha/.ruby_inline/Inline_Scan_5319.c:38: warning: implicit 
conversion shortens 64-bit value into a 32-bit value
false


Cheers,


Martin


> On Nov 8, 2011, at 12:10 PM, Martin Hansen wrote:
>
>>
>> I tried to apply the suggested changes, but the C code still have "VALUE
>> self" as first argument in the functions. How did you get rid of that?
>
> Did you change line 38 in http://pastie.org/2825882 from
>
> "builder.c %{" to "builder.prefix %{"
>
> ?
>
> If you don't define backtrack as an instance method, self will not be
> expected to be passed as first argument.

-- 
Posted via http://www.ruby-forum.com/.