Projects

Ticket #585 (new defect)

Opened 7 months ago

Last modified 7 months ago

FFI , attach_variable missing?

Reported by: rob@… Owned by: lsansonetti@…
Priority: blocker Milestone:
Component: MacRuby Keywords:
Cc:

Description

Hi,

I was really happy to hear that FFI shipped with MacRuby but then I ended up a little disappointed :-P

require 'ffi'
extend FFI::Library
method(:attach_function).owner # => TopLevel
method(:attach_variable).owner # => NoMethodError

I guess this could be intentional? I'm not sure. For my case I should be okay because I'm trying to read from a constant I know the value of, but just throwin' it out there.

Change History

in reply to: ↑ description   Changed 7 months ago by rob@…

Every time I forget my macruby version, sorry:

 robert-gleesons-iMac:rb_sandbox robertgleeson$ macruby -v
MacRuby version 0.5 (ruby 1.9.0) [universal-darwin10.0, x86_64]

I also noticed a tiny little difference between MRI, too. method(:attach_function).owner returns FFI::Library, while MacRuby returns 'TopLevel'.

  Changed 7 months ago by mattaimonetti@…

The FFI implementation is very basic and as far as I know, there is no really-short-term plans to improve it unless volunteers step up to help.

Note: See TracTickets for help on using tickets.