chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] ffi questions and bug (?)


From: Carlos Pita
Subject: [Chicken-users] ffi questions and bug (?)
Date: Thu, 19 May 2005 18:28:54 -0300
User-agent: KMail/1.7.2

Hi! I'm really newbie to chicken. My main
interest is implementing an efficient
framework for music synthesis/composition
and I'm evaluating between python/numarray
(mainly delegating intensive inner loops to
numarray C broadcasting functions) and the
direct ->C compilation capabilities of
chicken. That said, I'm pretty interested in
the ffi and also the swig module (more than
the easy-ffi).

Just to get the feeling, can you give me a
simple example of (manually) wrapping a
trivial C++ class using the ffi and tinyclos
(I mean "manually" without recurring to
easy ffi or swig)? That is just to understand
how each piece fits. I couldn't find an example
like that in the distro. I'm more or less
experienced with python/swig and eventually
I could contribute some stuff to chicken/swig
because I guess I will need at least some
typemaps to the std:: that it currently doesn't
provide.

Then and unrelated, I think the following is a bug
(in chicken 1.89):

1)
From the manual:

(define-foreign-record NAME SLOT ...)
   If NAME is a symbol, then a C declaration will
   be generated that defines a C struct named
   struct NAME. 

2)
But:

  (define-foreign-record C
    (int x))

generates:

   struct foo { 
    int x;
   };

('foo' seems to be hardcoded)

3)
Perhaps here... In chicken-ffi-macros.scm:

(define-macro (define-foreign-record name . slots)
  ...
  if (pair? name)
    ...
    ; else part
    ...
      (cons "struct foo { "

Thank you in advance.
Regards,
Carlos.






reply via email to

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