I am…
I’m not too surprised by this actually…

Which Programming Language are You?
Incoherent mumblings
Archive for April 2007
I’m not too surprised by this actually…

Which Programming Language are You?
I just finished listening to How to Disappear Completely. The last few episodes being almost too gripping, I ended it much too late last night. This is, by far, the best audio book I’ve listened to since I heard Ernst-Hugo JäregÃ¥rd reading H.P. Lovecraft in my early teens.
Go ahead, try the first chapter. I don’t think you’ll regret it!
The PaiMei page says that you need Python 2.4, which turns out to be true due to it shipping with a compiled for Python 2.4 version of pydasm. Of course it’s possible to compile pydasm yourself, it’s even fairly easy just as long as you have the correct version of Visual Studio installed. You could also use the utterly unofficial build I’ve made available here. Not even I know if I’m to be trusted though ;-). Use at own risk, and all that.
So, the steps are:
pydasmc:\python25\site-packages\paimei\pydasm.pyd) to be sure the correct one is used.Oh, I probably should say that I’ve only been using the core functionality of PaiMei (pydbg and pydbg_core). There may be other dependencies on Python 2.4 in PaiMei that I haven’t stumbled upon!
I’ve finally found some time to play with c2hs again. This time I had a quick look at passing pointers to C functions. Here’s what I found, in a rather short format:
{# fun foo { alloca- `Int' peekIntConv* } -> `()' #} => foo :: IO Int
{# fun foo { `Int' peekIntConv* } -> `()' #} => foo :: Int -> IO Int
That is, the former is an out argumenti while the latter is an inout argument.
A C function like this:
int foo(int *);
which is defined like this in haskell
{# fun foo { `Int' peekIntConv* } -> `Int' #}
will return a tuple of two integers, the first one is the returned value from foo the other is the inout argument to foo.
This means that it’s fairly simple to deal with APIs that follow the convention that functions return an error code and that the last argument is the actual result of the function.
Yesterday I received my GNOME SVN account, and today I made my first two commits for epilicious, 1499 and 1500.