chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Question about easyffi


From: Ivan Raikov
Subject: Re: [Chicken-users] Question about easyffi
Date: Mon, 06 Aug 2007 09:56:28 +0900
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Okay, so I have the following code:


   ;; Embed, but do not parse
   #>
    #include <Python.h>
   <#

   ;; Parse & embed
   #>!

   ___declare(type, "pyobject;\"PyObject\";py-object-to;py-object-from")
  
   PyObject *PyObject_CallObject (PyObject *, PyObject *);

   <#

   ;; Scheme -> Python
   (define (py-object-to value)
     ....


   ;; Python -> Scheme
   (define (py-object-from value)
     ....

It compiles, but when I actually try to evaluate this:

   (PyObject_CallObject func (list->vector (list)))

I get an exception:

   Error: bad argument type - not a pointer: #()

What am I doing wrong here?

     -Ivan

"felix winkelmann" <address@hidden> writes:

> On 8/3/07, Ivan Raikov <address@hidden> wrote:
>>
>>     PyObject *PyObject_CallObject (PyObject *, PyObject *);
>>
>> I would like to specify Scheme procedures that take a PyObject
>> pointer, and convert that to a Scheme value, and vice versa.
>
> "___declare(type, ...)" should provide what you need (see the easyffi
> wiki page - it's somewhat buried in there).
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]