Projects

Ticket #585 (new defect)

Opened 2 years ago

Last modified 14 months ago

FFI , attach_variable missing?

Reported by: rob@… Owned by: lsansonetti@…
Priority: blocker Milestone: MacRuby Later
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 2 years 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 2 years 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.

  Changed 14 months ago by watson1978@…

  • milestone set to MacRuby 1.0

  Changed 14 months ago by lsansonetti@…

  • milestone changed from MacRuby 1.0 to MacRuby Later

I think this bug is for Later. We cannot fully implement FFI in 1.0, so it might even be a good idea to remove it from trunk.

Note: See TracTickets for help on using tickets.