Subject: Re: [ruby-ffi] Is FFI::Struct.layout meant to be public? |
From: Wayne Meissner |
Date: 5/21/10 3:04 AM |
To: ruby-ffi@googlegroups.com |
If it works on both JRuby and ruby-ffi, create a spec for it (to ensure it doesn't get broken in future), then we'll call it officially public. i.e. I can't see much reason to not make it public. On 20 May 2010 03:42, Jeremy Voorhis <jvoorhis@gmail.com> wrote:
Hello, I'm working on a project where I generate both an FFI::Struct and an LLVM struct from the same description. It's been convenient to create the struct like so: klass = Class.new(FFI::Struct) klass.layout(...) This conveniently avoids devising a way to pass data into the scope of the class definition from the enclosing scope, but I'm having a little cognitive dissonance. Should FFI support this usage, or am I abusing the api? Thanks, Jeremy