Subject: Re: [ruby-ffi] Re: lists only one lib? |
From: Jon |
Date: 12/21/09 11:32 AM |
To: ruby-ffi@googlegroups.com |
<luislavena@gmail.com> wrote:On Mon, Dec 21, 2009 at 4:59 PM, Luis LavenaWayne already answered to you that ffi_lib takes an array, multiple invocations to append are not possible.:) And I was bugging Wayne with such questions as well... :) Looking at the ffi_lib code now, it is clear that subsequent ffi_lib calls are not good. Well, maybe we should make that totally explicit, and just don't allow to call ffi_lib the second time? Thanks, --VladimriFrom the perspective of a new FFI API user, these are all valid questions with no immediate/clear answer: - What would happen on subsequent ffi_lib call? Will it append, or will it overwrite? - Is that even legal? If legal, is that a good practice? I know I had those questions when I was starting using FFI.
Vladimir,
How about starting a Library wiki page to begin capturing key usage points like this for FFI::Library? Yeh, I know you're already busy with JRuby but think I and others can help with tweaks :)
I think if we can continue to build up the wiki, especially for the core objects and usage patterns (and keep them up-to-date) it will go a long way to ease FFI startup costs.
One balancing challenge will be to keep them API-ish enough that they are applicable across the impls while highlighting (not overwhelming) impl-specific issues that may trip you up when trying to write a cross-impl and cross-platform FFI-based extension.
Jon