1 Oct 2003 21:48
easyffi - continued.
felix <felix <at> call-with-current-continuation.org>
2003-10-01 19:48:29 GMT
2003-10-01 19:48:29 GMT
Hello!
The "easy" FFI parser now understands a little C++. Classes are wrapped
into TinyCLOS classes, so you can do things like:
;;; sample.scm
(declare (uses tinyclos))
#>!
class Foo {
public:
Foo() {}
int yo(int n) { return n * 2; }
};
<#
(define f1 (make <Foo>))
(yo f1 123) ==> 246
(destroy f1) ; alternatively: (set-finalizer! f1 destroy)
Needless to say, the C++ parser has a *lot* of restrictions, but for
simple cases, and hand-tuned C++ headerfiles it might prove useful.
cheers,
felix
RSS Feed