[Top][All Lists]

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

Re: [Chicken-users] New "easy" FFI

From: Miles Egan
Subject: Re: [Chicken-users] New "easy" FFI
Date: Mon, 22 Sep 2003 14:42:30 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5b) Gecko/20030903 Thunderbird/0.2

felix wrote:


Chicken got a new FFI interface (informally called the "easy" FFI).
It parses a subset of C and generates procedure and variable bindings
from declarations, like this:

#>! #include <math.h>

#define my_pi 3.14

int var = 99;
extern double sin(double);

(print (sin my_pi))
(print (var))
(var 123)
(print (var)) ; now 123

The parser does basic macro substitution, handles simple macros,
enums, typedefs, variable declarations and function prototypes.
Most preprocessor commands are implemented.

Pretty cool.

Why did you decide to treat C variables (var in the above) as scheme functions instead of scheme variables?


reply via email to

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