Subject:
Re: [ruby-ffi] Re: lists only one lib?
From:
Evan Phoenix
Date:
12/21/09 11:41 AM
To:
ruby-ffi@googlegroups.com


On Dec 21, 2009, at 9:11 AM, Vladimir Sizikov wrote:

> Hi Luis,
> 
> On Mon, Dec 21, 2009 at 4:59 PM, Luis Lavena <luislavena@gmail.com> wrote:
>> Wayne already answered to you that ffi_lib takes an array, multiple
>> invocations to append are not possible.
> 
> From 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. :) 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?

Probably best to have ffi_lib raise an exception if the libs are already set. That solves it nicely and keeps users from tripping up on this.

 - Evan

> 
> Thanks,
>  --Vladimri
>