[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: ANN: Alien 0.3.1
- From: "Fabio Mascarenhas" <mascarenhas@...>
- Date: Thu, 14 Feb 2008 07:40:01 -0500
Does the function you are calling tolerate a NULL callback? Making a
nil check does remove a bit of safety from the API... abou point two,
I agree that I have to make callbacks act like alien functions and
respond to the same API after created.
About Alien vs lua-gtk, Alien is not supposed to be used raw, it is a
tool for experimenting with a C library, even on the Lua REPL, and
writing higher-level extensions without having to write C wrappers
first (think of it as a dynamic version of tolua). You still need to
worry about the portability of the code you are writing, that is why I
provide the alien.platform variable, and you still need to be careful
or it will segfault on you. You can find an extension I have been
writing (eating your own dogfood and all that :-) ) on
http://alien.luaforge.net/aio-current.tar.gz to see what I mean.
On Thu, Feb 14, 2008 at 1:57 AM, Thomas Harning <firstname.lastname@example.org> wrote:
> I've decided to try using Alien as a unit testing platform for a C
> library I wrote. While working on this I found a few deficiencies......
> * callbacks cannot be nil - relatively easy to patch... in
> alien_check_callback, check for nil and return NULL if so... [I think
> thats right...]
> * callbacks cannot be passed into a callback...
> EX: I have a callback that receives a 'next' callback that is to be
> called with results (and can be called multiple times, so return value
> cannot be hacked in well.)
> API suggestion: anonymous callbacks should be able to accept the
> :types function to apply types and make them callable.